Secryn Python SDK
Python client for the Secryn secrets management API.
Manage projects, secrets, API keys, and team members programmatically.
Installation
pip install secryn
Requires Python 3.10+.
Quick Start
from secryn import SecrynClient
# Connect to your Secryn instance
client = SecrynClient(base_url="https://api.secryn.xyz/api/v1")
# Cookie-based auth
client.auth.login("user@example.com", "password")
# OR API-key-based auth
client = SecrynClient(
base_url="https://api.secryn.xyz/api/v1",
api_key="sc_...",
)
Usage
All API resources are accessible as namespaced sub-objects with full autocompletion support.
Auth
client.auth.login("user@example.com", "password")
client.auth.register("new@example.com", "secure123")
client.auth.logout() # clears session cookies
client.auth.refresh() # extends JWT session
client.auth.forgot_password("user@example.com")
client.auth.reset_password(token, "new-password")
MFA
setup = client.mfa.setup() # returns secret + QR code URL
client.mfa.enable(token)
client.mfa.confirm(token, mfa_token)
client.mfa.recovery(code, mfa_token)
client.mfa.status() # -> {"enabled": True}
codes = client.mfa.recovery_codes() # -> {"codes": ["...", ...]}
client.mfa.send_backup_code("user@example.com")
client.mfa.disable()
Projects
projects = client.projects.list()
project = client.projects.create("My Project", description="Backend secrets")
info = client.projects.get(project_id)
client.projects.update(project_id, name="Renamed")
client.projects.transfer(project_id, new_owner_id)
client.projects.delete(project_id)
Members & Invites
# Invite someone to a project
client.invites.create(project_id, email="dev@team.com")
# Accept an invitation by slug
client.invites.accept("abc123")
# Manage members
client.members.add_permissions(project_id, member_id, ["READ_SECRETS"])
client.members.remove_permissions(project_id, member_id, ["READ_SECRETS"])
client.members.remove(project_id, member_id)
Secrets
# Create, read, update, delete
secret = client.secrets.create(project_id, "API_KEY", "sk-abc123", notes="Production key")
secret = client.secrets.get(secret_id)
secrets = client.secrets.list(project_id)
client.secrets.update(secret_id, value="sk-new-value")
# Export as .env
dotenv = client.secrets.export_dotenv(project_id) # str
with open(".env", "w") as f:
f.write(dotenv)
client.secrets.delete(secret_id)
API Keys
key = client.api_keys.create("CI/CD Pipeline", permissions=["read"])
keys = client.api_keys.list()
client.api_keys.update(key_id, name="CI Pipeline v2")
client.api_keys.delete(key_id)
Users
profile = client.users.me() # authenticated user
user = client.users.get(user_id)
client.users.update(name="New Name", email="new@example.com")
client.users.delete() # deletes authenticated account
Error Handling
from secryn import SecrynApiError
try:
client.secrets.get("nonexistent")
except SecrynApiError as e:
print(e.status_code) # 404
print(e.code) # "NOT_FOUND"
print(e.message) # "Secret not found"
print(e.details) # Optional structured context
Configuration
| Param | Default | Description |
|---|---|---|
base_url |
http://localhost:3000/api/v1 |
API base URL with /api/v1 prefix |
api_key |
None |
Optional API key for programmatic access |
user_agent |
secryn-sdk-python/1.0.0 |
Custom User-Agent header |
License
Apache 2.0 — see LICENSE.
Metadata
Release files for secryn 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| secryn-1.0.1.tar.gz | 14.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| secryn-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.1 kB
Release files / secryn-1.0.1.tar.gz
| Download URL | secryn-1.0.1.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53572062d97b23c99a89c44af83961a4cceb7b3a16f193d688fdd8c8d07985bc
|
|
BLAKE2b-256 checksum How to use checksums |
088f6cc5fb267c4637c1836bf451c3d32f2de2cb01cd994c89ac40fe0494ed39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency logRelease files / secryn-1.0.1-py3-none-any.whl
| Download URL | secryn-1.0.1-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39537f35c3738837ff29d12cb5a6cf44d8d89efc146da06bf605a7e9d0f8ada8
|
|
BLAKE2b-256 checksum How to use checksums |
8e8b8c891b6e90fddb6da608e7714522e20a74ef77699ec03690f953d4ac34ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency log