qcs-api-client


Nameqcs-api-client JSON
Version 0.25.1 PyPI version JSON
download
home_pagehttps://github.com/rigetti/qcs-api-client-python
SummaryA client library for accessing the Rigetti QCS API
upload_time2024-04-15 16:46:24
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Documentation Status](https://readthedocs.org/projects/qcs-api-client-python/badge/?version=latest)](https://qcs-api-client-python.readthedocs.io/en/latest/?badge=latest)

# QCS API Client

A client library for accessing the [Rigetti QCS API](https://docs.api.qcs.rigetti.com/).

## Usage

### Synchronous Usage

```python
from qcs_api_client.client import build_sync_client
from qcs_api_client.models import ListReservationsResponse
from qcs_api_client.operations.sync import list_reservations

with build_sync_client() as client:
    response: ListReservationsResponse = list_reservations(client=client).parsed
```

### Asynchronous Usage

```python
from qcs_api_client.client import build_async_client
from qcs_api_client.models import ListReservationsResponse
from qcs_api_client.operations.asyncio import list_reservations

# Within an event loop:
async with build_async_client() as client:
    response: ListReservationsResponse = await list_reservations(client=client).parsed
```

### Configuration

By default, initializing your client with `build_sync_client` or `build_async_client` will
use `QCSClientConfiguation.load` to load default configuration values. This function accepts:

- A profile name (env: `QCS_PROFILE_NAME`). The name of the profile referenced in your settings
  file. If not provided, `QCSClientConfiguation.load` will evaluate this to a `default_profile_name`
  set in your settings file or "default".
- A settings file path (env: `QCS_SETTINGS_FILE_PATH`). A path to the current user's settings file in TOML format. If not provided,  `QCSClientConfiguation.load` will evaluate this to `~/.qcs/settings.toml`.
- A secrets file path (env: `QCS_SECRETS_FILE_PATH`). A path to the current user's secrets file in TOML format. If not provided,  `QCSClientConfiguation.load` will evaluate this to `~/.qcs/secrets.toml`. The user should have write access to this file, as the client will attempt to update the file with refreshed access tokens as necessary.
     
If you need to specify a custom profile name or path you can initialize your client accordingly:

```python
from qcs_api_client.client import build_sync_client, QCSClientConfiguration
from qcs_api_client.models import ListReservationsResponse
from qcs_api_client.operations.sync import list_reservations

configuration = QCSClientConfiguration.load(
    profile_name='custom',
    secrets_file_path='./path/to/custom/secrets.toml',
    settings_file_path='./path/to/custom/settings.toml',
)

with build_sync_client(configuration=configuration) as client:
    response: ListReservationsResponse = list_reservations(client=client).parsed
```

## Development

The source code for this repository is synchronized from another source. No commits made directly to GitHub will be retained.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rigetti/qcs-api-client-python",
    "name": "qcs-api-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/a3/fc/77f520320b71eb990afea6725ed94544cd5d580cd17462fb05209a7a6887/qcs_api_client-0.25.1.tar.gz",
    "platform": null,
    "description": "[![Documentation Status](https://readthedocs.org/projects/qcs-api-client-python/badge/?version=latest)](https://qcs-api-client-python.readthedocs.io/en/latest/?badge=latest)\n\n# QCS API Client\n\nA client library for accessing the [Rigetti QCS API](https://docs.api.qcs.rigetti.com/).\n\n## Usage\n\n### Synchronous Usage\n\n```python\nfrom qcs_api_client.client import build_sync_client\nfrom qcs_api_client.models import ListReservationsResponse\nfrom qcs_api_client.operations.sync import list_reservations\n\nwith build_sync_client() as client:\n    response: ListReservationsResponse = list_reservations(client=client).parsed\n```\n\n### Asynchronous Usage\n\n```python\nfrom qcs_api_client.client import build_async_client\nfrom qcs_api_client.models import ListReservationsResponse\nfrom qcs_api_client.operations.asyncio import list_reservations\n\n# Within an event loop:\nasync with build_async_client() as client:\n    response: ListReservationsResponse = await list_reservations(client=client).parsed\n```\n\n### Configuration\n\nBy default, initializing your client with `build_sync_client` or `build_async_client` will\nuse `QCSClientConfiguation.load` to load default configuration values. This function accepts:\n\n- A profile name (env: `QCS_PROFILE_NAME`). The name of the profile referenced in your settings\n  file. If not provided, `QCSClientConfiguation.load` will evaluate this to a `default_profile_name`\n  set in your settings file or \"default\".\n- A settings file path (env: `QCS_SETTINGS_FILE_PATH`). A path to the current user's settings file in TOML format. If not provided,  `QCSClientConfiguation.load` will evaluate this to `~/.qcs/settings.toml`.\n- A secrets file path (env: `QCS_SECRETS_FILE_PATH`). A path to the current user's secrets file in TOML format. If not provided,  `QCSClientConfiguation.load` will evaluate this to `~/.qcs/secrets.toml`. The user should have write access to this file, as the client will attempt to update the file with refreshed access tokens as necessary.\n     \nIf you need to specify a custom profile name or path you can initialize your client accordingly:\n\n```python\nfrom qcs_api_client.client import build_sync_client, QCSClientConfiguration\nfrom qcs_api_client.models import ListReservationsResponse\nfrom qcs_api_client.operations.sync import list_reservations\n\nconfiguration = QCSClientConfiguration.load(\n    profile_name='custom',\n    secrets_file_path='./path/to/custom/secrets.toml',\n    settings_file_path='./path/to/custom/settings.toml',\n)\n\nwith build_sync_client(configuration=configuration) as client:\n    response: ListReservationsResponse = list_reservations(client=client).parsed\n```\n\n## Development\n\nThe source code for this repository is synchronized from another source. No commits made directly to GitHub will be retained.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A client library for accessing the Rigetti QCS API",
    "version": "0.25.1",
    "project_urls": {
        "Documentation": "https://qcs-api-client-python.readthedocs.io/en/latest/index.html",
        "Homepage": "https://github.com/rigetti/qcs-api-client-python",
        "Repository": "https://github.com/rigetti/qcs-api-client-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b266b06ce57404d4328012175326d6014a4f309851ff685e1758956ca851adc",
                "md5": "2f8cb733a1e8c420c4886db4677a70e8",
                "sha256": "ce4b86c9dde7c8c3a0359c4c8d4eac66cf7889e06fdc84c997eaac983aaa7e0a"
            },
            "downloads": -1,
            "filename": "qcs_api_client-0.25.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f8cb733a1e8c420c4886db4677a70e8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 161774,
            "upload_time": "2024-04-15T16:46:20",
            "upload_time_iso_8601": "2024-04-15T16:46:20.150431Z",
            "url": "https://files.pythonhosted.org/packages/8b/26/6b06ce57404d4328012175326d6014a4f309851ff685e1758956ca851adc/qcs_api_client-0.25.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3fc77f520320b71eb990afea6725ed94544cd5d580cd17462fb05209a7a6887",
                "md5": "97e5b48984fdaba3e2dc2098e790daf2",
                "sha256": "e77189ca61fea63f3956e2fbec8dfffacc3059191fdc1837d3d789a2f83635da"
            },
            "downloads": -1,
            "filename": "qcs_api_client-0.25.1.tar.gz",
            "has_sig": false,
            "md5_digest": "97e5b48984fdaba3e2dc2098e790daf2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 57213,
            "upload_time": "2024-04-15T16:46:24",
            "upload_time_iso_8601": "2024-04-15T16:46:24.639048Z",
            "url": "https://files.pythonhosted.org/packages/a3/fc/77f520320b71eb990afea6725ed94544cd5d580cd17462fb05209a7a6887/qcs_api_client-0.25.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-15 16:46:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rigetti",
    "github_project": "qcs-api-client-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "qcs-api-client"
}
        
Elapsed time: 0.28878s