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.6.tar.gz (3.6 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.6-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dioptra_iris_client-0.5.6.tar.gz
Algorithm Hash digest
SHA256 fa1780e3349014b7fed85ebd43f7eeffd56f95f3cb5f5d2b90d650bc142493ba
MD5 ab5c12d183ccd9d662ede69939d558ad
BLAKE2b-256 5912817caa98fcd92606ee0d932b3a630af1fcabdca35ccd5df8d47232dc34c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dioptra_iris_client-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 01469a99fb38ae0774f4efe498c6c73364ca79abd1c21aff91bdf316249126dd
MD5 766e0c18960ca9789dd5064b2015e27f
BLAKE2b-256 17f9e6423c4e6591ef11286eed8ba5fc843725b2d83cd15f55443752b0537277

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