Skip to main content

High-performance async Python ORM with Rust core

Project description

Logo

Oxyde ORM is a type-safe, Pydantic-centric asynchronous ORM with a high-performance Rust core designed for clarity, speed, and reliability.

Inspired by the elegance of Django's ORM, Oxyde focuses on explicitness over magic, providing a modern developer-friendly workflow with predictable behavior and strong typing throughout.

PyPI Downloads


Heads up! Oxyde is a young project under active development. The API may evolve between minor versions. Feedback, bug reports, and ideas are very welcome. Feel free to open an issue!

Features

  • Django-style API — Familiar Model.objects.filter() syntax
  • Pydantic v2 models — Full validation, type hints, serialization
  • Async-first — Built for modern async Python with asyncio
  • Rust performance — SQL generation and execution in native Rust
  • Multi-database — PostgreSQL, SQLite, MySQL support
  • Transactionstransaction.atomic() context manager with savepoints
  • Migrations — Django-style makemigrations and migrate CLI

Performance

Benchmarks vs popular Python ORMs (avg ops/sec, higher is better):

Database Oxyde Tortoise Piccolo Django SQLAlchemy SQLModel Peewee
PostgreSQL 1,475 888 932 736 445 431 80
MySQL 1,239 794 714 536 505 461
SQLite 2,525 1,882 469 1,294 588 567 548

Full benchmark report: Documentation

Installation

pip install oxyde

Quick Start

1. Initialize Project

oxyde init

This creates oxyde_config.py with your database settings and model paths.

2. Define Models

# models.py
from oxyde import Model, Field

class User(Model):
    id: int | None = Field(default=None, db_pk=True)
    name: str
    email: str = Field(db_unique=True)
    age: int | None = Field(default=None)

    class Meta:
        is_table = True

3. Create Tables

oxyde makemigrations
oxyde migrate

4. Use It

import asyncio
from oxyde import db
from models import User

async def main():
    await db.init(default="sqlite:///app.db")

    # Create
    user = await User.objects.create(name="Alice", email="alice@example.com", age=30)

    # Read
    users = await User.objects.filter(age__gte=18).all()
    user = await User.objects.get(id=1)

    # Update
    user.age = 31
    await user.save()

    # Delete
    await user.delete()

    await db.close()

asyncio.run(main())

Transactions

from oxyde.db import transaction

async with transaction.atomic():
    user = await User.objects.create(name="Alice", email="alice@example.com")
    await Profile.objects.create(user_id=user.id)
    # Auto-commits on success, rolls back on exception

FastAPI Integration

from fastapi import FastAPI
from oxyde import db

app = FastAPI(
    lifespan=db.lifespan(
        default="postgresql://localhost/mydb",
    )
)

@app.get("/users")
async def get_users():
    return await User.objects.filter(is_active=True).all()

Database Support

Database Min Version Status Notes
PostgreSQL 12+ Full RETURNING, UPSERT, FOR UPDATE/SHARE, JSON, Arrays
SQLite 3.35+ Full RETURNING, UPSERT, WAL mode by default
MySQL 8.0+ Full UPSERT via ON DUPLICATE KEY, FOR UPDATE/SHARE

Connection URLs:

postgresql://user:password@localhost:5432/database
sqlite:///path/to/database.db
sqlite:///:memory:
mysql://user:password@localhost:3306/database

Ecosystem

Oxyde Admin

Auto-generated admin panel for Oxyde ORM with zero boilerplate.

  • Automatic CRUD, search, filters, export
  • FastAPI, Litestar, Sanic, Quart, Falcon
  • Theming, authentication, bulk operations
pip install oxyde-admin

GitHub →

Documentation

Full documentation: https://oxyde.fatalyst.dev/

Contributing

If you have suggestions or find a bug, please open an issue or create a pull request on GitHub.

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oxyde-0.7.0.tar.gz (104.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oxyde-0.7.0-py3-none-any.whl (127.5 kB view details)

Uploaded Python 3

File details

Details for the file oxyde-0.7.0.tar.gz.

File metadata

  • Download URL: oxyde-0.7.0.tar.gz
  • Upload date:
  • Size: 104.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for oxyde-0.7.0.tar.gz
Algorithm Hash digest
SHA256 3e20fb68250a9a80e1ecb24d17347d32f4e38c0b43217570dab2af49f1763d74
MD5 1b71d3cc27beb5a96608fa26ac126f33
BLAKE2b-256 9d6ed6a9ed302db2602ef8708dc27f94413a342ffaae6e7df7ea12824360d736

See more details on using hashes here.

File details

Details for the file oxyde-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: oxyde-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 127.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for oxyde-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67bfaab16d1bfdb6a978b7896ccaec33b1e8a2eb9da974bcfb08d6b95eda9f5c
MD5 0a70e5aab1ca30400061fb792772a8f4
BLAKE2b-256 730f8f86d4ab34fd352a3c111705806fef31204916f50974431c9cbb3a83bec9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page