{"id":18455805,"url":"https://github.com/turbogears/ming","last_synced_at":"2025-04-05T21:06:25.480Z","repository":{"id":32041855,"uuid":"131440764","full_name":"TurboGears/Ming","owner":"TurboGears","description":"MongoDB ODM (Object Document Mapper) with Unit of Works, IdentityMap, Relations and Mongo-In-Memory implementation","archived":false,"fork":false,"pushed_at":"2024-12-20T15:34:30.000Z","size":1265,"stargazers_count":28,"open_issues_count":11,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T20:03:19.150Z","etag":null,"topics":["in-memory","mongodb","odm","orm","pymongo","python"],"latest_commit_sha":null,"homepage":"https://ming.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TurboGears.png","metadata":{"files":{"readme":"README.rst","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-28T20:08:50.000Z","updated_at":"2024-12-19T18:49:25.000Z","dependencies_parsed_at":"2024-03-15T21:39:44.485Z","dependency_job_id":"0862dacb-4f4b-4889-89b6-0207276c2714","html_url":"https://github.com/TurboGears/Ming","commit_stats":{"total_commits":657,"total_committers":39,"mean_commits":"16.846153846153847","dds":0.7838660578386606,"last_synced_commit":"a0db824bfc7edc38261dc12625ac13e2cd60c122"},"previous_names":[],"tags_count":85,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboGears%2FMing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboGears%2FMing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboGears%2FMing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurboGears%2FMing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TurboGears","download_url":"https://codeload.github.com/TurboGears/Ming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399873,"owners_count":20932876,"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":["in-memory","mongodb","odm","orm","pymongo","python"],"created_at":"2024-11-06T08:09:05.129Z","updated_at":"2025-04-05T21:06:25.440Z","avatar_url":"https://github.com/TurboGears.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ming\n====\n\n.. image:: https://github.com/TurboGears/Ming/actions/workflows/main.yml/badge.svg\n    :target: https://github.com/TurboGears/Ming/actions/workflows/main.yml\n\n.. image:: https://codecov.io/gh/TurboGears/Ming/branch/master/graph/badge.svg?token=Iy3CU62Ga5\n    :target: https://codecov.io/gh/TurboGears/Ming\n\n.. image:: https://img.shields.io/pypi/v/Ming.svg\n   :target: https://pypi.python.org/pypi/Ming\n\n.. image:: https://img.shields.io/pypi/pyversions/Ming.svg\n    :target: https://pypi.python.org/pypi/Ming\n\n.. image:: https://img.shields.io/pypi/l/Ming.svg\n    :target: https://pypi.python.org/pypi/Ming\n\n.. image:: https://img.shields.io/gitter/room/turbogears/Lobby.svg\n    :target: https://gitter.im/turbogears/Lobby\n\n.. image:: https://img.shields.io/twitter/follow/turbogearsorg.svg?style=social\u0026label=Follow\n    :target: https://twitter.com/turbogearsorg\n\nMing is a MongoDB ODM ( Object Document Mapper, like an ORM but for Document based databases),\nthat builds on top of ``pymongo`` by extending it with:\n\n* Declarative Models\n* Schema Validation and Conversion\n* Lazy Schema Evolution\n* Unit of Work\n* Identity Map\n* One-To-Many, Many-To-One and Many-To-Many Relations\n* Pure InMemory MongoDB Implementation\n\nMing is the official MongoDB support layer of `TurboGears \u003chttp://www.turbogears.org\u003e`_ web\nframework, thus feel free to join the TurboGears Gitter or Twitter to discuss Ming.\n\nIf you want to dig further in Ming, documentation is available\nat http://ming.readthedocs.io/en/latest/\n\nGetting Started\n---------------\n\nTo use Ming you need to create a ``Session`` and a few models that\nshould be managed by it::\n\n    from ming import create_datastore, schema\n    from ming.odm import ThreadLocalODMSession, Mapper, MappedClass, FieldProperty\n\n    session = ThreadLocalODMSession(\n        bind=create_datastore('mongodb://localhost:27017/dbname')\n    )\n\n    class WikiPage(MappedClass):\n        class __mongometa__:\n            session = session\n            name = 'wiki_page'\n\n        _id = FieldProperty(schema.ObjectId)\n        title = FieldProperty(schema.String(required=True))\n        text = FieldProperty(schema.String(if_missing=''))\n\n    Mapper.compile_all()\n\nThen you can create and query those models::\n\n    \u003e\u003e\u003e WikiPage(title='FirstPage', text='This is a page')\n    \u003cWikiPage text='This is a page'\n       _id=ObjectId('5ae4ef717ddf1ff6704afff5')\n       title='FirstPage'\u003e\n\n    \u003e\u003e\u003e session.flush()  # Flush session to actually create wikipage.\n\n    \u003e\u003e\u003e wp = WikiPage.query.find({'text': 'This is a page'}).first()\n    \u003e\u003e\u003e print(wp)\n    \u003cWikiPage text='This is a page'\n      _id=ObjectId('5ae4ef717ddf1ff6704afff5')\n      title='FirstPage'\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbogears%2Fming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturbogears%2Fming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbogears%2Fming/lists"}