Skip to main content

Ryx ORM

Django-style Python ORM. Powered by Rust.
Ergonomic query API. Async-native. Zero GIL blocking. Compiled performance.

v0.1.0Python 3.10+PostgreSQLMySQLSQLite
import ryx
from ryx import Model, CharField, IntField, Q, Count, Sum

class Post(Model):
title = CharField(max_length=200)
views = IntField(default=0)
active = BooleanField(default=True)

await ryx.setup("postgres://user:pass@localhost/mydb")

posts = await (
Post.objects
.filter(Q(active=True) | Q(views__gte=1000))
.exclude(title__startswith="Draft")
.order_by("-views")
.limit(20)
)

Why Ryx

Django ORMSQLAlchemyRyx
APIErgonomicVerboseErgonomic
RuntimeSync PythonAsync PythonAsync Rust
GIL blockingYesYesZero
BackendsAllAllPG · MySQL · SQLite
MigrationsBuilt-inAlembicBuilt-in

Features

Architecture

Ryx ORM Architecture

Quick Start

pip install maturin
maturin develop # compile Rust + install
import asyncio, ryx
from ryx import Model, CharField

class Article(Model):
title = CharField(max_length=200)

async def main():
await ryx.setup("sqlite:///app.db")
await ryx.migrate([Article])
await Article.objects.create(title="Hello Ryx")
print(await Article.objects.all())

asyncio.run(main())

What's Next