When stdlib is almost enough.
Project description
Apathetic Python Utils ⚙️
📘 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
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
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 apathetic_utils-0.5.2.tar.gz.
File metadata
- Download URL: apathetic_utils-0.5.2.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fba9b1c1237846d4aab0cf6fe5519203e3546cc41270b56020146850a11cdff
|
|
| MD5 |
1d3fe52beb7e56959dce3f4e93d25f29
|
|
| BLAKE2b-256 |
b5f1fd1ca51aa36a9d187b26cc08ae4b864adb01cf05bc695b9495607639a8f3
|
Provenance
The following attestation bundles were made for apathetic_utils-0.5.2.tar.gz:
Publisher:
publish_pypi.yml on apathetic-tools/python-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apathetic_utils-0.5.2.tar.gz -
Subject digest:
0fba9b1c1237846d4aab0cf6fe5519203e3546cc41270b56020146850a11cdff - Sigstore transparency entry: 750200471
- Sigstore integration time:
-
Permalink:
apathetic-tools/python-utils@4d464553dbcec19286913dcb4147ae604068974a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apathetic-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@4d464553dbcec19286913dcb4147ae604068974a -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file apathetic_utils-0.5.2-py3-none-any.whl.
File metadata
- Download URL: apathetic_utils-0.5.2-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
063b9018248a69cbce1c146acd84b0eaed178f6975711a179a2a75101be4e7bb
|
|
| MD5 |
fc5b09d099e2228aefa69313dec117bf
|
|
| BLAKE2b-256 |
67a21fb34f24ca46a65aa194220d9875d281a3aedb82160a3e1202c7eb3143c5
|
Provenance
The following attestation bundles were made for apathetic_utils-0.5.2-py3-none-any.whl:
Publisher:
publish_pypi.yml on apathetic-tools/python-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apathetic_utils-0.5.2-py3-none-any.whl -
Subject digest:
063b9018248a69cbce1c146acd84b0eaed178f6975711a179a2a75101be4e7bb - Sigstore transparency entry: 750200513
- Sigstore integration time:
-
Permalink:
apathetic-tools/python-utils@4d464553dbcec19286913dcb4147ae604068974a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apathetic-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@4d464553dbcec19286913dcb4147ae604068974a -
Trigger Event:
workflow_run
-
Statement type: