python-tabulate

Pretty-print tabular data in Python with one function call and dozens of table formats.

Library
PyPI
v0.10.0
2,586 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
41 /100 Fair
Development Activity 4
Maintenance 0
Community 60
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
73 /100 Good
Architecture 70
Code Quality 78
Innovation 55
Learning Curve 90

Tabulate is a small, focused Python library that turns lists of lists, dicts, NumPy arrays, and pandas DataFrames into readable, aligned plain-text tables. A single tabulate() call handles column alignment, numeric formatting, and header rendering, so developers can print clean tabular output in scripts, CLIs, and notebooks without hand-rolling padding logic.

Its standout feature is breadth of output formats: over 30 table styles ranging from plain and simple text to GitHub-flavored Markdown, reStructuredText, HTML, LaTeX, and Jira/Confluence markup, plus a suite of Unicode box-drawing grids (simple, rounded, heavy, mixed, double, fancy). This makes it equally useful for quick debugging output and for generating tables destined for documentation or reports.

Beyond the Python API, the package installs a tabulate command-line utility that reads CSV, TSV, or JSON-lines data from a file or stdin and renders it in any supported format, making it a handy piece of any shell pipeline for inspecting tabular data.

What You Get

  • A single tabulate() function that accepts lists of lists, lists of dicts, dicts of iterables, dataclasses, NumPy arrays/record arrays, and pandas DataFrames as input
  • Over 30 output formats including plain, simple, github, grid variants (simple/rounded/heavy/mixed/double/fancy), pipe, orgtbl, html, latex, rst, jira, tsv, and more
  • Automatic column alignment and numeric formatting, including decimal-point alignment and configurable float/int format strings
  • A bundled tabulate CLI that reads RSV, CSV, or JSONL data from files or stdin and prints a formatted table
  • Optional row-index columns (showindex) and support for embedding separating lines between groups of rows
  • Optional wide-character (CJK) width support via the wcwidth extra for correctly aligned multi-byte text

Common Use Cases

  • Printing debug or diagnostic tables from within a script without writing custom padding/alignment code
  • Rendering a pandas DataFrame or NumPy array as a Markdown table for a README, notebook, or generated report
  • Piping CSV or JSON-lines data through the tabulate CLI to get a readable table straight from the shell
  • Generating LaTeX or reStructuredText tables for academic papers and Sphinx documentation from tabular data
  • Formatting CLI tool output (e.g. listing resources, configs, or query results) in a consistent, readable grid

Under The Hood

Architecture The entire library lives in a single module, tabulate/__init__.py, which declares each of the 30+ output styles as a TableFormat namedtuple (line-drawing characters, row templates, padding rules) held in a dispatch table keyed by format name, alongside DataRow/Line primitives that describe how a rendered row or separator line looks. Column width calculation, alignment inference, and numeric formatting run as internal helper passes before a rendering function walks the format table to assemble the final string. The bundled cli.py is a thin argument-parsing wrapper that reads RSV/CSV/JSONL input and calls straight into the same tabulate() core, so the CLI and the importable API share one formatting path with no duplicated logic.

Tech Stack Pure Python (3.10+) with no required runtime dependencies; an optional wcwidth extra adds wide-character (CJK) alignment support. The package is built with the flit_core/flit_scm backend and versioned via setuptools_scm from git tags. Tests run under pytest with --doctest-modules and --doctest-glob=README.md, so the README’s own examples double as executable tests; tox/tox-uv drives the multi-version matrix and ruff handles linting.

Code Quality The test/ directory holds a dedicated suite (output, input, API, CLI, regression, textwrapper, grapheme-cluster tests) using plain assert-based pytest tests, run across a 5-Python-version by 3-OS CI matrix with a separate lint job and Codecov coverage reporting. Naming is consistent and internals are docstring-documented, though there is no static type checker (mypy) enforced and type hints are used sparingly.

API Design The public surface is deliberately tiny — one function (tabulate()) plus two small helpers (tabulate_formats, simple_separated_format) — so getting started requires no boilerplate beyond a single import and call. Keyword arguments (headers, tablefmt, floatfmt, showindex) cover nearly every customization need without subclassing or configuration objects, and accepting lists, dicts, DataFrames, and NumPy arrays interchangeably means callers rarely need to reshape their data before formatting it.

Used by 15 apps in this directory

Python
89%
Apache 2.0

Apache Airflow

Data Engineering

46,995

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
64
Dependency
Built with
Python 89%
Updated 4 days ago
Python
59%
Other

Arkon

AI Assistants · Knowledge Management · Mcp

1,463

Self-hosted enterprise AI knowledge hub that compiles internal docs into a scoped, reviewable wiki and serves it to Claude and other LLMs through an MCP server.

View details
46
Repo Health
74
Technical
70
Dependency
Built with
Python 59%
TypeScript 41%
Updated 4 months ago
Python
62%
MIT

AutoGen

AI Development · Automation

61,194

Build autonomous and human-in-the-loop multi-agent AI systems with a layered, event-driven Python and .NET framework pioneered at Microsoft Research.

View details
56
Repo Health
78
Technical
73
Dependency
Built with
Python 62%
C# 25%
TypeScript 12%
Updated 5 months ago
Python
100%
Apache 2.0

ClearML

Automation · Devops

6,892

Auto-magical MLOps platform that tracks experiments, versions data, orchestrates pipelines, and serves models with just two lines of code.

View details
94
Repo Health
79
Technical
68
Dependency
Built with
Python 100%
Updated 1 weeks ago
C++
68%
Apache 2.0

ClickHouse

Analytics · Data Engineering · Databases

50,116

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
64
Dependency
Built with
C++ 68%
Python 14%
Updated 4 days ago
HTML
85%
Apache 2.0

Elementary

Analytics · Data Engineering · Monitoring

2,414

The dbt-native data observability CLI that turns your existing dbt tests and metadata into anomaly detection, lineage graphs, and Slack/Teams alerts — no separate platform required.

View details
81
Repo Health
75
Technical
79
Dependency
Built with
HTML 85%
Python 15%
Updated 5 days ago
Python
83%
MIT

Gemma Multimodal Fine-Tuner

AI Development

1,503

An Apple-Silicon-native LoRA fine-tuning tool for Gemma on text, image, and audio data — with a wizard CLI, live browser-based training visualizer, and streaming from GCS/BigQuery for datasets too large for local disk.

View details
65
Repo Health
68
Technical
72
Dependency
Built with
Python 83%
Updated 6 days ago
TypeScript
91%
Other

GitNexus

AI Code Assistants · Developer Tools · Mcp

47,620

Index any codebase into an interactive knowledge graph and give your AI agents deep architectural context via MCP — with zero servers required.

View details
88
Repo Health
86
Technical
73
Dependency
Built with
TypeScript 91%
Updated 4 days ago
TypeScript
91%
Apache 2.0

Helicone

AI Development · Analytics · Monitoring

6,182

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
70
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 91%
Updated 2 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers