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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cb1230a2a8000fc0d11a13322b03c25902af98be6be7c0c824595c61ce84a1f |
|
MD5 | b3069a1b01e315a5772016ec10fbef60 |
|
BLAKE2b-256 | e7fe222f59e124f2cffda9e9f74f9424a8ca5ae85bd4516fecd3cebcea234917 |
Close
Hashes for dioptra_iris_client-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 693d4a917dcd44259d3e136d273032ef68822adde558720ce1003246d8817b0a |
|
MD5 | 5563834f9b92aa6c4486714e9ecc8d6a |
|
BLAKE2b-256 | b5d5a55dc0c6547e2575009958fdd206e7349cdabd2ad60711d736f8de98ed2b |