Metadata-Version: 2.4
Name: pirrtools
Version: 0.2.20
Summary: Collection of tools I use in my projects
Author-email: Sean Smith <pirsquared.pirr@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/pirsquared/pirrtools
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: feather-format
Requires-Dist: ipython
Requires-Dist: Pygments
Requires-Dist: rich
Requires-Dist: jinja2
Requires-Dist: matplotlib
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.6.0; extra == "dev"
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
Requires-Dist: pytest-benchmark>=4.0.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: isort>=5.13.0; extra == "dev"
Requires-Dist: ruff>=0.6.0; extra == "dev"
Requires-Dist: mypy>=1.11.0; extra == "dev"
Requires-Dist: pre-commit>=4.0.0; extra == "dev"
Requires-Dist: bandit>=1.7.0; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: types-setuptools; extra == "dev"
Requires-Dist: pandas-stubs>=2.0.0; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.1.0; extra == "dev"
Requires-Dist: wheel>=0.44.0; extra == "dev"
Requires-Dist: hatch>=1.12.0; extra == "dev"
Requires-Dist: tox>=4.21.0; extra == "dev"
Requires-Dist: coverage[toml]>=7.6.0; extra == "dev"
Requires-Dist: nox>=2024.4.15; extra == "dev"
Requires-Dist: rich-cli>=1.8.0; extra == "dev"
Requires-Dist: ipykernel>=6.29.0; extra == "dev"
Requires-Dist: notebook>=7.2.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=8.0.0; extra == "docs"
Requires-Dist: sphinx-book-theme>=1.0.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=2.0.0; extra == "docs"
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "docs"
Requires-Dist: myst-parser>=3.0.0; extra == "docs"
Requires-Dist: sphinx-design>=0.6.0; extra == "docs"
Requires-Dist: nbsphinx>=0.9.0; extra == "docs"
Dynamic: license-file

# pirrtools

*I find them useful*

## Description

`pirrtools` is a set of bespoke tools I wanted preserved in a library. It provides various utilities, with key features including a pandas accessor for caching non-conforming datasets and beautiful Rich table formatting.

## Documentation

📚 **[Full Documentation](https://pirsquared.github.io/pirrtools/)** - Complete guides, examples, and API reference

## Features

- **Rich Table Formatting**: Transform pandas DataFrames into beautiful, styled terminal tables with gradients, colors, and professional formatting
- **Pandas Caching**: Easily cache and load pandas DataFrames and Series, even those with non-conforming datasets using feather format
- **Interactive Tutorial**: Launch an interactive tutorial with `pirrtools-tutorial` command
- **Development Utilities**: Path management, module reloading, and instance finding tools

## Requirements

- Python 3.9 or greater
- pandas
- rich
- feather-format

## Installation

Install `pirrtools` using pip:

```bash
pip install pirrtools
```

## Quick Start

### Beautiful Rich Tables

```python
import pandas as pd
import pirrtools
from rich.console import Console

# Create sample data
df = pd.DataFrame({
    'Product': ['Widget A', 'Widget B', 'Widget C'],
    'Q1': [100, 150, 200],
    'Q2': [120, 180, 220], 
    'Q3': [140, 200, 180],
    'Q4': [160, 170, 240]
})

# Create beautiful table with gradient background
console = Console()
table = df.pirr.to_rich(
    bg="viridis",  # Gradient colormap
    title="📊 Quarterly Sales Report",
    format="${:.0f}K"  # Format numbers
)
console.print(table)
```

### Pandas Caching

```python
import pirrtools as pirr
import pandas as pd

# Create a DataFrame
df = pd.DataFrame(1, range(10), ['a', 'b', 'c']).rename_axis('N')

# Cache the DataFrame
df.pirr.to_cache('name_of_cache_path')

# Load the cached DataFrame
loaded_df = pirr.load_cache('name_of_cache_path')
```

### Interactive Tutorial

```bash
# Launch interactive tutorial
pirrtools-tutorial
```

## License
This project is licensed under the MIT License. See the LICENSE file for more details.

## Authors
- Sean Smith
