Early access — founding teams get the Free tier locked in permanently.
Sirr is in public beta — APIs may change before 1.0
← 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://sirrlock.com",
    api_key="sirr_lic_...",
)

# Public dead drop (value only, returns id + url)
result = client.push("database_password=hunter2", ttl=3600, max_reads=3)
print(f"Share URL: {result.url}")

# Org named secret
client.set("DB_URL", "postgres://...", org="myteam", ttl=3600)

# Retrieve by ID (public) or key (org)
secret = client.get(result.id)
print(f"Value: {secret.value}")

# 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.sirrlock.com",
)

# Push a secret (expires in 5 min, max 3 reads)
result = client.push(
    "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"Value: {secret.value}")

# 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://sirrlock.com",
        api_key="sirr_lic_...",
    )

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

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

Client-Side Encryption

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

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

# Content is encrypted before leaving your machine
result = client.push("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.value)  # "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/sirrlock/sirr-python →