GitHub - rigetti/qcs-api-client-python: Python client for the QCS API (original) (raw)

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:

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.