Metadata-Version: 2.5
Name: cbrapitools
Version: 0.1.0
Summary: Python API clients and auth helpers for CBR platforms (CMP, Keystone, Keycloak)
Author: CBR Data Team
License-Expression: MIT
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: pydantic<3,>=2
Requires-Dist: python-keycloak<8,>=7.1
Requires-Dist: requests>=2.31
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

# cbrapitools

Python API clients and auth helpers for CBR platforms: CMP, Keystone and Keycloak.

## Install

```bash
pip install cbrapitools
```

Requires Python 3.11 or newer.

## Usage

```python
from cbrapitools.cmp import CmpApiClient
from cbrapitools.keystone import KeystoneApiClient
from cbrapitools.keycloak import KeycloakClientCredentialsAuth
```

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

```bash
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
```

## Releasing

1. Bump `version` in `pyproject.toml` (PyPI never accepts the same version twice).
2. Build and check:

   ```bash
   rm -rf dist
   python -m build
   twine check dist/*
   ```

3. Upload: `twine upload dist/*`
4. Users upgrade with `pip install -U cbrapitools`.
