Skip to main content

rite Logo

Python Utility Package

rites to write py right




license website python wheel

stars forks downloads issues sponsors contributors



Table of Contents

About

rite is a modern Python utility library with zero external runtime dependencies. Supports Python 3.11 and newer, it provides a comprehensive collection of utilities for cryptography, filesystem operations, text processing, collections, conversions, networking, and more.

Key Features

  • Zero Dependencies: No external runtime dependencies
  • Type Safe: Comprehensive type hints, checked with mypy
  • Well Tested: 100% line and branch coverage
  • Modern Python: Supports Python 3.11, 3.12, 3.13 and 3.14
  • Modular Design: Clear module organization with consistent structure
  • Fully Documented: Extensive documentation and practical examples

Module Overview

Module Description
collections Buffers, caches (LRU/LFU/TTL), dict/list/set utilities, queues, trees
conversion Type conversions, format transformations, unit conversions
crypto UUID generation, hashing (SHA-256, MD5, BLAKE2), ciphers, random
diagnostics Debugging, error handling, logging, metrics, profiling
filesystem File/folder operations, compression, path utilities, MIME types
functional Composition, currying, decorators, memoization, predicates
markup HTML/XML/Markdown/SVG/iCalendar processing and sanitization
net URLs, HTTP headers, IP checks, SSRF-safe requests, MIME, validation
numeric Math operations, statistics, number formatting
reflection Attributes, inspection, signatures, type checking
serialization JSON, CSV, INI, TOML, pickle serialization
system Environment, platform detection, process management, shell
temporal Date/time utilities, timestamp operations, formatting
text Slug generation, case conversion, sanitization, analysis, search

Quick Start

Installation

From PyPI:

pip install rite

Using uv:

uv add rite

From Source:

git clone https://github.com/scape-agency/rite.git
cd rite
uv sync

View on PyPI

Basic Usage

# Cryptography
from rite.crypto.uuid import uuid_hex
from rite.crypto.hash import hash_sha256

user_id = uuid_hex()
password_hash = hash_sha256("secure_password")

# Filesystem
from pathlib import Path

from rite.filesystem import path_exists
from rite.filesystem.file import copy_file

if path_exists("config.json"):
    copy_file(Path("config.json"), Path("config.backup.json"))

# Text Processing
from rite.text.slug import slugify
from rite.text.case import to_snake_case

slug = slugify("Hello World!")       # 'hello-world'
snake = to_snake_case("helloWorld")  # 'hello_world'

# Security helpers
from rite.markup import sanitize_html, sanitize_url

safe = sanitize_html('<a href="javascript:x()" onclick="y()">hi</a>')
href = sanitize_url("https://example.com/a")  # '' for unsafe URLs

# Collections
from rite.collections.list import list_unique, list_flatten

unique = list_unique([1, 2, 2, 3])    # [1, 2, 3]
flat = list_flatten([[1, 2], [3, 4]]) # [1, 2, 3, 4]

# Serialization
from rite.serialization.json import json_load, json_dump

data = json_load("config.json")
json_dump("output.json", data, indent=2)

# Functional
from rite.functional.composition import composition_pipe

pipeline = composition_pipe(str.strip, str.lower, str.title)
result = pipeline("  hello world  ")  # 'Hello World'

# System
from rite.system.platform import platform_is_linux, platform_name

if platform_is_linux():
    print(f"Running on {platform_name()}")

# Diagnostics
from rite.diagnostics.profiling import profiling_stopwatch

with profiling_stopwatch() as timer:
    # ... your code ...
    pass
print(f"Elapsed: {timer.elapsed:.3f}s")

Documentation

User Documentation

Developer Documentation

AI Agent Documentation

Additional Resources


Authors

rite is an open-source project by Scape Agency.

Scape Agency is a spatial innovation collective that dreams, discovers and designs the everyday of tomorrow. We blend design thinking with emerging technologies to create a brighter perspective for people and planet. Our products and services naturalise technology in liveable and sustainable –scapes that spark the imagination and inspire future generations.


Contributing

We'd love for you to contribute and to make rite even better than it is today! Please refer to the contribution guidelines for details on:

  • Code of conduct
  • Development workflow
  • Code standards
  • Testing requirements
  • Pull request process

Quick start for contributors:

# Clone the repository
git clone https://github.com/scape-agency/rite.git
cd rite

# Install dependencies (dev and doc groups)
uv sync

# Install pre-commit hooks
uv run pre-commit install

# Run tests
make test

# Run all checks
make check

License

Except where otherwise noted, rite is licensed under the terms of the MIT License.


Disclaimer

THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Made with ♥ by Scape Agency
Copyright 2025 Scape Agency. All Rights Reserved

Metadata

Release files for rite 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rite 0.3.0
File Size Uploaded Provenance Actions
rite-0.3.0.tar.gz 268.2 kB Without provenance Details for rite-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rite 0.3.0
File Interpreter ABI Platform Actions
rite-0.3.0-py3-none-any.whl Python 3 none any Details for rite-0.3.0-py3-none-any.whl

Total release size: 826.1 kB

Release files / rite-0.3.0.tar.gz

Download URL rite-0.3.0.tar.gz
Size 268.2 kB
Tags Source
SHA-256 checksum
How to use checksums
baa1d3f0a225b6354da65e14a46a52d4f0fd1ea935c08ec31956191132b9c439
BLAKE2b-256 checksum
How to use checksums
ce82995477e20727a00c74668f213e1bf9016d82506c23cdaab26db0704a8c5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rite-0.3.0-py3-none-any.whl

Download URL rite-0.3.0-py3-none-any.whl
Size 557.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c63206333f51acc96bc4a1935e0ebebdc2fa1f00d77f88605d0b24ad0cf7d707
BLAKE2b-256 checksum
How to use checksums
f28fc5765ecb244f18dbe419fea87ca87445c63dba615e7275815df003f9b9c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for rite 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page