Metadata-Version: 2.4
Name: tidy-viewer-py
Version: 0.2.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: The Unlicense (Unlicense)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: General
Requires-Dist: pandas>=2.0.3
Requires-Dist: polars>=1.8.2
Requires-Dist: pyarrow>=17.0.0
Requires-Dist: pytest>=7.0 ; extra == 'dev'
Requires-Dist: pytest-benchmark ; extra == 'dev'
Requires-Dist: pandas>=1.0 ; extra == 'dev'
Requires-Dist: pyarrow>=10.0 ; extra == 'dev'
Requires-Dist: ruff ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: Beautiful terminal table formatting powered by Rust
Keywords: table,formatting,terminal,pretty-print,csv,parquet
Author-email: Alex Hallam <alexhallam6.28@gmail.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/alexhallam/tv
Project-URL: Repository, https://github.com/alexhallam/tv
Project-URL: Issues, https://github.com/alexhallam/tv/issues

# 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

```bash
pip install tidy-viewer-py
```

## Quick Start


```python
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

```python
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

```python
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

```python
# 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

```python
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 palette
- `gruvbox` - Retro groove color scheme
- `dracula` - Dark theme with vibrant colors
- `one_dark` - Atom One Dark inspired
- `solarized_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

```bash
git clone https://github.com/yourusername/tidy-viewer-py
cd tidy-viewer-py
uv pip install .
```

Or for development:
```bash
uv run maturin develop
```

### Running Tests

```bash
pytest tests/
```

## License

Licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
- MIT license ([LICENSE-MIT](LICENSE-MIT))

at your option.

## Credits

Inspired by the original [tidy-viewer](https://github.com/alexhallam/tv) project.



