ANSITable
Pretty tables and matrices for Python
Quick example
from ansitable import ANSITable
table = ANSITable("Name", "Score", border="thin")
table.row("Alice", 95)
table.row("Bob", 87)
table.row("Carol", 92)
table.print()
Output:
┌───────┬───────┐
│ Name │ Score │
├───────┼───────┤
│ Alice │ 95 │
│ Bob │ 87 │
│ Carol │ 92 │
└───────┴───────┘
Features
- Unicode and ANSI colors — Beautiful output in any ANSI-capable terminal
- 7 export formats — Markdown, HTML, LaTeX, reStructuredText, Wikitable, CSV, Pandas
- Rich styling — Colors, backgrounds, text styles (bold, underlined, etc.), alignment, width control
- Sorting — Sort tables by any column, with optional key function
- Pandas integration — Convert DataFrames to/from ANSITable
- Matrix formatting — Pretty-print NumPy arrays with brackets and styles
- Flexible API — Simple string-based or detailed Column-based column specification
Installation
pip install ansitable
Optional dependency for colors:
pip install colored
Documentation
See the comprehensive documentation for tutorials, examples, and API reference.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ansitable-1.0.0.tar.gz.
File metadata
- Download URL: ansitable-1.0.0.tar.gz
- Upload date:
- Size: 87.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cfe9d510db75ba908c29eb4c28c384c759fe6142d24cae9b1acd73af55dddfa
|
|
| MD5 |
ec63fa80048bbee4a697629711959214
|
|
| BLAKE2b-256 |
e5f069bdad551e73a5e8496df789bbc65b4af95afdef84c5a040de615a12ec2a
|
Provenance
The following attestation bundles were made for ansitable-1.0.0.tar.gz:
Publisher:
release.yml on petercorke/ansitable
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ansitable-1.0.0.tar.gz -
Subject digest:
9cfe9d510db75ba908c29eb4c28c384c759fe6142d24cae9b1acd73af55dddfa - Sigstore transparency entry: 2256858255
- Sigstore integration time:
-
Permalink:
petercorke/ansitable@3217ee03daa9cf3faa05ceb1a8ebd77c6c2a66ee -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/petercorke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3217ee03daa9cf3faa05ceb1a8ebd77c6c2a66ee -
Trigger Event:
push
-
Statement type:
File details
Details for the file ansitable-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ansitable-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b45b0eceac49e99718e0346e389359898f52bd92dcf2a1d6e66c489edda18751
|
|
| MD5 |
7fa4fe5074c64884ddd5b235250054ee
|
|
| BLAKE2b-256 |
9d1d6dd1737bdebc7f16328f137cdbbd5581bc960a7f2c8b9930387245ab142f
|
Provenance
The following attestation bundles were made for ansitable-1.0.0-py3-none-any.whl:
Publisher:
release.yml on petercorke/ansitable
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ansitable-1.0.0-py3-none-any.whl -
Subject digest:
b45b0eceac49e99718e0346e389359898f52bd92dcf2a1d6e66c489edda18751 - Sigstore transparency entry: 2256858260
- Sigstore integration time:
-
Permalink:
petercorke/ansitable@3217ee03daa9cf3faa05ceb1a8ebd77c6c2a66ee -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/petercorke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3217ee03daa9cf3faa05ceb1a8ebd77c6c2a66ee -
Trigger Event:
push
-
Statement type: