odmantic
ODMantic, an AsyncIO MongoDB Object Document Mapper for Python using type hints
Decision gist · record as of 2026-08-14
Yes. ODMantic is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real problem for Python developers using MongoDB with async frameworks. The ISC license is permissive. Install it if you need an async MongoDB ODM with strong type safety and Pydantic integration.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a running MongoDB instance (4.0 or later) and Python 3.8 or later.
- Async operations require an event loop context.
- Low friction install with a pure-Python wheel.
License · maintenance · safety
permissive license (permissive) — Licensed under ISC (permissive), allowing commercial and private use with minimal restrictions.
last release 2026-01-24 (202 days) · last repo commit 2026-05-19 · 1,175 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 111,772 downloads/mo, #12,399 on PyPI
Alternatives
Verify before relying
pip install odmantic
from odmantic import Model, Field, AIOEngine
from typing import Optional
class Publisher(Model):
name: str
founded: int = Field(ge=1440)
location: Optional[str] = None
engine = AIOEngine()
await engine.save_all([Publisher(name="Test", founded=2000)])
results = await engine.find(Publisher, Publisher.founded >= 2000)- Whether Pydantic 2.5+ is strictly required or if earlier 2.x versions work.
- Performance characteristics and scalability limits for large document collections.
- Completeness of query operator support compared to raw PyMongo.
What it is and what it does
ODMantic bridges Python type hints and MongoDB by letting you define models as Pydantic classes, then use those classes to query, insert, update, and delete documents with full type safety and validation. It wraps motor (the async MongoDB driver) and pymongo, supporting both async/await patterns (ideal for ASGI frameworks like FastAPI) and synchronous code.
You define a model by subclassing Model and annotating fields with Python types; ODMantic handles collection naming, field validation via Pydantic, and automatic _id generation. Queries use Python comparison operators (e.g., `Publisher.founded <= 2000`) rather than MongoDB query syntax, and the engine provides methods like `find()`, `find_one()`, `save()`, and `save_all()` to perform database operations. Built-in JSON serialization and schema generation are included.
Use it for
- Build FastAPI or Starlette applications with async MongoDB persistence using type-hinted models.
- Define MongoDB schemas with Pydantic validation to catch invalid data before it reaches the database.
- Query MongoDB collections using Python operators instead of MongoDB query syntax.
- Migrate from synchronous ORMs to async-first code without rewriting model definitions.
- Generate JSON schemas and API documentation automatically from your ODMantic models.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
ODMantic is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real problem for Python developers using MongoDB with async frameworks. The ISC license is permissive. Install it if you need an async MongoDB ODM with strong type safety and Pydantic integration.
Install
odmantic on PyPI
Before you install
Low friction install with a pure-Python wheel. Actively maintained as of 2026-05-19 with 1175 repository stars. Depends on pydantic, motor, pymongo, and typing-extensions—all stable, widely-used libraries.
Requires a running MongoDB instance (4.0 or later) and Python 3.8 or later. Async operations require an event loop context.
License in practice
Licensed under ISC (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install odmantic
from odmantic import Model, Field, AIOEngine
from typing import Optional
class Publisher(Model):
name: str
founded: int = Field(ge=1440)
location: Optional[str] = None
engine = AIOEngine()
await engine.save_all([Publisher(name="Test", founded=2000)])
results = await engine.find(Publisher, Publisher.founded >= 2000)
Verify before relying
- Whether Pydantic 2.5+ is strictly required or if earlier 2.x versions work.
- Performance characteristics and scalability limits for large document collections.
- Completeness of query operator support compared to raw PyMongo.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagespydantictyping-extensionsmotorpymongo |
| Maintenance | Actively maintained 202 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 111,772 / month, #12,399 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 :: AsyncIOFramework :: PydanticFramework :: Pydantic :: 2Intended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: ISC License (ISCL)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTopic :: Database :: Front-EndsTopic :: InternetTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Object BrokeringTyping :: Typed |
Evidence: odmantic-1.1.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 › “python mongodb object mapper”
- odmanticODMantic is an async-first Object Document Mapper for MongoDB that…
- beanieBeanie is an asynchronous Python object-document mapper for MongoDB…
- mongoengineMongoEngine provides an Object-Document Mapper (ODM) layer on top of…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also beanie · pydantic-mongo · mongoengine · maggma · pymongo · Flask-PyMongo · mongomock-motor · motor · pymongo_inmemory · ormar