Skip to main content

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-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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pirrtools-0.2.20.tar.gz (52.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pirrtools-0.2.20-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

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

Hashes for pirrtools-0.2.20.tar.gz
Algorithm Hash digest
SHA256 b632d1c96b3978f83d451f3f2f12d6a64feae7311e46925deee8d8bfafaedc25
MD5 88ad0a4bbe14ecea084f7e3e32a3f31a
BLAKE2b-256 19c4a01fa3443addcce63d6dd7081916b988be4dc7bfa80879dd8742ccb4a1fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pirrtools-0.2.20.tar.gz:

Publisher: publish-to-test-pypi.yml on pirsquared/pirrtools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pirrtools-0.2.20-py3-none-any.whl
Algorithm Hash digest
SHA256 ee76376ec74dc9b67ebff783d70c5b2bab1473bb5e011b5b420b148158084dc7
MD5 50015054aaeb4081500ce69175435c41
BLAKE2b-256 b051721d91554d4d423f4e8aecba840716fba8268969c33eeb86dbe6644f550c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page