Typing stubs for tabulate

0.10.0.20260308 · active · verified Sun Apr 05

types-tabulate is a type stub package part of the `typeshed` project, providing static type checking information for the `tabulate` library. `tabulate` itself is a popular Python library (current version 0.11.0, released in March 2026) that pretty-prints tabular data from various data structures like lists of lists, dictionaries, or Pandas DataFrames into highly customizable, human-readable formats (e.g., plain text, grid, Markdown, HTML). `types-tabulate` ensures that code using `tabulate` can be statically analyzed by type checkers like MyPy and Pyright for correctness, without adding runtime overhead. The package releases are aligned with `typeshed` and aim to provide accurate annotations for specific `tabulate` versions, currently targeting `tabulate==0.10.*`.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates basic usage of the `tabulate` library for which `types-tabulate` provides typing information. It shows how to create a formatted table from a list of lists and a list of dictionaries, using different table formats like 'grid' and 'fancy_grid'.

from tabulate import tabulate

data = [
    ["Name", "Age", "City"],
    ["Alice", 30, "New York"],
    ["Bob", 24, "Los Angeles"],
    ["Charlie", 35, "Chicago"]
]

# Print with headers from the first row
print(tabulate(data, headers="firstrow", tablefmt="grid"))

print("\n---\n")

# Or from a list of dictionaries
data_dicts = [
    {"Item": "Pizza", "Price": 850},
    {"Item": "Burger", "Price": 500},
    {"Item": "Salad", "Price": 475}
]
print(tabulate(data_dicts, headers="keys", tablefmt="fancy_grid"))

view raw JSON →