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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61ea4e45c54ed806842761a97d1d328ebce51ea78595c2e2d668e725175e498a |
|
MD5 | 904a0f84e87e5684638b5a8e4ece359e |
|
BLAKE2b-256 | 502c7033b47415f12f39f6bb5204156bf5bfeb9d81361867062959405115637d |
Close
Hashes for dioptra_iris_client-0.4.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 769f1fdb8f2eab4fe9ce95beec14dcd03723492719123b6a717fff7308f43816 |
|
MD5 | 0d85f20ab9a3a47028f8119633c451e6 |
|
BLAKE2b-256 | 6c1b71ac5ebe01cc1ba708a68bbb93899be7b266e069c1828a14ca72a2888e59 |