Skip to main content

When stdlib is almost enough.

Project description

Apathetic Python Utils ⚙️

CI License: MIT-a-NOAI Discord

📘 Roadmap · 📝 Release Notes

Grab bag of helpers for Apathetic projects.
When stdlib is almost enough.

Apathetic Python Utils provides a lightweight, dependency-free collection of utility functions designed for CLI tools. It includes helpers for file loading, path manipulation, system detection, text processing, type checking, pattern matching, and more.

[!NOTE] Heads up: the AI cooked dinner. It's edible, but watch your step.
Detailed bug reports welcome.

Quick Start

from apathetic_utils import load_jsonc, load_toml, is_ci, detect_runtime_mode
from pathlib import Path

# Load configuration files
config = load_jsonc(Path("config.jsonc"))
pyproject = load_toml(Path("pyproject.toml"))

# Detect environment
if is_ci():
    print("Running in CI")

# Detect runtime mode (package, stitched, zipapp, frozen)
mode = detect_runtime_mode("my_package")
print(f"Running in {mode} mode")

Installation

# Using poetry
poetry add apathetic-utils

# Using pip
pip install apathetic-utils

Documentation

📚 Full Documentation →

For installation guides, API reference, examples, and more, visit our documentation website.

Features

  • 🪶 Zero dependencies — Uses only Python's standard library (except apathetic-logging for logging)
  • 📁 File loading — Load TOML and JSONC files with comment support
  • 🛤️ Path utilities — Cross-platform path normalization and glob handling
  • 🔍 Pattern matching — Portable glob pattern matching with recursive ** support
  • 🧩 Module detection — Detect Python packages from file paths
  • 🧪 System detection — Detect CI environments, pytest execution, and runtime modes
  • ⚙️ Runtime utilities — Build and test utilities for stitched scripts and zipapps
  • 🔧 Subprocess utilities — Capture and forward subprocess output
  • 📝 Text processing — Pluralization and error message cleanup utilities
  • 🔧 Type utilities — Safe isinstance checks for TypedDicts and generics
  • 🧪 Testing utilities — Helpers for testing mixins and patching functions
  • 🎯 CLI-friendly — Designed with command-line applications in mind

⚖️ License

You're free to use, copy, and modify the library under the standard MIT terms.
The additional rider simply requests that this project not be used to train or fine-tune AI/ML systems until the author deems fair compensation frameworks exist.
Normal use, packaging, and redistribution for human developers are unaffected.

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

apathetic_utils-0.4.0.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

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

apathetic_utils-0.4.0-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

Details for the file apathetic_utils-0.4.0.tar.gz.

File metadata

  • Download URL: apathetic_utils-0.4.0.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for apathetic_utils-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2e850a9d2ee94c63c0013f12bee97592134ae211e5e3a8daf08fad29756d7330
MD5 3daa8bc57ff6a0e4713e15a15741c927
BLAKE2b-256 5968f19c58f75a4f4179adcdd16ffd45837fa2b8a21c43c42d30e1a1f7c155da

See more details on using hashes here.

Provenance

The following attestation bundles were made for apathetic_utils-0.4.0.tar.gz:

Publisher: publish_pypi.yml on apathetic-tools/python-utils

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

File details

Details for the file apathetic_utils-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for apathetic_utils-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a37770642814f92bcd51789d1ac2b47275cfbe1d69efc749e9d7d5f17d706ba
MD5 663fe52306c9f4f19a46e05a2597fdb6
BLAKE2b-256 a5a729ac2078d67932d052ce8cdad9a6999e8fb9368ea7a78dfd0c29e0b2d40a

See more details on using hashes here.

Provenance

The following attestation bundles were made for apathetic_utils-0.4.0-py3-none-any.whl:

Publisher: publish_pypi.yml on apathetic-tools/python-utils

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