Python client for the Iris API.
Project description
🕸️ Iris Python Client
Minimalist Python client for the Iris API, built on top of Authlib and httpx.
Installation
pip install dioptra-iris-client
Usage
from iris_client import IrisClient, AsyncIrisClient
base_url = "https://api.iris.dioptra.io"
username = "user@example.org"
password = "password"
# Synchronous client
with IrisClient(base_url, username, password) as client:
measurements = client.get("/measurements/").json()
# Asynchronous client
async with AsyncIrisClient(base_url, username, password) as client:
measurements = (await client.get("/measurements/")).json()
# Helper function to fetch all the results from a paginated endpoint,
# available for both clients:
all_measurements = client.all("/measurements/")
Credential provider chain
The Iris client looks for credentials in a way similar to the AWS SDK:
- If one of
base_url
,username
orpassword
is specified, these values will be used. - If none of the previous values are specified, and one of
IRIS_BASE_URL
,IRIS_USERNAME
orIRIS_PASSWORD
environment variables are present, these values will be used. - If none of the previous values are specified, and the file
~/.config/iris/credentials.json
exists, the fieldsbase_url
,username
andpassword
will be used.
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
Built Distribution
Close
Hashes for dioptra-iris-client-0.4.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 028b84eac59fb61b2f93f65739ccf36a8615a6c1272957920cd54a0deb431b3f |
|
MD5 | d7cc29942a0d642959527d7fd4c25d2a |
|
BLAKE2b-256 | 0f0359e0cc11c6ccd1eaf2d4e583679b7a516ab4de71a809c053800c442e7adb |
Close
Hashes for dioptra_iris_client-0.4.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58b14ac1c5dfffd7ac042e59e60d7a897c62ab017ffa4bd2b4dc0a357dfca894 |
|
MD5 | 9a5b11f32576faa484aaa758f13532f8 |
|
BLAKE2b-256 | 27217d7fd5e3fe88c5cecf4139043b585471aad10311118e92384b0c584d14a2 |