This release is a pre-release and may not be stable for production use.
Autonoma Python SDK
Python implementation of the Autonoma Environment Factory SDK.
Package
| Package | Description |
|---|---|
autonoma-ai |
Core protocol (HMAC, refs, graph, handler) |
autonoma-ai[sqlalchemy] |
SQLAlchemy executor adapter |
autonoma-ai[django] |
Django executor adapter and server handler |
autonoma-ai[flask] |
Flask server adapter |
autonoma-ai[fastapi] |
FastAPI server adapter |
autonoma-ai[postgres] |
PostgreSQL driver (psycopg2) |
autonoma-ai[all] |
All adapters and drivers |
Quick Start
Install
pip install autonoma-ai
# With extras:
pip install "autonoma-ai[sqlalchemy,fastapi,postgres]"
# Or everything:
pip install "autonoma-ai[all]"
FastAPI + SQLAlchemy
from autonoma.types import HandlerConfig
from autonoma_fastapi import create_fastapi_handler
from autonoma_sqlalchemy import sqlalchemy_executor
from sqlalchemy import create_engine
engine = create_engine("postgresql://user:pass@localhost/mydb")
config = HandlerConfig(
executor=sqlalchemy_executor(engine),
scope_field="organization_id",
shared_secret="your-shared-secret",
signing_secret="your-signing-secret",
auth=lambda user, context: {
"headers": {"Authorization": f"Bearer {create_session_token(user['id'])}"}
},
)
router = create_fastapi_handler(config)
app.include_router(router, prefix="/api/autonoma")
Model name ↔ table name
By default, the SDK derives a model name from each SQL table by splitting on _ and PascalCasing each part — no pluralization. Examples:
| SQL table | Auto-derived model name |
|---|---|
user |
User |
api_key |
ApiKey |
branch_deployment |
BranchDeployment |
organizations |
Organizations (stays plural) |
api_keys |
ApiKeys (stays plural) |
If every factory you register is keyed under the auto-derived name, omit table_name_map entirely. The SDK handles the mapping.
You only need table_name_map when a factory key disagrees with the auto-derived name. Common reasons:
- Your tables are plural but you want singular factory keys:
organizationstable ↔Organizationkey. - Legacy short names:
usrtable ↔Userkey,acltable ↔AccessControlkey.
The map is sparse, not exhaustive: only list entries that actually differ. Auto-derivation covers the rest.
# Tables in DB: organization, user, api_key, deal (singular)
# Factories keyed: Organization, User, ApiKey, Deal
# table_name_map = None # auto-derive is exact; omit the kwarg
# Tables in DB: organizations, users, api_keys
# Factories keyed singular → every entry disagrees:
config = HandlerConfig(
...,
table_name_map={
"Organization": "organizations",
"User": "users",
"ApiKey": "api_keys",
},
factories={"Organization": ..., "User": ..., "ApiKey": ...},
)
Red flag: if your table_name_map has one entry per factory and every entry is just a plural↔singular rename, consider keeping factory keys plural (Organizations) and dropping the map entirely. Plural keys are valid — pick whichever convention your scenarios use.
Commands
poetry install --all-extras # install with all adapters
poetry run pytest # run tests
poetry run pytest -k "sqlalchemy" # tests matching pattern
Documentation
For protocol-level documentation, see the root protocol/ directory. For runnable examples, see examples/python/.
Metadata
Release files for autonoma-ai 0.2.1.dev1777448671
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| autonoma_ai-0.2.1.dev1777448671.tar.gz | 29.8 kB | With provenance | Details for autonoma_ai-0.2.1.dev1777448671.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| autonoma_ai-0.2.1.dev1777448671-py3-none-any.whl | Python 3 | none | any | Details for autonoma_ai-0.2.1.dev1777448671-py3-none-any.whl |
Total release size: 68.1 kB
Release files / autonoma_ai-0.2.1.dev1777448671.tar.gz
| Download URL | autonoma_ai-0.2.1.dev1777448671.tar.gz |
|---|---|
| Size | 29.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee19867ae07dd03f296b1eec4d20644c275ca77216dcd863617f1dcf3ec003d5
|
|
BLAKE2b-256 checksum How to use checksums |
53a2f75077314aba0192245d75662efa4664eba769f504cf541e8a80f887f09a
|
| 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 Apr 29, 2026.
Transparency logRelease files / autonoma_ai-0.2.1.dev1777448671-py3-none-any.whl
| Download URL | autonoma_ai-0.2.1.dev1777448671-py3-none-any.whl |
|---|---|
| Size | 38.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e86eacd0e182125758be7f47b030020878af04570de2f4d505bb511e6b2f27b9
|
|
BLAKE2b-256 checksum How to use checksums |
86014d0c3c539f6472a5d1ce0cdcf7d4836dba089f228146af4caa168318cc8c
|
| 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 Apr 29, 2026.
Transparency logSecurity for autonoma-ai 0.2.1.dev1777448671
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for autonoma_ai-0.2.1.dev1777448671.tar.gz
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 Apr 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.