Skip to content

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:

pip install craftable
poetry add craftable
uv add craftable

Or if using uv pip:

uv pip install craftable

Your First Table

from craftable import get_table

rows = [
    ["Alice", 30, "Engineer"],
    ["Bob", 25, "Designer"],
]

print(get_table(rows))

Output:

 Alice  │ 30  │ Engineer 
 Bob    │ 25  │ Designer 

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