{"id":13480798,"url":"https://github.com/Scille/umongo","last_synced_at":"2025-03-27T11:30:55.372Z","repository":{"id":38419655,"uuid":"53513600","full_name":"Scille/umongo","owner":"Scille","description":"sync/async MongoDB ODM, yes.","archived":false,"fork":false,"pushed_at":"2024-04-30T10:50:33.000Z","size":1552,"stargazers_count":449,"open_issues_count":51,"forks_count":64,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-21T15:13:00.484Z","etag":null,"topics":["asyncio","mongodb","odm","python3","twisted"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Scille.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-09T16:34:42.000Z","updated_at":"2025-02-11T10:38:03.000Z","dependencies_parsed_at":"2024-06-20T13:08:47.978Z","dependency_job_id":null,"html_url":"https://github.com/Scille/umongo","commit_stats":{"total_commits":678,"total_committers":19,"mean_commits":35.68421052631579,"dds":0.6179941002949852,"last_synced_commit":"1b23dc7155448a52fa6e7f3d7da6621632e259f5"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scille%2Fumongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scille%2Fumongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scille%2Fumongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scille%2Fumongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Scille","download_url":"https://codeload.github.com/Scille/umongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245835943,"owners_count":20680296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","mongodb","odm","python3","twisted"],"created_at":"2024-07-31T17:00:45.127Z","updated_at":"2025-03-27T11:30:55.044Z","avatar_url":"https://github.com/Scille.png","language":"Python","funding_links":[],"categories":["Python","Libraries","Database Clients"],"sub_categories":["Python"],"readme":"======================\nμMongo: sync/async ODM\n======================\n\n.. image:: https://img.shields.io/pypi/v/umongo.svg\n    :target: https://pypi.python.org/pypi/umongo\n    :alt: Latest version\n\n.. image:: https://img.shields.io/pypi/pyversions/umongo.svg\n    :target: https://pypi.org/project/umongo/\n    :alt: Python versions\n\n.. image:: https://img.shields.io/badge/marshmallow-3-blue.svg\n    :target: https://marshmallow.readthedocs.io/en/latest/upgrading.html\n    :alt: marshmallow 3 only\n\n.. image:: https://img.shields.io/pypi/l/umongo.svg\n    :target: https://umongo.readthedocs.io/en/latest/license.html\n    :alt: License\n\n.. image:: https://dev.azure.com/lafrech/umongo/_apis/build/status/Scille.umongo?branchName=master\n    :target: https://dev.azure.com/lafrech/umongo/_build/latest?definitionId=1\u0026branchName=master\n    :alt: Build status\n\n.. image:: https://readthedocs.org/projects/umongo/badge/\n        :target: http://umongo.readthedocs.io/\n        :alt: Documentation\n\nμMongo is a Python MongoDB ODM. It inception comes from two needs:\nthe lack of async ODM and the difficulty to do document (un)serialization\nwith existing ODMs.\n\nFrom this point, μMongo made a few design choices:\n\n- Stay close to the standards MongoDB driver to keep the same API when possible:\n  use ``find({\"field\": \"value\"})`` like usual but retrieve your data nicely OO wrapped !\n- Work with multiple drivers (PyMongo_, TxMongo_, motor_asyncio_ and mongomock_ for the moment)\n- Tight integration with Marshmallow_ serialization library to easily\n  dump and load your data with the outside world\n- i18n integration to localize validation error messages\n- Free software: MIT license\n- Test with 90%+ coverage ;-)\n\n.. _PyMongo: https://api.mongodb.org/python/current/\n.. _TxMongo: https://txmongo.readthedocs.org/en/latest/\n.. _motor_asyncio: https://motor.readthedocs.org/en/stable/\n.. _mongomock: https://github.com/vmalloc/mongomock\n.. _Marshmallow: http://marshmallow.readthedocs.org\n\nµMongo requires MongoDB 4.2+ and Python 3.7+.\n\nQuick example\n\n.. code-block:: python\n\n    import datetime as dt\n    from pymongo import MongoClient\n    from umongo import Document, fields, validate\n    from umongo.frameworks import PyMongoInstance\n\n    db = MongoClient().test\n    instance = PyMongoInstance(db)\n\n    @instance.register\n    class User(Document):\n        email = fields.EmailField(required=True, unique=True)\n        birthday = fields.DateTimeField(validate=validate.Range(min=dt.datetime(1900, 1, 1)))\n        friends = fields.ListField(fields.ReferenceField(\"User\"))\n\n        class Meta:\n            collection_name = \"user\"\n\n    # Make sure that unique indexes are created\n    User.ensure_indexes()\n\n    goku = User(email='goku@sayen.com', birthday=dt.datetime(1984, 11, 20))\n    goku.commit()\n    vegeta = User(email='vegeta@over9000.com', friends=[goku])\n    vegeta.commit()\n\n    vegeta.friends\n    # \u003cobject umongo.data_objects.List([\u003cobject umongo.dal.pymongo.PyMongoReference(document=User, pk=ObjectId('5717568613adf27be6363f78'))\u003e])\u003e\n    vegeta.dump()\n    # {id': '570ddb311d41c89cabceeddc', 'email': 'vegeta@over9000.com', friends': ['570ddb2a1d41c89cabceeddb']}\n    User.find_one({\"email\": 'goku@sayen.com'})\n    # \u003cobject Document __main__.User({'id': ObjectId('570ddb2a1d41c89cabceeddb'), 'friends': \u003cobject umongo.data_objects.List([])\u003e,\n    #                                 'email': 'goku@sayen.com', 'birthday': datetime.datetime(1984, 11, 20, 0, 0)})\u003e\n\nGet it now::\n\n    $ pip install umongo           # This installs umongo with pymongo\n    $ pip install my-mongo-driver  # Other MongoDB drivers must be installed manually\n\nOr to get it along with the MongoDB driver you're planing to use::\n\n    $ pip install umongo[motor]\n    $ pip install umongo[txmongo]\n    $ pip install umongo[mongomock]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FScille%2Fumongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FScille%2Fumongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FScille%2Fumongo/lists"}