Tools

Many tools have been written for working with PyMongo. If you knowof or have created a tool for working with MongoDB from Python pleaselist it here.

Note

We try to keep this list current. As such, projects thathave not been updated recently or appear to be unmaintained willoccasionally be removed from the list or moved to the back (to keepthe list from becoming too intimidating).

If a project gets removed that is still being developed or is in active useplease let us know or add it back.

ORM-like Layers

Some people have found that they prefer to work with a layer thathas more features than PyMongo provides. Often, things like models andvalidation are desired. To that end, several different ORM-like layershave been written by various authors.

It is our recommendation that new users begin by working directly withPyMongo, as described in the rest of this documentation. Many peoplehave found that the features of PyMongo are enough for theirneeds. Even if you eventually come to the decision to use one of theselayers, the time spent working directly with the driver will haveincreased your understanding of how MongoDB actually works.

  • PyMODM
  • PyMODM is an ORM-like framework on topof PyMongo. PyMODM is maintained by engineers at MongoDB, Inc. and is quickto adopt new MongoDB features. PyMODM is a “core” ODM, meaning that itprovides simple, extensible functionality that can be leveraged by otherlibraries to target platforms like Django. At the same time, PyMODM ispowerful enough to be used for developing applications on its own. Completedocumentation is available on readthedocs in addition to a Gitter channel for discussing the project.
  • Humongolus
  • Humongolus is a lightweight ORMframework for Python and MongoDB. The name comes from the combination ofMongoDB and Homunculus (theconcept of a miniature though fully formed human body). Humongolus allowsyou to create models/schemas with robust validation. It attempts to be aspythonic as possible and exposes the pymongo cursor objects wheneverpossible. The code is available for downloadat GitHub. Tutorials and usageexamples are also available at GitHub.
  • Ming
  • Ming (the Merciless) is alibrary that allows you to enforce schemas on a MongoDB database inyour Python application. It was developed by SourceForge in the course of their migration toMongoDB. See the introductory blog postfor more details.
  • MongoEngine
  • MongoEngine is another ORM-likelayer on top of PyMongo. It allows you to define schemas fordocuments and query collections using syntax inspired by the DjangoORM. The code is available on GitHub; for more information, seethe tutorial.
  • MotorEngine
  • MotorEngine is a port ofMongoEngine to Motor, for asynchronous access with Tornado.It implements the same modeling APIs to be data-portable, meaning that amodel defined in MongoEngine can be read in MotorEngine. The source isavailable on GitHub.
  • uMongo
  • uMongo is a Python MongoDB ODM.Its inception comes from two needs: the lack of async ODM and thedifficulty to do document (un)serialization with existing ODMs.Works with multiple drivers: PyMongo, TxMongo, motor_asyncio, andmongomock. The source is available on GitHub

No longer maintained

  • MongoKit
  • The MongoKit frameworkis an ORM-like layer on top of PyMongo. There is also a MongoKitgoogle group.
  • MongoAlchemy
  • MongoAlchemy is another ORM-like layer on top ofPyMongo. Its API is inspired by SQLAlchemy. Thecode is available on GitHub;for more information, see the tutorial.
  • Minimongo
  • minimongo is a lightweight,pythonic interface to MongoDB. It retains pymongo’s query and update API,and provides a number of additional features, including a simpledocument-oriented interface, connection pooling, index management, andcollection & database naming helpers. The source is on GitHub.
  • Manga
  • Manga aims to be a simpler ORM-likelayer on top of PyMongo. The syntax for defining schema is inspired by theDjango ORM, but Pymongo’s query language is maintained. The source is onGitHub.

Framework Tools

This section lists tools and adapters that have been designed to work withvarious Python frameworks and libraries.

Alternative Drivers

These are alternatives to PyMongo.

  • Motor is a full-featured, non-blockingMongoDB driver for Python Tornado applications.
  • TxMongo is an asynchronous TwistedPython driver for MongoDB.
  • MongoMock is a smalllibrary to help testing Python code that interacts with MongoDB viaPymongo.