Skip to main content

Python client for the Iris API.

Project description

🕸️ Iris Python Client

Tests Coverage PyPI

Minimal 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

# NOTE: If the username and/or the password are not specified,
# they will be retrieved from the `IRIS_USERNAME` and `IRIS_PASSWORD` environment variables.

# Synchronous client
with IrisClient("user@example.org", "password") as client:
    measurements = client.get("/measurements/").json()

# Asynchronous client
async with AsyncIrisClient("user@example.org", "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/")

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.2.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

dioptra_iris_client-0.2.1-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

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