# art049/odmantic

Sync and Async ODM (Object Document Mapper) for MongoDB based on python type hints

Repository: https://github.com/art049/odmantic
Canonical: https://ross.abutalabs.com/products/odmantic
Homepage: http://art049.github.io/odmantic
Language: Python
License: ISC
License Family: permissive
Topics: mongodb, asyncio, python, object-document-mapper, nosql, pydantic, python-types, type-hints, fastapi, async, mongo, motor, odm, orm, mongodb-orm, database, pymongo, sync
Last push: 2026-05-19T21:43:53+00:00

## Health v2 (maintenance only)
Score: 81/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 83, release rhythm 67, longevity 100
- inputs: {"age_days": 2315, "days_push": 106, "days_rel": 221, "gap_med": 2, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1175, forks 98 (observed 2026-08-28T04:03:52.431988+00:00)

## What it is
ODMantic is a sync and async Object Document Mapper (ODM) for MongoDB built on Python type hints and Pydantic for model definition and validation. It provides a fully typed, functional API for database operations with built-in JSON serialization and JSON schema generation.

## Use cases
- map python classes to mongodb documents with type hints
- use mongodb with fastapi async endpoints
- validate and serialize mongodb documents with pydantic
- query mongodb using python comparison operators
- build a typed data layer for a python backend
- switch between sync and async mongodb access in python

## When to choose
- you use MongoDB with Python and want Pydantic-based models and validation
- you need both sync and async database access in the same codebase
- you want static type checking and autocompletion for database queries
- you're building FastAPI/ASGI applications backed by MongoDB

## When to avoid
- you use a relational database instead of MongoDB
- you need raw MongoDB aggregation pipeline control or advanced features not exposed by the ODM
- your project is locked to Pydantic v1 or Python < 3.8

## Facets
- artifact type: library
- maturity: active
- function: orm, database-driver, serialization
- domain: databases, backend, web-development, developer-tools
- platform: python
- tags: mongodb, odm, pydantic, asyncio, motor, pymongo, fastapi, type-hints, nosql, data-validation

## Member repositories
- art049/odmantic (main) score 81

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:52.431988+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:27:03.827018+00:00, confidence not recorded.
  - readme: https://github.com/art049/odmantic (fetched 2026-08-28T04:03:52.431988+00:00, sha b1231fe82f46)
  - homepage: http://art049.github.io/odmantic (fetched 2026-08-29T12:33:24.435889+00:00, sha 25c48ec3a981)
  - registry_pypi: https://pypi.org/pypi/odmantic/json (fetched 2026-08-29T12:33:24.445289+00:00, sha 7067ef85ac61)
- Data as of 2026-08-30T08:39:29.467469+00:00.
