This service is under active development. Features may change without notice.
← Back to SDKs

Python SDK

The official Sirr client for Python. Provides both synchronous and async clients with optional client-side encryption.

View on GitHub →

Installation

pip install sirr

For async support with httpx:

pip install sirr[async]

Quick Start

from sirr import SirrClient

client = SirrClient(
    base_url="https://sirr.example.com",
    api_key="sirr_lic_...",
)

# Store a secret (expires in 1 hour, max 3 reads)
result = client.create(
    content="database_password=hunter2",
    ttl=3600,
    max_reads=3,
)
print(f"Secret stored: {result.id}")

# Retrieve the secret
secret = client.get(result.id)
print(f"Content: {secret.content}")

# Delete early
client.delete(result.id)

Try it live

Click Run to execute this example against a real Sirr instance. The secret is created, read, and deleted in real‑time.

Python
from sirr import SirrClient

client = SirrClient(
    base_url="https://sirr.secretdrop.app",
)

# Store a secret (expires in 5 min, max 3 reads)
result = client.create(
    content="Hello from the Sirr sandbox!",
    ttl=300,
    max_reads=3,
)
print(f"Secret stored: {result.id}")

# Retrieve the secret
secret = client.get(result.id)
print(f"Content: {secret.content}")

# Delete early
client.delete(result.id)
print("Secret deleted")

Async Usage

Use the async client for non-blocking I/O in asyncio applications, FastAPI, or Django async views.

from sirr import AsyncSirrClient

async def main():
    client = AsyncSirrClient(
        base_url="https://sirr.example.com",
        api_key="sirr_lic_...",
    )

    result = await client.create(
        content="async-secret-value",
        ttl=600,
    )

    secret = await client.get(result.id)
    print(secret.content)

Client-Side Encryption

Enable client-side encryption so the server never sees plaintext. Requires the cryptography package (installed automatically).

client = SirrClient(
    base_url="https://sirr.example.com",
    api_key="sirr_lic_...",
    encryption=True,
)

# Content is encrypted before leaving your machine
result = client.create(content="top-secret-value", ttl=600)

# Share id and key separately — both are needed to decrypt
secret = client.get(result.id, key=result.key)
print(secret.content)  # "top-secret-value"

Requirements

  • Python 3.9+
  • httpx for async support (optional)
  • cryptography for client-side encryption (auto-installed)

Contribute

The Python SDK is open source under the MIT license. Bug reports, feature requests, and pull requests are welcome.

github.com/SirrVault/sirr-python →