Skip to main content

Asiri API Python SDK

Project description

asiri-sdk

Official Python SDK for the Asiri API.

Install

pip install asiri-sdk

Quickstart

from asiri import AsiriClient, AsiriError

asiri = AsiriClient(
    api_key="sk_live_...",
)

try:
    overview = asiri.get("/v1/reports/overview")
except AsiriError as exc:
    print(exc.code, exc.status, exc.request_id)
else:
    print(overview)

Mutating requests

Pass an idempotency key on POST, PUT, PATCH, and DELETE requests so retries are safe:

asiri.post(
    "/v1/reports/build",
    json_body={"type": "audit_summary", "format": "json"},
    idempotency_key="retry-safe-key",
)

AsiriClient defaults to https://api.asiri.ng, sends Accept: application/json, and adds User-Agent: asiri-sdk/<version> unless you override those headers.

Development

PYTHONPATH=packages/sdk-python/src python3 -m unittest discover packages/sdk-python/tests
python3 -m pip wheel packages/sdk-python --no-deps --wheel-dir /tmp/asiri-sdk-wheel

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

asiri_sdk-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

asiri_sdk-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file asiri_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: asiri_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asiri_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 092ba10f33f8d2aa73736d1a9047bd2ff4293512391cddcb68bc824fc6cb833b
MD5 3382167127fbe490064a708f670f2efa
BLAKE2b-256 a609fdcbbe31ba01e30ef475b30d76d8fa0297931ba4747ed6b04c4ce448cc71

See more details on using hashes here.

Provenance

The following attestation bundles were made for asiri_sdk-0.1.0.tar.gz:

Publisher: release-sdk-py.yml on asiri-ng/asiri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asiri_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: asiri_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asiri_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 418501dedf5e3f3c58c4908bdaed895f5016d4b9b8b1b78a269bd52a6ed56a52
MD5 a19aa3a2b29b13b8396e14b2435ab78b
BLAKE2b-256 c97ab02072213ca972b9e347cc13600085e333c00bf2e0f888460fc228b16efa

See more details on using hashes here.

Provenance

The following attestation bundles were made for asiri_sdk-0.1.0-py3-none-any.whl:

Publisher: release-sdk-py.yml on asiri-ng/asiri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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