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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3faeabdc3d63bbf6546eab61c4cb780e1bdcef49c9e155e10271170996cf212f |
|
MD5 | d51ee68f8352be5dd8369b9834ea1e9f |
|
BLAKE2b-256 | afa3ea33800b8ec333289f9b41f2d4a57cfe00a179e02c829725b989a2ada14e |
Close
Hashes for dioptra_iris_client-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b21067c4b4e9154f07e1f9894c4b94cfed90040b7e69d16de7d67e3aac010da |
|
MD5 | e3915fa0b00edb9952bf97524948a012 |
|
BLAKE2b-256 | fa250286180197fe6441712dbe09d741299cf5d3c23f9d8c187a469cac92caeb |