Skip to main content

Pyramid Mongokit Extension

Project description

A simple Pyramid extension that registers a mongokit connection as an attribute of the request object.

Expects MONGO_URI in os.environ.

If provided as environment variables, MONGO_DB_PREFIX will be used as prefix for any databases and MONGO_DB_NAME for database name.

Source code & example on




  • Add register decorator to register documents to mongokit and generate indexes when doing a config.scan.
  • Add an introspectable for each registered document.


  • Add name when registring utility to zope registry to be compatible with zope.interface==4.1.0


  • Use MongoReplicaSetClient when specified by mongo uri.
  • Mongo Session lazily opened.
  • Add config directives to register and index documents and to get mongo connection.


  • Read preference set to secondary preferred by default at construct time.


  • Break compatibility with 0.0.4 as register_document does not generate indexes anymore.
  • Add generate_index function.
  • Break apart Connection classes: MongoConnection is not anymore tied to a single databases and SingleDbCOnnection is tied to a single database.
  • Add an example used for documenting and functional testing.


  • registering document ensures index are created.


  • Initial version

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyramid_mongokit, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size pyramid_mongokit-0.2.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page