Skip to main content

Curated core Python utilities with zero dependencies.

Project description

c108

Curated core Python utilities with zero dependencies for introspection, formatting, CLI, IO/streams, filesystem, validation, networking, numerics, and sentinels.

  • License: MIT
  • Audience: Python developers who prefer small, practical APIs

Docs Python Versions Coverage

Documentation

Full documentation and API reference: https://c108.readthedocs.io/

Installation

Install from PyPI:

pip install c108

Install the latest from GitHub main branch:

pip install git+https://github.com/C108-Lab/c108.git

Modules

  • c108.abc – Runtime introspection and type-validation utilities
  • c108.cli – CLI helpers
  • c108.collections – BiDirectionalMap collection
  • c108.dataclasses – dataclasses tools
  • c108.dictify – serialization utilities
  • c108.display – value with units of measurement display
  • c108.formatters – formatting utilities for development and debugging
  • c108.io – streaming and chunking helpers (StreamingFile, etc.)
  • c108.json – safe JSON file read/write/update with optional atomic operations
  • c108.network – timeout estimators
  • c108.numeric – std_numeric convertor
  • c108.os – low-level filesystem/path helpers
  • c108.scratch – scratch & temp file utilities
  • c108.sentinels – sentinel types
  • c108.shutil – high-level file utilities
  • c108.tools – miscellaneous helpers
  • c108.unicode – unicode text formatters
  • c108.utils – shared utils
  • c108.validators – common validation utilities

Features

C108-Lab packages are:

  • Curated – Centrally developed and maintained for consistency
  • Production-ready – Thoroughly tested and documented
  • Dependency-conscious – Core package stays lightweight; extra features and heavy deps live in sub-packages
  • Community-friendly – Issues and feature requests are welcome

c108 has no external dependencies, standard library only.

Community & Contributing

While we don't accept pull requests, we warmly welcome:

  • 🐛 Bug reports
  • Feature requests
  • 📖 Documentation feedback
  • Usage questions

Please open an issue on GitHub for any of the above.

Releases

  • Tagged releases on GitHub
  • PyPI is the source of truth
  • conda-forge feedstock tracks PyPI

License

MIT License (full text)

Development Reference

Commands 🖥️

1. Create dev environment locally

uv venv                            # creates .venv
uv sync --extra dev                # full dev environment with optional ML and Scientific deps
uv sync --extra test --extra tools # basic dev environment

2. Format with ruff

ruff format c108 tests

3. Run Tests with uv run COMMAND

Unit tests only (the subset used in CI):

pytest

Integration tests only (run locally):

pytest -m "integration"

Specific integration module:

pytest tests/integration/test_numeric.py

Unit and Integration tests:

pytest -m "integration or not integration"

Doctests:

pytest --xdoctest c108

4. Build and publish

# Build wheel + sdist via Hatchling
uv build
# Publish to PyPI; secrets handled by CI
uv publish --token ${{ secrets.PYPI_TOKEN }}

Test Structure ✅

  • Unit tests (fast, minimal deps): live in tests/ and are always run by CI.
  • Integration tests (optional, heavy deps): live in tests/integration/ and cover interactions with external packages such as NumPy, Pandas, PyTorch, TensorFlow, JAX, Astropy, and SymPy.

All integration tests use pytest.importorskip(), automatically skipped if a dependency is missing.

Test Dependencies

Integration tests use optional third‑party packages that are not required by the core test suite:

Package Supported Types
Astropy Physical Quantity types
JAX DeviceArray scalars
NumPy Numeric scalars and arrays
Pandas Nullable scalars/Series
PyTorch Tensor dtypes
SymPy Symbolic numeric support
TensorFlow Tensor dtypes

Install only what you need, for example:

pip install numpy pandas

Continuous Integration

GitHub Actions runs only unit tests for performance and reliability.

Integration tests are intended for local verification before releasing major versions or dependency interface changes.

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

c108-0.2.6.tar.gz (464.7 kB view details)

Uploaded Source

Built Distribution

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

c108-0.2.6-py3-none-any.whl (177.9 kB view details)

Uploaded Python 3

File details

Details for the file c108-0.2.6.tar.gz.

File metadata

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

File hashes

Hashes for c108-0.2.6.tar.gz
Algorithm Hash digest
SHA256 6acb5082d3d307b10a4590e5d3e145261fbeb8627466ca83ac2ac92fbd816aa0
MD5 27846ae63e55ab37a3e25bb8ce5bc1ce
BLAKE2b-256 e81652fff389084427d72f8d24ac4c09a0c571615787b4f70a0e8a29085a3ea2

See more details on using hashes here.

Provenance

The following attestation bundles were made for c108-0.2.6.tar.gz:

Publisher: release.yml on C108-Lab/c108

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

File details

Details for the file c108-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: c108-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 177.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for c108-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 04827359f2f507f86b00bc7364a40dc0a7267682c10e8beb4aed5e393bf84e85
MD5 f00b6be4e0295319d0a4658f977726d2
BLAKE2b-256 bfb4b9b0afd88c48a2291bafeab0421f8db8d108b6d4b4a060e29e39f07d3663

See more details on using hashes here.

Provenance

The following attestation bundles were made for c108-0.2.6-py3-none-any.whl:

Publisher: release.yml on C108-Lab/c108

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