Skip to main content

A client library for accessing the Rigetti QCS API

Project description

Documentation Status

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

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.26.5.tar.gz (59.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qcs_api_client-0.26.5-py3-none-any.whl (182.9 kB view details)

Uploaded Python 3

File details

Details for the file qcs_api_client-0.26.5.tar.gz.

File metadata

  • Download URL: qcs_api_client-0.26.5.tar.gz
  • Upload date:
  • Size: 59.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.3 Linux/6.11.0-1012-azure

File hashes

Hashes for qcs_api_client-0.26.5.tar.gz
Algorithm Hash digest
SHA256 5b8fdd5e85ff033bbe070aafab1d87721bdfc05bff9ff28face78aec7030df15
MD5 4936c403702b3bd4f90d9c220acabb5d
BLAKE2b-256 0815460417d29a2890713666bfc4532c1aebd16b5cf3a3a91c362f84506283b0

See more details on using hashes here.

File details

Details for the file qcs_api_client-0.26.5-py3-none-any.whl.

File metadata

  • Download URL: qcs_api_client-0.26.5-py3-none-any.whl
  • Upload date:
  • Size: 182.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.3 Linux/6.11.0-1012-azure

File hashes

Hashes for qcs_api_client-0.26.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cd3c7fc8c1187a54e7a4ecda59105a75912c33a7ccd492707bc25385cb049c96
MD5 2a43527199aed51803c0396ebec7f131
BLAKE2b-256 2450dd3e05235d4b2a7fc6c0396ac85db5f542c8451e7c5f6690b5339339be6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page