Tortoise ORM offers a Django-like asyncio ORM for Python with models, relations, and drivers for SQLite, PostgreSQL, MySQL, SQL Server, and Oracle.
Overview
Tortoise ORM brings asynchronous database access to Python applications with an API modeled after Django's models and fields. Developers define Model classes, declare foreign keys and many-to-many relations, initialize connections with Tortoise.init, and run async queries inside asyncio programs.
The project supports CPython 3.10 and later across several SQL backends, with optional extras for drivers such as asyncpg, psycopg, aiomysql, asyncmy, and asyncodbc. Schema generation helpers exist for development, while migrations are recommended for production deployments.
Benchmark materials in the documentation compare read and write throughput against other Python ORMs on PostgreSQL. Tortoise emphasizes parameterized queries to reduce injection risk and centralizes relationship definitions for maintainability.
Integrations with web frameworks such as FastAPI and Sanic are documented, along with helper utilities like run_async for small scripts. It is intended as an embeddable persistence layer rather than a standalone server.
Key features
- Asyncio-native model definitions
- Django-style fields and relations
- SQLite, PostgreSQL, and MySQL drivers
- SQL Server and Oracle support
- Schema generation for development
- Migration tooling for production
- FastAPI and Sanic integration docs
- Benchmarked PostgreSQL performance
Use cases
- Async Python web application backends
- Migrating Django-like patterns to asyncio
- Lightweight ORM prototypes on SQLite
- Services needing multi-database drivers