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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc28e7897727dfb60f564bddfff240801b6d627fbf3edeb073a5b5e8ffc0786 |
|
MD5 | 9212f5eaf65e4787349814434900f27a |
|
BLAKE2b-256 | 227ce2e2f160129b5265ca4a3f4a688f039b129b873cafcfee6de7e15c05f101 |
Close
Hashes for dioptra_iris_client-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c291efbce406c1497413d8808a6a8f8db7a5072355d32916a0e03a47f6b63da |
|
MD5 | c5af933d10dbf6aba87b929ea703005c |
|
BLAKE2b-256 | 35c315ab8d9aec55a7f489eb8501cf5d2711cb2f8b40db61758018c31cc4cc2c |