Skip to content

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 latest from GitHub:

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

Modules

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.