qci_client
qci-client package.
- class qci_client.JobStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumEnumeration of all jobs statuses, where values match jobs API values.
- SUBMITTED = 'SUBMITTED'
- QUEUED = 'QUEUED'
- RUNNING = 'RUNNING'
- COMPLETED = 'COMPLETED'
- ERRORED = 'ERRORED'
- CANCELLED = 'CANCELLED'
- qci_client.QciClient
- alias of
OptimizationClient
qci_client.utilities
Package-wide utilities.
- qci_client.utilities.env_bool(*, name: str, default: bool) → bool[source]
Read a boolean from an environment variable, falling back to default if unset.
Values are parsed case-insensitively; “1”, “true”, “t”, “yes”, “y”, and “on” are True, while “0”, “false”, “f”, “no”, “n”, and “off” are False. Any other value (including an empty string) falls back to default.
- Parameters:
- name – name of environment variable to read
- default – value to return if variable is unset or unparseable
- qci_client.utilities.raise_for_status(*, response: Response) → None[source]
Wrap requests method of same name to include response text in exception message.
- Parameters:
- response – a response from any API call using the requests package
- qci_client.utilities.log_to_console(*, log: str, verbose: bool = True) → None[source]
- If verbose is true, then print log with timestamp prefix.
- qci_client.utilities.now_utc_ms() → str[source]
- Get current time in UTC with microsecond (i.e., maximum) precision.