{"id":13480784,"url":"https://github.com/MongoEngine/mongoengine","last_synced_at":"2025-03-27T11:30:54.460Z","repository":{"id":2637778,"uuid":"3626679","full_name":"MongoEngine/mongoengine","owner":"MongoEngine","description":"A Python Object-Document-Mapper for working with MongoDB","archived":false,"fork":false,"pushed_at":"2024-10-09T06:18:06.000Z","size":9597,"stargazers_count":4297,"open_issues_count":339,"forks_count":1236,"subscribers_count":135,"default_branch":"master","last_synced_at":"2025-03-20T03:08:36.303Z","etag":null,"topics":["hacktoberfest","mongo","mongodb","mongodb-orm","odm","orm","pymongo","python"],"latest_commit_sha":null,"homepage":"http://mongoengine.org","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/MongoEngine.png","metadata":{"files":{"readme":"README.rst","changelog":null,"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","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-03-05T12:10:20.000Z","updated_at":"2025-03-18T21:49:02.000Z","dependencies_parsed_at":"2023-07-05T18:49:12.784Z","dependency_job_id":"f0d990b7-2b8a-477f-a78d-47d2d693b08d","html_url":"https://github.com/MongoEngine/mongoengine","commit_stats":{"total_commits":3153,"total_committers":404,"mean_commits":7.804455445544554,"dds":0.7202664129400571,"last_synced_commit":"75e7779f36ffd2826d55bc9b0cb5a365dbfcf1d5"},"previous_names":[],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MongoEngine%2Fmongoengine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MongoEngine%2Fmongoengine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MongoEngine%2Fmongoengine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MongoEngine%2Fmongoengine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MongoEngine","download_url":"https://codeload.github.com/MongoEngine/mongoengine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090880,"owners_count":20559296,"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":["hacktoberfest","mongo","mongodb","mongodb-orm","odm","orm","pymongo","python"],"created_at":"2024-07-31T17:00:44.965Z","updated_at":"2025-03-27T11:30:54.439Z","avatar_url":"https://github.com/MongoEngine.png","language":"Python","readme":"===========\nMongoEngine\n===========\n:Info: MongoEngine is an ORM-like layer on top of PyMongo.\n:Repository: https://github.com/MongoEngine/mongoengine\n:Author: Harry Marr (http://github.com/hmarr)\n:Maintainer: Bastien Gerard (http://github.com/bagerard)\n\n.. image:: https://travis-ci.org/MongoEngine/mongoengine.svg?branch=master\n  :target: https://travis-ci.org/MongoEngine/mongoengine\n\n.. image:: https://coveralls.io/repos/github/MongoEngine/mongoengine/badge.svg?branch=master\n  :target: https://coveralls.io/github/MongoEngine/mongoengine?branch=master\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n  :target: https://github.com/ambv/black\n\n.. image:: https://pepy.tech/badge/mongoengine/month\n  :target: https://pepy.tech/project/mongoengine\n\n.. image:: https://img.shields.io/pypi/v/mongoengine.svg\n  :target: https://pypi.python.org/pypi/mongoengine\n\n\n.. image:: https://readthedocs.org/projects/mongoengine-odm/badge/?version=latest\n  :target: https://readthedocs.org/projects/mongoengine-odm/builds/\n\nAbout\n=====\nMongoEngine is a Python Object-Document Mapper for working with MongoDB.\nDocumentation is available at https://mongoengine-odm.readthedocs.io - there\nis currently a `tutorial \u003chttps://mongoengine-odm.readthedocs.io/tutorial.html\u003e`_,\na `user guide \u003chttps://mongoengine-odm.readthedocs.io/guide/index.html\u003e`_, and\nan `API reference \u003chttps://mongoengine-odm.readthedocs.io/apireference.html\u003e`_.\n\nSupported MongoDB Versions\n==========================\nMongoEngine is currently tested against MongoDB v3.6, v4.0, v4.4, v5.0, v6.0 and v7.0. Future versions\nshould be supported as well, but aren't actively tested at the moment. Make\nsure to open an issue or submit a pull request if you experience any problems\nwith a more recent MongoDB versions.\n\nInstallation\n============\nWe recommend the use of `virtualenv \u003chttps://virtualenv.pypa.io/\u003e`_ and of\n`pip \u003chttps://pip.pypa.io/\u003e`_. You can then use ``python -m pip install -U mongoengine``.\nYou may also have `setuptools \u003chttp://peak.telecommunity.com/DevCenter/setuptools\u003e`_\nand thus you can use ``easy_install -U mongoengine``. Another option is\n`pipenv \u003chttps://docs.pipenv.org/\u003e`_. You can then use ``pipenv install mongoengine``\nto both create the virtual environment and install the package. Otherwise, you can\ndownload the source from `GitHub \u003chttps://github.com/MongoEngine/mongoengine\u003e`_ and\nrun ``python setup.py install``.\n\nThe support for Python2 was dropped with MongoEngine 0.20.0\n\nDependencies\n============\nAll of the dependencies can easily be installed via `python -m pip \u003chttps://pip.pypa.io/\u003e`_.\nAt the very least, you'll need these two packages to use MongoEngine:\n\n- pymongo\u003e=3.4\n\nIf you utilize a ``DateTimeField``, you might also use a more flexible date parser:\n\n- dateutil\u003e=2.1.0\n\nIf you need to use an ``ImageField`` or ``ImageGridFsProxy``:\n\n- Pillow\u003e=7.0.0\n\nIf you need to use signals:\n\n- blinker\u003e=1.3\n\nExamples\n========\nSome simple examples of what MongoEngine code looks like:\n\n.. code :: python\n\n    from mongoengine import *\n    connect('mydb')\n\n    class BlogPost(Document):\n        title = StringField(required=True, max_length=200)\n        posted = DateTimeField(default=datetime.datetime.utcnow)\n        tags = ListField(StringField(max_length=50))\n        meta = {'allow_inheritance': True}\n\n    class TextPost(BlogPost):\n        content = StringField(required=True)\n\n    class LinkPost(BlogPost):\n        url = StringField(required=True)\n\n    # Create a text-based post\n    \u003e\u003e\u003e post1 = TextPost(title='Using MongoEngine', content='See the tutorial')\n    \u003e\u003e\u003e post1.tags = ['mongodb', 'mongoengine']\n    \u003e\u003e\u003e post1.save()\n\n    # Create a link-based post\n    \u003e\u003e\u003e post2 = LinkPost(title='MongoEngine Docs', url='hmarr.com/mongoengine')\n    \u003e\u003e\u003e post2.tags = ['mongoengine', 'documentation']\n    \u003e\u003e\u003e post2.save()\n\n    # Iterate over all posts using the BlogPost superclass\n    \u003e\u003e\u003e for post in BlogPost.objects:\n    ...     print('===', post.title, '===')\n    ...     if isinstance(post, TextPost):\n    ...         print(post.content)\n    ...     elif isinstance(post, LinkPost):\n    ...         print('Link:', post.url)\n    ...\n\n    # Count all blog posts and its subtypes\n    \u003e\u003e\u003e BlogPost.objects.count()\n    2\n    \u003e\u003e\u003e TextPost.objects.count()\n    1\n    \u003e\u003e\u003e LinkPost.objects.count()\n    1\n\n    # Count tagged posts\n    \u003e\u003e\u003e BlogPost.objects(tags='mongoengine').count()\n    2\n    \u003e\u003e\u003e BlogPost.objects(tags='mongodb').count()\n    1\n\nTests\n=====\nTo run the test suite, ensure you are running a local instance of MongoDB on\nthe standard port and have ``pytest`` installed. Then, run ``pytest tests/``.\n\nTo run the test suite on every supported Python and PyMongo version, you can\nuse ``tox``. You'll need to make sure you have each supported Python version\ninstalled in your environment and then:\n\n.. code-block:: shell\n\n    # Install tox\n    $ python -m pip install tox\n    # Run the test suites\n    $ tox\n\nCommunity\n=========\n- `MongoEngine Users mailing list\n  \u003chttp://groups.google.com/group/mongoengine-users\u003e`_\n- `MongoEngine Developers mailing list\n  \u003chttp://groups.google.com/group/mongoengine-dev\u003e`_\n\nContributing\n============\nWe welcome contributions! See the `Contribution guidelines \u003chttps://github.com/MongoEngine/mongoengine/blob/master/CONTRIBUTING.rst\u003e`_\n","funding_links":[],"categories":["ORM","Python","Data Management \u0026 Processing","Database Clients","ORM [🔝](#readme)","Uncategorized","ODM, ORM, Active Record","Libraries","📚 فهرست","Third-Party Extensions"],"sub_categories":["Database \u0026 Cloud Management","Uncategorized","Python","دیتابیس","Databases"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMongoEngine%2Fmongoengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMongoEngine%2Fmongoengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMongoEngine%2Fmongoengine/lists"}