yezz123/ormdantic
yezz123/ormdantic has 156 GitHub stars and 4 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-13 05:33 UTC. Last push 2026-11-03.
A Rust-backed async ORM for Python applications that use Pydantic models ✨
Crecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- Recopilando historial
- in 15 days
- Recopilando historial
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalA Rust-backed async ORM for Python applications that use Pydantic models.
| Project | Status |
|---|---|
| CI | |
| Meta |
Ormdantic lets you declare database tables with Pydantic v2 models and run async CRUD, relationship loading, migrations, reflection, and native SQL execution through a Rust-backed runtime.
The project is designed for applications that want Python model ergonomics without giving up SQL database features. Python owns the model and API surface; Rust owns SQL compilation, type conversion, and driver execution.
What you get
| Area | What Ormdantic Provides |
|---|---|
| Models | Pydantic models decorated as database tables. |
| CRUD | Async insert, update, upsert, delete, find, count, and bulk update helpers. |
| Queries | Dictionary filters for ordinary cases and expression objects for advanced SQL. |
| Relationships | Explicit joined and select-in loaders, plus explicit relationship loading. |
| Transactions | Async transaction and session contexts. |
| Migrations | Snapshots, diffs, plans, migration artifacts, history, rollback, repair, and squash helpers. |
| Reflection | Live database inspection for tables, columns, indexes, constraints, schemas, views, sequences, and dialect metadata. |
| Drivers | SQLite, PostgreSQL, MySQL, MariaDB, SQL Server, and Oracle through the native runtime. |
Install
uv add ormdantic
First example
from pydantic import BaseModel, Field
from ormdantic import Ormdantic
db = Ormdantic("sqlite:///app.sqlite3")
@db.table(pk="id", indexed=["name"])
class Flavor(BaseModel):
id: str
name: str = Field(min_length=2, max_length=63)
rating: int = 0
async def main() -> None:
await db.init()
await db[Flavor].insert(Flavor(id="vanilla", name="Vanilla", rating=5))
result = await db[Flavor].find_many(
{"rating": {"gte": 4}},
order_by=["name"],
)
for flavor in result.data:
print(flavor.name)
Learn the project
Start with the documentation when you are new:
- Quick Start walks through the first model, first table, first query, first session, and first migration preview.
- learning Path tells new and advanced readers where to start.
- Concepts explains tables, fields, relationships, querying, loading, sessions, migrations, events, and the native engine.
- Supported Drivers explains SQLite, PostgreSQL, MySQL, MariaDB, SQL Server, and Oracle behavior.
- Examples contains task-focused how-to guides.
- API Documentation documents the Python API with generated references and usage notes.
Migration CLI
Migration commands can read the database URL from --url, an exported
DATABASE_URL, or a local .env file:
export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
uv run ormdantic migrations init
uv run ormdantic migrations apply-dir migrations
uv run ormdantic migrations current
The CLI prints redacted connection details and summaries such as
Applied 2 migrations from migrations. instead of only raw revision IDs.
Development
Common commands:
bash scripts/lint.sh
bash scripts/test.sh
bash scripts/docs_build.sh
The docs use Zensical:
uv run --group docs zensical build
uv run --group docs zensical serve
Rust crates live under rust/crates/ and are managed from the repository root Cargo.toml.
Status
Ormdantic is evolving quickly. Prefer explicit migrations, review generated SQL before applying it in production, and check the driver-specific pages for dialect behavior.
Explorar proyectos relacionados
Asabeneh/30-Days-Of-Python
El reto de programación 30 Days of Python es una guía paso a paso para aprender el lenguaje de programación Python en 30 días. Este reto puede llevar más de 100 días. Sigue tu propio ritmo. Estos vídeos también pueden ayudarte: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,673 estrellasgrafana/grafana
Plataforma abierta y componible de observabilidad y visualización de datos. Visualiza métricas, registros y trazas de múltiples fuentes, como Prometheus, Loki, Elasticsearch, InfluxDB, Postgres y muchas más.
77,876 estrellasredis/redis
Para los desarrolladores que crean aplicaciones en tiempo real basadas en datos, Redis es la opción preferida, la más rápida y la de más funciones como caché, servidor de estructuras de datos y motor de consultas de documentos y vectores.
77,485 estrellasapache/superset
Apache Superset es una plataforma de visualización y exploración de datos.
75,509 estrellas