cbrapitools
Python API clients and auth helpers for CBR platforms: CMP, Keystone and Keycloak.
Install
pip install cbrapitools
Requires Python 3.11 or newer.
Usage
from cbrapitools.cmp import CmpApiClient
from cbrapitools.keystone import KeystoneApiClient
Base URLs and credentials are passed in by the caller (constructor arguments or
environment variables). Nothing environment-specific is hard-coded in the package.
Modules
| Module |
Purpose |
http_client |
Shared HTTP layer used by the API clients |
keycloak |
Token acquisition and refresh against Keycloak |
cmp |
Client for the Cohort Management Portal API |
keystone |
Client for the Keystone API |
Development
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
Releasing
-
Bump version in pyproject.toml (PyPI never accepts the same version twice).
-
Build and check:
rm -rf dist
python -m build
twine check dist/*
-
Upload: twine upload dist/*
-
Users upgrade with pip install -U cbrapitools.