Narabi
Narabi is an async Active Record library for Python. Declare a model with ordinary type annotations, then create, query, and update rows through that model. Use SQLite for a local project or PostgreSQL for a service.
from narabi import Increment, Primary, table
@table
class Book:
id: Primary[int] = Increment()
title: str
book = await Book.create(title="A Wizard of Earthsea")
saved = await Book.require(book.id)
The example assumes a project scaffolded with narabi init and a migrated books table. Narabi infers books from Book. The bookstore tutorial builds both from a clean directory.
Privacy belongs in the model
A bookstore needs a customer's contact details. Its logs and JSON responses rarely need all of them.
from narabi import Personal, Private, Sensitive, record
@record
class CustomerContact:
email: Personal[str]
access_token: Private[Sensitive[str]]
contact = CustomerContact(email="reader@example.test", access_token="demo-token")
print(contact)
# CustomerContact(email=<redacted>, access_token=<redacted>)
print(contact.to_dict())
# {'email': 'reader@example.test'}
All three markers redact values in record representations. Private also omits the field from default serialization. narabi privacy inventory lists classifications from configured models without reading stored rows. If the record lives in a configured module named models, the inventory includes:
models.CustomerContact.email: Personal
models.CustomerContact.access_token: Private, Sensitive
See Privacy and serialization.
From a model to a running app
- Generate an editable Python migration, review the changes, and apply it. Render SQL offline or load a versioned schema snapshot. Migration workflows
- Compose queries, load associations, and inspect SQL and query plans. API reference
- Try a write in
narabi console --sandboxand see it in the next cell. Exit to roll it back. Console guide - Use the same models in a FastAPI app or a Flask app.
How it fits
| Library | Where persistence lives |
|---|---|
| Narabi | Async operations on Python models, with a Database for connections and explicit transactions |
| Rails Active Record | Persistence and queries on Ruby models within the Rails conventions |
| SQLModel | Typed Python models based on Pydantic and SQLAlchemy, with persistence through a session |
| SQLAlchemy ORM | Mapped Python classes, SQL expressions, and a session that manages a unit of work |
Compare the same bookstore operations · Why Narabi exists · Documentation · Contributing
Narabi is released under the BSD 3-Clause License.
Metadata
Release files for narabi-orm 0.1.0
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 |
|---|---|---|---|---|
| narabi_orm-0.1.0.tar.gz | 193.0 kB | With provenance | Details for narabi_orm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| narabi_orm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for narabi_orm-0.1.0-py3-none-any.whl |
Total release size: 281.7 kB
Release files / narabi_orm-0.1.0.tar.gz
| Download URL | narabi_orm-0.1.0.tar.gz |
|---|---|
| Size | 193.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
932794ce5ddb43c598b67023fe184396668d6100259ab3a914d1b6b3853b0686
|
|
BLAKE2b-256 checksum How to use checksums |
a47ed6c5137f46256cb80f6adc09e4057d1082aeb1de537e5016d4edb58636cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 29, 2026.
Transparency logRelease files / narabi_orm-0.1.0-py3-none-any.whl
| Download URL | narabi_orm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 88.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c158dd3d5e7c2c04174249975a94a2c693c99a660c96a1fdb33e451c1c131996
|
|
BLAKE2b-256 checksum How to use checksums |
f0e06e0b10c65bfbeb2e8e172de2ead405603391642a342c7405fa48683d4690
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 29, 2026.
Transparency logSecurity for narabi-orm 0.1.0
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
Both files in this release have been uploaded with provenance metadata.
Attestation for narabi_orm-0.1.0.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 Nov 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.