Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.26 KB

File metadata and controls

39 lines (27 loc) · 1.26 KB

quantum-random

Python library for quantum random numbers, fetched from the ANU Quantum Random Numbers Server.

Commands

# Install with all extras and dev dependencies
uv sync --all-extras --all-groups

# Run tests
QRANDOM_API_KEY=key uv run pytest

# Type check
uv run ty check .

# Lint
uv run ruff check .

Structure

  • src/qrandom/ — library source
    • _api.py — HTTP client for the ANU API
    • _generator.pyrandom.Random subclass backed by quantum randomness
    • _cli.pyqrandom-init CLI for storing the API key
    • _util.py — XDG config path utilities
    • numpy.py — optional numpy/randomgen integration
  • tests/ — pytest tests
  • analysis/ — notebooks/scripts (not part of the package)

CI

GitHub Actions runs tests across Python 3.10–3.14 on Linux, macOS, and Windows, plus a lint job pinned to 3.12. Python versions are managed via UV_PYTHON and UV_MANAGED_PYTHON=1 env vars set at the job level.

Notes

  • API key is read from QRANDOM_API_KEY env var or a config file (qrandom.ini) in QRANDOM_CONFIG_DIR (defaults to XDG config home)
  • Use click.utils.strip_ansi() on result.output in CLI test assertions to handle ANSI codes consistently across platforms