Cirro API Client
Low-level client for the Cirro API. Rather than using this package directly, we recommend using the Cirro SDK.
This Python package is automatically generated by the OpenAPI Python Client project.
Requirements.
Python 3.11+.
Installation & Usage
pip install
Via PyPI:
pip install cirro-api-client
You can also install it directory from the repository using:
pip install git+https://github.com/CirroBio/Cirro-client-python.git
Getting Started
Basic usage
import os
from typing import List
from pprint import pprint
from cirro_api_client import CirroApiClient, TokenAuth
from cirro_api_client.v1.api.projects import get_projects
from cirro_api_client.v1.models import Project
from cirro_api_client.v1.types import Response
# Create auth method, you can also extend the AuthMethod class
auth_method = TokenAuth(token=os.environ['TOKEN'])
# You can also use the RefreshableTokenAuth class
# auth_method = RefreshableTokenAuth(token_getter=lambda : os.environ['TOKEN'])
# Create a client
client = CirroApiClient(base_url="https://api.cirro.bio",
auth_method=auth_method)
# Call API endpoint, get list of projects
projects: List[Project] = get_projects.sync(client=client)
print("The response of get_projects:\n")
pprint(projects)
## or if you need more info (e.g. status_code)
resp: Response[List[Project]] = get_projects.sync_detailed(client=client)
projects = resp.parsed
Async usage
import os
from typing import List
from cirro_api_client import CirroApiClient, TokenAuth
from cirro_api_client.v1.api.projects import get_projects
from cirro_api_client.v1.models import Project
client = CirroApiClient(base_url="https://api.cirro.bio",
auth_method=TokenAuth(token=os.environ['TOKEN']))
# async method
async with client as client:
projects: List[Project] = await get_projects.asyncio(client=client)
Advanced usage
There are more settings on the generated CirroApiClient class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying httpx.Client or httpx.AsyncClient (depending on your use-case):
import os
from cirro_api_client import CirroApiClient, TokenAuth
def log_request(request):
print(f"Request event hook: {request.method} {request.url} - Waiting for response")
def log_response(response):
request = response.request
print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
client = CirroApiClient(
base_url="https://api.cirro.bio",
auth_method=TokenAuth(token=os.environ['TOKEN']),
httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
)
# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
import os
import httpx
from cirro_api_client import CirroApiClient, TokenAuth
client = CirroApiClient(base_url="https://api.cirro.bio",
auth_method=TokenAuth(token=os.environ['TOKEN']))
# Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
client.set_httpx_client(httpx.Client(base_url="https://api.cirro.bio", proxies="http://localhost:8030"))
Developer information
Re-generate the API client by running:
openapi-python-client generate --overwrite --url http://localhost:8080/openapi/cirro-data-latest.yml --config config.yml --custom-template-path=templates/
Metadata
Release files for cirro-api-client 1.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cirro_api_client-1.7.2.tar.gz | 147.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cirro_api_client-1.7.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 670.5 kB
Release files / cirro_api_client-1.7.2.tar.gz
| Download URL | cirro_api_client-1.7.2.tar.gz |
|---|---|
| Size | 147.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7633f86a4e22beeef49ac4aad67b65a328918726ddda40f9a296f0c6c3da2aca
|
|
BLAKE2b-256 checksum How to use checksums |
f11ded5b7ef927a183bbff37babd9228718943ec53750fb100e1f08d396ad701
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / cirro_api_client-1.7.2-py3-none-any.whl
| Download URL | cirro_api_client-1.7.2-py3-none-any.whl |
|---|---|
| Size | 523.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a87dd1fdc0bfe11b5214b0b9a11cc14c93a889a0b173cf10ee2d046296b5c275
|
|
BLAKE2b-256 checksum How to use checksums |
89c6aa37941aa4329296ee66d651bc6da4f3b63f85d6f5edda952a87bd722b24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logSecurity for cirro-api-client 1.7.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cirro_api_client-1.7.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.