tortoise-orm
Easy async ORM for python, built with relations in mind
Decision gist · record as of 2026-08-14
Yes. Tortoise ORM is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively under Apache-2.0. It is a solid choice for async Python projects that need to work with relational databases and want a Django-like API. Install it if you are building async applications and prefer ORM abstraction over raw SQL; skip it if you need synchronous database access or prefer a different query style.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; database-specific drivers (aiosqlite, asyncpg, aiomysql, etc.) must be installed separately via extras (e.g., pip install tortoise-orm[asyncpg]).
- Low friction installation with a pure-Python wheel.
- Active maintenance with a recent release and 5609 repository stars.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most projects.
last release 2026-08-10 (4 days) · last repo commit 2026-08-13 · 5,609 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 636,466 downloads/mo, #5,626 on PyPI
Alternatives
Verify before relying
pip install tortoise-orm
from tortoise import Tortoise, fields
from tortoise.models import Model
class User(Model):
id = fields.IntField(primary_key=True)
name = fields.CharField(max_length=20)
await Tortoise.init(
db_url='sqlite://db.sqlite3',
modules={'models': ['__main__']}
)
await Tortoise.generate_schemas()
user = await User.create(name='Alice')
print(user.name)- Performance characteristics and overhead compared to raw SQL or other async ORMs in production workloads.
- Maturity of migration system and real-world experience with complex schema evolution.
- Community size and availability of third-party extensions or integrations beyond documented frameworks.
What it is and what it does
Tortoise ORM is an async-native Object-Relational Mapper inspired by Django, designed to let developers work with relational databases using Python objects instead of raw SQL. It abstracts database interactions across SQLite, MySQL, PostgreSQL, Microsoft SQL Server, and Oracle, reducing boilerplate, preventing SQL injection through parameterized queries, and centralizing schema definitions. The package is built on asyncio and integrates with async frameworks.
You define models by inheriting from tortoise.models.Model, then initialize Tortoise to establish relationships and connect to your database. Once initialized, you can create, filter, and query records using async methods like .create(), .filter(), and .prefetch_related(). The package includes a built-in migration CLI for version-controlled schema changes, and supports complex operations like many-to-many relationships, nested prefetching, and filtering across related models.
Use it for
- Building async web APIs where you need to query databases without blocking the event loop.
- Defining and managing relational schemas with version-controlled migrations in production applications.
- Reducing SQL boilerplate in projects that work with multiple database backends (PostgreSQL, MySQL, SQLite, Oracle).
- Implementing complex queries involving foreign keys, many-to-many relationships, and nested filtering across related models.
- Preventing SQL injection vulnerabilities by using parameterized queries through an ORM abstraction layer.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Tortoise ORM is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively under Apache-2.0. It is a solid choice for async Python projects that need to work with relational databases and want a Django-like API. Install it if you are building async applications and prefer ORM abstraction over raw SQL; skip it if you need synchronous database access or prefer a different query style.
Install
tortoise-orm on PyPI
Before you install
Low friction installation with a pure-Python wheel. Active maintenance with a recent release and 5609 repository stars. Supports CPython 3.10 and later across multiple platforms.
Requires Python 3.10 or later; database-specific drivers (aiosqlite, asyncpg, aiomysql, etc.) must be installed separately via extras (e.g., pip install tortoise-orm[asyncpg]).
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install tortoise-orm
from tortoise import Tortoise, fields
from tortoise.models import Model
class User(Model):
id = fields.IntField(primary_key=True)
name = fields.CharField(max_length=20)
await Tortoise.init(
db_url='sqlite://db.sqlite3',
modules={'models': ['__main__']}
)
await Tortoise.generate_schemas()
user = await User.create(name='Alice')
print(user.name)
Verify before relying
- Performance characteristics and overhead compared to raw SQL or other async ORMs in production workloads.
- Maturity of migration system and real-world experience with complex schema evolution.
- Community size and availability of third-party extensions or integrations beyond documented frameworks.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagespypika-tortoiseiso8601aiosqliteanyiotomlkittyping-extensions |
| Maintenance | Actively maintained 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 636,466 / month, #5,626 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaFramework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PL/SQLProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: DatabaseTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: tortoise_orm-1.1.8-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “asyncio database mapper”
- tortoise-ormTortoise ORM is an async-native Object-Relational Mapper for Python…
- odmanticODMantic is an async-first Object Document Mapper for MongoDB that…
- ponyPony is an object-relational mapper that lets you write database…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also aerich · pony · pypika-tortoise · SQLAlchemy · opentelemetry-instrumentation-tortoiseorm · prisma · ormar · async-factory-boy · peewee · databases