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_elena-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_elena-0.5.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for dioptra_iris_client_elena-0.5.2.tar.gz
Algorithm Hash digest
SHA256 089299ed7707c42d71dd8ade73a6ccb6af41565d0e8b1eb136c96a6d1c54f454
MD5 c5e166bea84dad784e6acfd53d2c500d
BLAKE2b-256 451b25bbec41768a9bd5a4f52cc97604774688d87b6a723929dc68b6e1859f1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dioptra_iris_client_elena-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ade605903e93ce5b58b571b1a76ace488244e4952117cb71e80082b0e2e39055
MD5 a26ac6bd09b8190bb8a7011432aa90aa
BLAKE2b-256 ac4b191d245cb53d68e53ff3d6dc7585069faf8a25684b12f7f2b586c7906186

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