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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6422aabb11d4ca3fff1a7a7ffa6fc08cb9017fb2540003e36180d5973df234e2 |
|
MD5 | 04a70507d28f8922f802f524084917b5 |
|
BLAKE2b-256 | cce62cee4b6ca25b15e824459c0aa395fefe329880aa0c28adec6e7f86ff5386 |
Close
Hashes for dioptra_iris_client-0.4.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c19486da02e9b4f7ac7c453fa1974e79ab3b889bb1b8de697068033f2fd7246 |
|
MD5 | 1f6d452c505f86db3a438e3308149c6d |
|
BLAKE2b-256 | b234274d3aab516f3ee0345db25f31786321f5fbe6fa502b44410221fde456f1 |