Python SDK quickstart
Applies to: crittora-sdk-python
Base URL: https://api.crittoraapis.com
Last updated: March 8, 2026
Use this path when your Python backend talks directly to the Crittora API at https://api.crittoraapis.com. The SDK provides typed sync and async clients for new integrations.
What you need
- Python 3.10 or later.
- A trusted backend environment that can securely store credentials and bearer tokens.
- Crittora API credentials: api_key, and optionally access_key and secret_key for privileged backend use.
- Optional Cognito credentials if you want the SDK to perform login.
Installation
pip install crittora-sdk-pythonPreferred setup
For new integrations, construct a CrittoraClient with explicit credentials, auth, and timeout behavior.
from crittora import ApiCredentials, BearerTokenAuth, CrittoraClient, Permission
client = CrittoraClient(
base_url="https://api.crittoraapis.com",
credentials=ApiCredentials(
api_key="api-key",
access_key="access-key",
secret_key="secret-key",
),
auth=BearerTokenAuth("id-token"),
timeout=10.0,
)
result = client.encrypt(
"sensitive data",
permissions=[Permission(partner_id="partner-123", actions=["read"])],
)
print(result.encrypted_data)Built-in Cognito login
If you want the SDK to perform login and hold the returned tokens, use CognitoAuthProvider.
from crittora import CognitoAuthProvider, CognitoConfig, CrittoraClient
auth = CognitoAuthProvider(
CognitoConfig(
user_pool_id="us-east-1_Tmljk4Uiw",
client_id="5cvaao4qgphfp38g433vi5e82u",
)
)
tokens = auth.login(username="username", password="password")
client = CrittoraClient(
base_url="https://api.crittoraapis.com",
auth=auth,
)Async client
Use AsyncCrittoraClient when your service stack is async-first.
from crittora import AsyncCrittoraClient
async with AsyncCrittoraClient(base_url="https://api.crittoraapis.com") as client:
result = await client.encrypt("hello")
print(result.encrypted_data)SDK decision guide
| Option | Use when |
|---|---|
| CrittoraClient | Starting a new sync integration. |
| AsyncCrittoraClient | Your Python service stack is async-first. |
| CognitoAuthProvider | You want the SDK to perform Cognito login for you. |
Integration summary
Direct API
Python
Package: crittora-sdk-python
Base URL: https://api.crittoraapis.com
Repository
The Python SDK has deeper API, auth, and migration docs in its repository.
Open `crittora-sdk-python`