ormar
An async ORM with fastapi in mind and pydantic validation.
Decision gist · record as of 2026-08-14
Yes, if you are building async Python applications with FastAPI or similar frameworks and want to reduce schema duplication. The package is actively maintained, has no known vulnerabilities, and low install friction. The beta status reflects ongoing development rather than instability—it has been in active use since 2020 and receives regular updates. Pin the version (e.g., ormar~=0.26.0) as recommended, and read release notes before upgrading since major version changes introduce breaking changes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Async operations must be awaited within an async context (e.g., inside an async function or FastAPI route handler).
- Low friction installation with a pure-Python wheel.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions. The package is explicitly open-source and free, with the maintainer accepting sponsorship but making no license-based demands.
last release 2026-06-08 (67 days) · last repo commit 2026-08-14 · 1,804 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 305,692 downloads/mo, #7,792 on PyPI
Alternatives
Verify before relying
import ormar
import sqlalchemy
DATABASE_URL = "sqlite+aiosqlite:///db.sqlite"
base_config = ormar.OrmarConfig(
database=ormar.DatabaseConnection(DATABASE_URL),
metadata=sqlalchemy.MetaData(),
)
class Author(ormar.Model):
ormar_config = base_config.copy(tablename="authors")
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=100)- Whether the package's beta status (Development Status :: 4 - Beta) indicates stability concerns or is simply conservative labeling.
- Performance characteristics when working with large result sets or complex queries.
- How well migration tooling (alembic integration) handles schema evolution in production.
What it is and what it does
Ormar is an async ORM built on SQLAlchemy core that lets you define a single model class that serves both as a database schema definition and as a pydantic validation schema. This eliminates the common pattern of maintaining separate ORM models and request/response validation schemas. It supports Postgres, MySQL, and SQLite through async drivers, making it a natural fit for async web frameworks like FastAPI and Starlette.
The package integrates pydantic's validation layer directly into the ORM, so your model fields are both database columns and validated request/response fields. You define relationships, constraints, and field types once, then use the same model class for database queries, API request bodies, and API responses. It handles async database operations throughout—queries, inserts, updates, and relationship loading all use await syntax.
Use it for
- Build FastAPI applications where the same model class validates incoming requests and represents database records.
- Create async web services that need to query Postgres, MySQL, or SQLite without maintaining parallel pydantic and ORM schemas.
- Migrate existing SQLAlchemy projects to async using the sqlalchemy-to-ormar translation tool.
- Define relationships and foreign keys in a single model that automatically works as both ORM and API schema.
- Use with fastapi-crudrouter or fastapi-pagination for automatic CRUD endpoints and pagination support.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building async Python applications with FastAPI or similar frameworks and want to reduce schema duplication.
The package is actively maintained, has no known vulnerabilities, and low install friction. The beta status reflects ongoing development rather than instability—it has been in active use since 2020 and receives regular updates. Pin the version (e.g., ormar~=0.26.0) as recommended, and read release notes before upgrading since major version changes introduce breaking changes.
Install
ormar on PyPI
Before you install
Low friction installation with a pure-Python wheel. The package is actively maintained with a recent release and no known vulnerabilities. It depends on four runtime packages (SQLAlchemy, orjson, ormar-utils, pydantic) that are themselves well-established.
Requires Python 3.10 or later. Async operations must be awaited within an async context (e.g., inside an async function or FastAPI route handler).
License in practice
MIT license permits commercial and private use with minimal restrictions. The package is explicitly open-source and free, with the maintainer accepting sponsorship but making no license-based demands.
Quickstart
import ormar
import sqlalchemy
DATABASE_URL = "sqlite+aiosqlite:///db.sqlite"
base_config = ormar.OrmarConfig(
database=ormar.DatabaseConnection(DATABASE_URL),
metadata=sqlalchemy.MetaData(),
)
class Author(ormar.Model):
ormar_config = base_config.copy(tablename="authors")
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=100)
Verify before relying
- Whether the package's beta status (Development Status :: 4 - Beta) indicates stability concerns or is simply conservative labeling.
- Performance characteristics when working with large result sets or complex queries.
- How well migration tooling (alembic integration) handles schema evolution in production.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0.0,>=3.10.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesSQLAlchemyorjsonormar-utilspydantic |
| Maintenance | Actively maintained 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 305,692 / month, #7,792 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP |
Evidence: ormar-0.26.0-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 › “pydantic ORM”
- ormarAn async ORM for Python that unifies database models with pydantic…
- sqlmodelSQLModel combines SQLAlchemy and Pydantic to let you define SQL…
- dyntasticDyntastic is a DynamoDB object-relational mapper built on Pydantic…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also ormar-utils · sqlmodel · fastcrud · databases · fastapi-users-db-sqlalchemy · tortoise-orm · prisma · FastAPI-SQLAlchemy · piccolo · async-factory-boy