Skip to main content

Python client for the Iris API.

Project description

🕸️ Iris Python Client

Tests Coverage PyPI

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:

  1. If one of base_url, username or password is specified, these values will be used.
  2. If none of the previous values are specified, and one of IRIS_BASE_URL, IRIS_USERNAME or IRIS_PASSWORD environment variables are present, these values will be used.
  3. If none of the previous values are specified, and the file ~/.config/iris/credentials.json exists, the fields base_url, username and password will be used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dioptra_iris_client-0.5.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dioptra_iris_client-0.5.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file dioptra_iris_client-0.5.2.tar.gz.

File metadata

  • Download URL: dioptra_iris_client-0.5.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dioptra_iris_client-0.5.2.tar.gz
Algorithm Hash digest
SHA256 6fd214b2f84946b05911217e24df4f12c878b621f10d7c16ad993b7e1173bfe9
MD5 2cd526bd9dfe7c1babb058283a59616d
BLAKE2b-256 aedc3c4de4d7d01e861f1657e7da083f4c5ad25015a30bfed79a1e12d737ed1f

See more details on using hashes here.

File details

Details for the file dioptra_iris_client-0.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dioptra_iris_client-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1cb8ce8f1cd1e4fcff5098f4550ae154c4d0582cee264625a080187e1e05c772
MD5 0543d74d0ac5c45abdb88f36ec756006
BLAKE2b-256 db746bf7445ca220e4f5ff7ef3d32047b928542db4df92a3f64076e9490f968a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page