cirro_api_client


Namecirro_api_client JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/CirroBio/Cirro-client-python
SummaryA client library for accessing Cirro
upload_time2025-07-31 20:43:29
maintainerNone
docs_urlNone
authorCirro
requires_python<4.0,>=3.9
licenseMIT
keywords cirro
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cirro API Client
[![](https://img.shields.io/pypi/v/cirro-api-client.svg)](https://pypi.org/project/cirro_api_client/)

Low-level client for the Cirro API. Rather than using this package directly, we recommend using the [Cirro SDK](https://github.com/CirroBio/Cirro-client).

This Python package is automatically generated by the [OpenAPI Python Client](https://github.com/openapi-generators/openapi-python-client) project.

## Requirements.

Python 3.9+.

## Installation & Usage
### pip install

Via PyPI:
```sh
pip install cirro-api-client
```

You can also install it directory from the repository using:

```sh
pip install git+https://github.com/CirroBio/Cirro-client-python.git
```

## Getting Started

### Basic usage

```python
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
```python
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):

```python
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):

```python
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:

```sh
openapi-python-client update --url https://dev.cirro.bio/openapi/cirro-data-latest.yml --config config.yml --custom-template-path=templates/
 ```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/CirroBio/Cirro-client-python",
    "name": "cirro_api_client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "Cirro",
    "author": "Cirro",
    "author_email": "support@cirro.bio",
    "download_url": "https://files.pythonhosted.org/packages/c4/d5/e6dc4351b70fe292e8ff4c80bcc928a118049fb96d91383f92fb02dc48f1/cirro_api_client-1.1.0.tar.gz",
    "platform": null,
    "description": "# Cirro API Client\n[![](https://img.shields.io/pypi/v/cirro-api-client.svg)](https://pypi.org/project/cirro_api_client/)\n\nLow-level client for the Cirro API. Rather than using this package directly, we recommend using the [Cirro SDK](https://github.com/CirroBio/Cirro-client).\n\nThis Python package is automatically generated by the [OpenAPI Python Client](https://github.com/openapi-generators/openapi-python-client) project.\n\n## Requirements.\n\nPython 3.9+.\n\n## Installation & Usage\n### pip install\n\nVia PyPI:\n```sh\npip install cirro-api-client\n```\n\nYou can also install it directory from the repository using:\n\n```sh\npip install git+https://github.com/CirroBio/Cirro-client-python.git\n```\n\n## Getting Started\n\n### Basic usage\n\n```python\nimport os\nfrom typing import List\nfrom pprint import pprint\n\nfrom cirro_api_client import CirroApiClient, TokenAuth\nfrom cirro_api_client.v1.api.projects import get_projects\nfrom cirro_api_client.v1.models import Project\nfrom cirro_api_client.v1.types import Response\n\n# Create auth method, you can also extend the AuthMethod class\nauth_method = TokenAuth(token=os.environ['TOKEN'])\n# You can also use the RefreshableTokenAuth class\n# auth_method = RefreshableTokenAuth(token_getter=lambda : os.environ['TOKEN'])\n\n# Create a client\nclient = CirroApiClient(base_url=\"https://api.cirro.bio\",\n                        auth_method=auth_method)\n\n# Call API endpoint, get list of projects\nprojects: List[Project] = get_projects.sync(client=client)\nprint(\"The response of get_projects:\\n\")\npprint(projects)\n## or if you need more info (e.g. status_code)\nresp: Response[List[Project]] = get_projects.sync_detailed(client=client)\nprojects = resp.parsed\n```\n\n### Async usage\n```python\nimport os\nfrom typing import List\n\nfrom cirro_api_client import CirroApiClient, TokenAuth\nfrom cirro_api_client.v1.api.projects import get_projects\nfrom cirro_api_client.v1.models import Project\n\nclient = CirroApiClient(base_url=\"https://api.cirro.bio\",\n                        auth_method=TokenAuth(token=os.environ['TOKEN']))\n\n# async method\nasync with client as client:\n    projects: List[Project] = await get_projects.asyncio(client=client)\n```\n\n### Advanced usage\n\nThere 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):\n\n```python\nimport os\nfrom cirro_api_client import CirroApiClient, TokenAuth\n\ndef log_request(request):\n    print(f\"Request event hook: {request.method} {request.url} - Waiting for response\")\n\ndef log_response(response):\n    request = response.request\n    print(f\"Response event hook: {request.method} {request.url} - Status {response.status_code}\")\n\nclient = CirroApiClient(\n    base_url=\"https://api.cirro.bio\",\n    auth_method=TokenAuth(token=os.environ['TOKEN']),\n    httpx_args={\"event_hooks\": {\"request\": [log_request], \"response\": [log_response]}},\n)\n\n# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()\n```\n\nYou can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):\n\n```python\nimport os\nimport httpx\nfrom cirro_api_client import CirroApiClient, TokenAuth\n\nclient = CirroApiClient(base_url=\"https://api.cirro.bio\",\n                        auth_method=TokenAuth(token=os.environ['TOKEN']))\n\n# Note that base_url needs to be re-set, as would any shared cookies, headers, etc.\nclient.set_httpx_client(httpx.Client(base_url=\"https://api.cirro.bio\", proxies=\"http://localhost:8030\"))\n```\n\n## Developer information\n\nRe-generate the API client by running:\n\n```sh\nopenapi-python-client update --url https://dev.cirro.bio/openapi/cirro-data-latest.yml --config config.yml --custom-template-path=templates/\n ```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A client library for accessing Cirro",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/CirroBio/Cirro-client-python",
        "Repository": "https://github.com/CirroBio/Cirro-client-python"
    },
    "split_keywords": [
        "cirro"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0642ab6b47009ed3de8b66358ebdc6ecbafe1a6b0c83f2f114485596a51ee0c4",
                "md5": "ccfd894b8cff287aec0cafb72da57e92",
                "sha256": "bd91979bdbf6d3ab129565ac5c0e037bc18283ac3e41b955237aaee721716a7b"
            },
            "downloads": -1,
            "filename": "cirro_api_client-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ccfd894b8cff287aec0cafb72da57e92",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 316262,
            "upload_time": "2025-07-31T20:43:27",
            "upload_time_iso_8601": "2025-07-31T20:43:27.602343Z",
            "url": "https://files.pythonhosted.org/packages/06/42/ab6b47009ed3de8b66358ebdc6ecbafe1a6b0c83f2f114485596a51ee0c4/cirro_api_client-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4d5e6dc4351b70fe292e8ff4c80bcc928a118049fb96d91383f92fb02dc48f1",
                "md5": "4b9e140d7a30cc86d2bfa3655da434ec",
                "sha256": "a6b64791dff0f0c2bf0a0b87b9bd528eb4072d63eda76cc72f84a158acfd696d"
            },
            "downloads": -1,
            "filename": "cirro_api_client-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4b9e140d7a30cc86d2bfa3655da434ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 87585,
            "upload_time": "2025-07-31T20:43:29",
            "upload_time_iso_8601": "2025-07-31T20:43:29.168819Z",
            "url": "https://files.pythonhosted.org/packages/c4/d5/e6dc4351b70fe292e8ff4c80bcc928a118049fb96d91383f92fb02dc48f1/cirro_api_client-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-31 20:43:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CirroBio",
    "github_project": "Cirro-client-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cirro_api_client"
}
        
Elapsed time: 2.90740s