🕸️
Iris Python Client
Minimal 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
# NOTE: If the username and/or the password are not specified,
# they will be retrieved from the `IRIS_USERNAME` and `IRIS_PASSWORD` environment variables.
# Synchronous client
with IrisClient("[email protected]", "password") as client:
measurements = client.get("/measurements/").json()
# Asynchronous client
async with AsyncIrisClient("[email protected]", "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/")