Collection of tools I use in my projects
Project description
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 - 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-tutorialcommand - 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:
pip install pirrtools
Quick Start
Beautiful Rich Tables
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
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
# Launch interactive tutorial
pirrtools-tutorial
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Authors
- Sean Smith
Project details
Release history Release notifications | RSS feed
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 pirrtools-0.2.20.tar.gz.
File metadata
- Download URL: pirrtools-0.2.20.tar.gz
- Upload date:
- Size: 52.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b632d1c96b3978f83d451f3f2f12d6a64feae7311e46925deee8d8bfafaedc25
|
|
| MD5 |
88ad0a4bbe14ecea084f7e3e32a3f31a
|
|
| BLAKE2b-256 |
19c4a01fa3443addcce63d6dd7081916b988be4dc7bfa80879dd8742ccb4a1fc
|
Provenance
The following attestation bundles were made for pirrtools-0.2.20.tar.gz:
Publisher:
publish-to-test-pypi.yml on pirsquared/pirrtools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pirrtools-0.2.20.tar.gz -
Subject digest:
b632d1c96b3978f83d451f3f2f12d6a64feae7311e46925deee8d8bfafaedc25 - Sigstore transparency entry: 335166353
- Sigstore integration time:
-
Permalink:
pirsquared/pirrtools@5c566c626de1578ed19291d0a3edb50cf583ca6c -
Branch / Tag:
refs/heads/master - Owner: https://github.com/pirsquared
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@5c566c626de1578ed19291d0a3edb50cf583ca6c -
Trigger Event:
push
-
Statement type:
File details
Details for the file pirrtools-0.2.20-py3-none-any.whl.
File metadata
- Download URL: pirrtools-0.2.20-py3-none-any.whl
- Upload date:
- Size: 44.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee76376ec74dc9b67ebff783d70c5b2bab1473bb5e011b5b420b148158084dc7
|
|
| MD5 |
50015054aaeb4081500ce69175435c41
|
|
| BLAKE2b-256 |
b051721d91554d4d423f4e8aecba840716fba8268969c33eeb86dbe6644f550c
|
Provenance
The following attestation bundles were made for pirrtools-0.2.20-py3-none-any.whl:
Publisher:
publish-to-test-pypi.yml on pirsquared/pirrtools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pirrtools-0.2.20-py3-none-any.whl -
Subject digest:
ee76376ec74dc9b67ebff783d70c5b2bab1473bb5e011b5b420b148158084dc7 - Sigstore transparency entry: 335166374
- Sigstore integration time:
-
Permalink:
pirsquared/pirrtools@5c566c626de1578ed19291d0a3edb50cf583ca6c -
Branch / Tag:
refs/heads/master - Owner: https://github.com/pirsquared
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@5c566c626de1578ed19291d0a3edb50cf583ca6c -
Trigger Event:
push
-
Statement type: