Official Python client for Task Badger. Public package: taskbadger on PyPI.
uv sync --frozen # Install deps (incl. dev + cli extras via dependency-groups)
uv run pytest # Run unit tests (integration_tests/ is excluded by default)
uv run pytest integration_tests -vs # Run integration tests (needs Redis + TASKBADGER_API_KEY)
uv run ruff check . --fix # Lint
uv run ruff format . # Format
uv build # Build sdist + wheelPre-commit runs ruff-check + ruff-format; install with uv run pre-commit install.
taskbadger/— SDK sourcesdk.py,mug.py,safe_sdk.py— public API surface (re-exported from__init__.py)decorators.py—@trackdecoratorsystems/,celery.py— Celery integration (optional extra)cli/,cli_main.py— Typer-based CLI (optional[cli]extra)internal/— generated byopenapi-python-client; do not hand-edit
tests/— unit tests (pytest, pytest-httpx)integration_tests/— hits real Task Badger API; excluded from default pytest runtaskbadger.yaml— OpenAPI schema used to regenerateinternal/
uv run invoke update-api # Pull latest schema + regenerate
uv run invoke update-api --local # Regenerate from existing taskbadger.yamlThe update-api invoke task curls localhost:8000/api/schema.json by default — pass --local if you don't have the API server running.
- Ruff: line-length 120, target Python 3.10, rules
E F I UP DJ PT. - Supports Python 3.10–3.14 — don't use 3.11+ syntax (e.g.
Self,LiteralString). - Celery and CLI deps are optional; guard imports inside
taskbadger/celery.py,taskbadger/systems/celery.py,taskbadger/cli/. taskbadger/internal/*is generator output — lint is best-effort, don't reformat manually.
uv run invoke tag-release # Bumps version in pyproject.toml, tags, pushes — triggers release.ymlGitHub Actions then drafts a release; publishing the release triggers publish.yml → PyPI.
pytestskipsintegration_tests/vianorecursedirs— name them explicitly to run.- Integration tests need
TASKBADGER_ORG,TASKBADGER_PROJECT,TASKBADGER_API_KEYenv vars and a running Redis. - Imports of
celery,typer,richmust stay optional — only the core httpx/attrs deps are guaranteed.