Beautiful terminal table formatting powered by Rust
Project description
Tidy Viewer Py
Beautiful terminal table formatting powered by Rust. A Python package that provides fast, feature-rich table pretty-printing with automatic column width optimization, data type detection, and gorgeous color themes.
Features
- 🚀 Blazing fast - Rust-powered performance
- 🎨 Beautiful themes - Nord, Gruvbox, Dracula, One Dark, and more
- 📊 Smart formatting - Automatic column width optimization
- 🔢 Type detection - Intelligent handling of numbers, dates, and missing values
- 📁 Multiple formats - CSV, Parquet, and pandas DataFrames
- 🌈 Colored output - Customizable color themes
- 📏 Configurable - Fine-tune every aspect of the output
Installation
pip install tidy-viewer-py
Quick Start
import tidy_viewer_py as tv
# Print a CSV file
tv.print_csv("data.csv")
# With custom options
options = tv.FormatOptions(
max_rows=50,
color_theme="gruvbox",
significant_figures=4
)
tv.print_csv("data.csv", options)
Pandas DataFrames
import pandas as pd
import tidy_viewer_py as tv
df = pd.read_csv("large_dataset.csv")
# Pretty print with automatic truncation
tv.print_dataframe(df)
# Or with custom settings
tv.print_dataframe(df, tv.FormatOptions(max_rows=100))
Method Chaining API
import tidy_viewer_py as tv
# Fluent interface for quick formatting
tv.tv().color_theme("dracula").max_rows(50).print_csv("data.csv")
# One-liner with multiple options
tv.tv().no_dimensions().no_row_numbers().title("Sales Report").print_table(data, headers)
Format to String
# Get formatted output as string instead of printing
output = tv.format_table(data, headers)
print(f"Formatted output:\n{output}")
# Save to file
with open("report.txt", "w") as f:
f.write(tv.format_csv("data.csv", tv.FormatOptions(use_color=False)))
Configuration Options
options = tv.FormatOptions(
# Display options
max_rows=25, # Maximum rows to display (None for all)
max_col_width=20, # Maximum column width
min_col_width=2, # Minimum column width
# Styling
use_color=True, # Enable/disable colored output
color_theme="nord", # Color theme
# Data formatting
delimiter=",", # CSV delimiter
significant_figures=3, # Number of significant figures
preserve_scientific=False,# Preserve scientific notation
max_decimal_width=13, # Max width before scientific notation
# Table elements
no_dimensions=False, # Hide table dimensions
no_row_numbering=False, # Hide row numbers
title="My Table", # Table title
footer="End of data", # Table footer
)
Color Themes
Available themes:
nord(default) - Arctic, north-bluish color palettegruvbox- Retro groove color schemedracula- Dark theme with vibrant colorsone_dark- Atom One Dark inspiredsolarized_light- Precision colors for readability
Performance
Tidy Viewer Py leverages Rust for exceptional performance:
- 10-100x faster than pure Python implementations
- Handles large datasets efficiently
- Minimal memory overhead
- Streaming support for huge files (coming soon)
Development
Building from Source
Requirements:
- Python 3.8+
- Rust 1.70+
- uv (recommended) or pip
git clone https://github.com/yourusername/tidy-viewer-py
cd tidy-viewer-py
uv pip install .
Or for development:
uv run maturin develop
Running Tests
pytest tests/
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Credits
Inspired by the original tidy-viewer project.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 tidy_viewer_py-0.2.0.tar.gz.
File metadata
- Download URL: tidy_viewer_py-0.2.0.tar.gz
- Upload date:
- Size: 118.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
242c614b0987a35bd0cc1294c3f84e1ea10fa72fe8aac51d2e8211cfa2eeca4c
|
|
| MD5 |
ccb8d9751b567d653538fa518a58c09b
|
|
| BLAKE2b-256 |
b46b6e5dc285f49ee1aa55fd748bcda6bd5ce918d60d8713beb9013ce7ef114d
|
File details
Details for the file tidy_viewer_py-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: tidy_viewer_py-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f38b4a1212d625ab19e1ead8bb18aab7023db5dc29eaeccaaca3b5d537ac6d5c
|
|
| MD5 |
19e043b7c86eedfca55836c3867968b1
|
|
| BLAKE2b-256 |
559bb08a51d4b96c4f703656ac12af5e5fce25b63a30c0eedd68d7ab17e5d149
|
File details
Details for the file tidy_viewer_py-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: tidy_viewer_py-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
765b870300e910ff1112c46353984f9806ea3d8759e8c92dd2567ea1bbe34b95
|
|
| MD5 |
2b9e6968e683180e696d7d2cda15f5ab
|
|
| BLAKE2b-256 |
0756622b954962f8a3b31697f2fa7736eaf2a94ef031f7bfc00854b6d1954733
|