Skip to main content

Python SDK for Relivio deploy registration, log ingestion, and minimal latest verdict reads.

Project description

relivio-sdk-python

Thin Python SDK for Relivio deploy registration, log ingestion, and one minimal latest verdict read for service-side guard flows.

Status

  • current package scope: 0.1.0
  • supported Python versions: 3.9+
  • current public surface:
    • deployments.register()
    • ingest.send()
    • ingest.send_batch()
    • verdicts.latest()
  • automatic retry only for 429 RATE_LIMITED

Non-goals

  • full verdict consumer surface
  • feedback/history/list/search APIs
  • framework integration
  • guard or middleware
  • auto instrumentation

Installation

pip install relivio-sdk

For local development:

pip install -e ".[dev]"

Quick Start

from relivio import Relivio, IngestLogInput

relivio = Relivio(api_key="rk_...")

deployment = relivio.deployments.register(version="1.2.3")
print(deployment.id)

result = relivio.ingest.send(
    IngestLogInput(
        level="ERROR",
        message="checkout failed",
        api_path="/api/orders/finalize",
    )
)
print(result.log_event_id)

verdict = relivio.verdicts.latest()
if verdict is not None:
    print(verdict.verdict, verdict.decision_tier)

Async Example

import asyncio
from relivio import Relivio, RegisterDeploymentInput

relivio = Relivio(api_key="rk_...")

async def main() -> None:
    deployment = await relivio.deployments.aregister(
        RegisterDeploymentInput(version="1.2.3")
    )
    print(deployment.id)

asyncio.run(main())

Development

python -m venv .venv
./.venv/bin/pip install -e ".[dev]"
./.venv/bin/pytest
./.venv/bin/python -m build

Behavior Notes

  • API key is sent through X-API-Key
  • Idempotency-Key is supported for v0 writer endpoints
  • 429 responses are retried with Retry-After
  • 5xx responses are not retried
  • server can accept gzip payloads, but SDK v0 sends plain JSON only
  • verdicts.latest() is intentionally narrow and only exists to support service-side guard logic
  • verdicts.latest() returns None on 404 when a verdict is not available yet

Related Repos

  • relivio-server: server-side deploy registration, ingest, and summary generation
  • relivio-mcp: agent-facing verdict consumer surface

Security

Do not commit project API keys. Keep X-API-Key values in environment variables or local secret storage outside source control.

Contributing

Small, behavior-preserving changes are preferred. Keep transport, resource, type, and error responsibilities separate, and run the smallest effective test/build checks before sending a change.

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

relivio_sdk-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

relivio_sdk-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: relivio_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for relivio_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6bab419d1178c397155a450532005fb72f2b3583fb544c22a6838ee5e07836fc
MD5 ea255a7b0ab801f262ffa9906c6df43e
BLAKE2b-256 9a6cd55cd0d0f4ed3afbfb0ea213c53542f79785056d89445bd14feb9e7883e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relivio_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for relivio_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d835a11b9c68baf784bf0ef93091008e47154017b4e286f9664b08d9d5a6eb55
MD5 9fb38337562c5f0ac1cd264b28a3b9bc
BLAKE2b-256 23ed5d97c22f97fa4fefb7498722f7e6a2de4cc3f56489c0c0d60e60e2a46cb6

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