Getting Started
This page helps you install craftable and print your first table.
Installation
craftable is published on PyPI. Install with your preferred package manager:
Your First Table
from craftable import get_table
rows = [
["Alice", 30, "Engineer"],
["Bob", 25, "Designer"],
]
print(get_table(rows))
Output:
Spicing it Up
Add a header_row and try a different look with the style parameter:
from craftable import get_table
from craftable.styles import BasicScreenStyle
rows = [
["Alice", 30, "Engineer"],
["Bob", 25, "Designer"],
]
print(get_table(
rows,
header_row=["Name", "Age", "Title"],
style=BasicScreenStyle()
))
Output:
┌────────┬─────┬──────────┐
│ Name │ Age │ Title │
├────────┼─────┼──────────┤
│ Alice │ 30 │ Engineer │
│ Bob │ 25 │ Designer │
└────────┴─────┴──────────┘
What's Next
- Configure widths, wrapping, and truncation in the Usage guide
- Learn the format mini-language and table flags in the Formatting guide
- Explore built-in Styles
- Jump to the API reference