A client library for accessing the Rigetti QCS API
Project description
QCS API Client
A client library for accessing the Rigetti QCS API.
Usage
Synchronous Usage
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
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 adefault_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:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qcs_api_client-0.25.5.tar.gz
(57.3 kB
view details)
Built Distribution
File details
Details for the file qcs_api_client-0.25.5.tar.gz
.
File metadata
- Download URL: qcs_api_client-0.25.5.tar.gz
- Upload date:
- Size: 57.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c10d1ab094692370448796e114e8fbe4a65e49249fb889e87f24f33cef4bbb3 |
|
MD5 | 6238bdbb1f43e86172104b96fa98fd45 |
|
BLAKE2b-256 | 423acb12119c0a59402c2c2fc39342d7ffe2f8439631dca2f7378758e8f43d06 |
File details
Details for the file qcs_api_client-0.25.5-py3-none-any.whl
.
File metadata
- Download URL: qcs_api_client-0.25.5-py3-none-any.whl
- Upload date:
- Size: 162.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaf4a7142c0ea3a0b85bc30af255cdb0da412c3f2eab271cd14c6a7ebfe80b78 |
|
MD5 | 673a9d57632bde9e1af1e7e63a366441 |
|
BLAKE2b-256 | d44dba9cbb12e1aa677ef23e6799125a54db7fe792a89a3990faaf4765cf181a |