{"repo":"art049/odmantic","free":true,"listed":false,"github":"https://github.com/art049/odmantic","clone":"git clone https://github.com/art049/odmantic.git","description":"Sync and Async ODM (Object Document Mapper) for MongoDB based on python type hints","language":"Python","stars":1175,"topics":["mongodb","asyncio","python","object-document-mapper","nosql","pydantic","python-types","type-hints","fastapi","async"],"license":"ISC","category":"databases-storage","readme_excerpt":"ODMantic --- Documentation : https://art049.github.io/odmantic/ --- Sync and Async ODM (Object Document Mapper) for MongoDB based on standard Python type hints. Built on top of Pydantic for model definition and validation. Core features: - Simple : define your model by typing your fields using Python types, build queries using Python comparison operators - Developer experience : field/method autocompletion, type hints, data validation, performing database operations with a functional API - Fully typed : leverage static analysis to reduce runtime issues - AsyncIO support : works well with ASGI frameworks ( FastAPI , quart , sanic , Starlette , ...) but works also perfectly in synchronous environments - Serialization : built-in JSON serialization and JSON schema generation Requirements Python : 3.8 and later (tested against 3.8, 3.9, 3.10 and 3.11) Pydantic : 2.5 and later MongoDB : 4.0 and later Installation Example To enjoy an async context without any code boilerplate, you can reproduce the following steps using the AsyncIO REPL (only for Python 3.8+). If you are using an earlier version of Python, you can use href=\"https://ipython.readthedocs.io/en/stable/install/index.html\" target=\" blank\" IPython which provide an Autoawait feature (starting from Python 3.6). Define your first model By defining the Publisher class, we've just created an ODMantic model 🎉. In this example, the model will represent book publishers. This model contains three fields: - name : This is the name ","default_branch":null,"files":null,"tree":[],"storefront":"/r/art049","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/art049/odmantic/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}