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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8446f1d4d0214ee729f2c5eeab940dcd0c536427afc26fb0d3d8463b9d369cfa |
|
MD5 | f39eed81d63eea0fe93f7d96571d50a5 |
|
BLAKE2b-256 | 72035fdbf993df13ea2e8b31e90963ace717c0156cd29231bca618bab6a89c79 |
Close
Hashes for dioptra_iris_client-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d27308f4ddae4201c956d1e5507115a343f26d203bf54416cdb4d4ea4441c34 |
|
MD5 | 6aa3e9b7782041546dffdeefc4ce55a0 |
|
BLAKE2b-256 | d1f32f4a17063224bbd890d4b2f4c999cf675e137f2bd9ebfee2263ce0c50e5c |