treetable
Helper to pretty print an ascii table with a tree-like structure
Decision gist · record as of 2026-08-14
Yes, if you need to render hierarchical tabular data in the terminal. The package is lightweight, dependency-free, and permissively licensed. The aging maintenance status (346 days since last release) is a minor concern for a stable utility, but the lack of active development means no recent bug fixes or feature additions—suitable for stable use cases, less so if you anticipate needing ongoing support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later.
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is aging—last release was 346 days ago, though the repository remains active and the package supports current Python versions.
License · maintenance · safety
Unlicense license (permissive) — Distributed under the Unlicense, a permissive public-domain dedication. You may use, modify, and distribute the package with no restrictions or attribution requirements.
last release 2025-09-02 (346 days) · last repo commit 2025-09-02 · 20 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 311,282 downloads/mo, #7,737 on PyPI
Alternatives
Verify before relying
pip install treetable
from treetable import table, group, leaf, treetable
mytable = table([
group('info', [leaf('name'), leaf('index')]),
group('metrics', [leaf('speed', '.0f'), leaf('accuracy', '.1%')])
])
lines = [
{'info': {'name': 'bob', 'index': 4}, 'metrics': {'speed': 200, 'accuracy': 0.21}},
{'info': {'name': 'alice', 'index': 2}, 'metrics': {'speed': 67, 'accuracy': 0.45}}
]
print(treetable(lines, mytable))- Whether the package handles deeply nested hierarchies (beyond 3 levels) without performance degradation.
- How the package behaves with very large datasets or extremely wide tables.
- Whether ANSI color codes work correctly on all terminal emulators and Windows console environments.
What it is and what it does
treetable is a utility for rendering hierarchical data as formatted ASCII tables suitable for terminal output. It takes nested dictionaries and a tree-like schema definition to produce multi-level column headers with customizable separators, alignment, text wrapping, and ANSI color support. The schema is built from `table`, `group`, and `leaf` node functions that define the structure, display names, and formatting rules (alignment, number formats, column shortening) for each column or column group.
The package is useful when you need to display complex, multi-dimensional data in a human-readable tabular format—for instance, experiment results with grouped metrics, hierarchical data exports, or formatted reports in CLI applications. It handles the layout and alignment logic automatically, letting you focus on the data structure and presentation preferences rather than manual spacing and formatting.
Use it for
- Display machine learning experiment results with grouped train/test metrics and per-model statistics.
- Format hierarchical data exports (e.g., nested JSON or tree-structured database queries) as readable terminal tables.
- Generate formatted CLI reports with multi-level column headers and custom alignment for different data types.
- Pretty-print nested configuration or inventory data with automatic column width and alignment management.
- Create colored terminal output for monitoring dashboards or log analysis tools with grouped metrics.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to render hierarchical tabular data in the terminal.
The package is lightweight, dependency-free, and permissively licensed. The aging maintenance status (346 days since last release) is a minor concern for a stable utility, but the lack of active development means no recent bug fixes or feature additions—suitable for stable use cases, less so if you anticipate needing ongoing support.
Install
treetable on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release was 346 days ago, though the repository remains active and the package supports current Python versions.
Requires Python 3.6 or later.
License in practice
Distributed under the Unlicense, a permissive public-domain dedication. You may use, modify, and distribute the package with no restrictions or attribution requirements.
Quickstart
pip install treetable
from treetable import table, group, leaf, treetable
mytable = table([
group('info', [leaf('name'), leaf('index')]),
group('metrics', [leaf('speed', '.0f'), leaf('accuracy', '.1%')])
])
lines = [
{'info': {'name': 'bob', 'index': 4}, 'metrics': {'speed': 200, 'accuracy': 0.21}},
{'info': {'name': 'alice', 'index': 2}, 'metrics': {'speed': 67, 'accuracy': 0.45}}
]
print(treetable(lines, mytable))
Verify before relying
- Whether the package handles deeply nested hierarchies (beyond 3 levels) without performance degradation.
- How the package behaves with very large datasets or extremely wide tables.
- Whether ANSI color codes work correctly on all terminal emulators and Windows console environments.
Package facts
| License | Unlicense license permissive |
| Python support | Supports the current Python release >=3.6.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 346 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 311,282 / month, #7,737 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Topic :: Text Processing |
Evidence: treetable-0.2.6-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “nested hierarchical tables”
- treetableRenders nested data structures as formatted ASCII tables with…
- pandas-read-xmlConverts XML files into pandas DataFrames, with tools to flatten…
- hdmfHDMF provides APIs for defining hierarchical data models, reading and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also texttable · treelib · tabulate · seedir · rst2ansi · PTable · ansiwrap · asciichartpy · ansi2txt · great-tables