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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 242e3b5aef990597af66f31fb5c02749051028f6fa17cdb9c027496870c79e33 |
|
MD5 | 73a701edcd2e8333fa72c6e35ba70055 |
|
BLAKE2b-256 | 3a341cb49703cffca4cd1e00228ff50bee9c247cf94b8eaf84b59966f8180950 |
Close
Hashes for dioptra_iris_client-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9361ac09d81090cd6ed658aaf6e488688fa7d70ff7eced51b8de910f485b61dd |
|
MD5 | dc291576c733a14ee78c50948418fe8c |
|
BLAKE2b-256 | d25aae0dd4d23fdee3fdb4b5ae9d4c94d3f8490584d03dfb738b2d2184607714 |