Skip to main content

Python driver for MongoDB <http://www.mongodb.org>

Project description

Info:

See the mongo site for more information. See github for the latest source.

Author:

Mike Dirolf

Maintainer:

Bernie Hackett <bernie@10gen.com>

About

The PyMongo distribution contains tools for interacting with MongoDB database from Python. The bson package is an implementation of the BSON format for Python. The pymongo package is a native Python driver for MongoDB. The gridfs package is a gridfs implementation on top of pymongo.

Issues / Questions / Feedback

Any issues with, questions about, or feedback for PyMongo should be sent to the mongodb-user list on Google Groups. For confirmed issues or feature requests, open a case on jira. Please do not e-mail any of the PyMongo developers directly with issues or questions - you’re more likely to get an answer on the list.

Installation

If you have setuptools installed you should be able to do easy_install pymongo to install PyMongo. Otherwise you can download the project source and do python setup.py install to install.

Dependencies

The PyMongo distribution is supported and tested on Python 2.x, where x >= 4. PyMongo versions <= 1.3 also supported Python 2.3, but that is no longer supported. If you need to use Python 2.3 please contact us.

Additional dependencies are:

  • (to generate documentation) sphinx

  • (to auto-discover tests) nose

Examples

Here’s a basic example (for more see the examples section of the docs):

>>> import pymongo
>>> connection = pymongo.Connection("localhost", 27017)
>>> db = connection.test
>>> db.name
u'test'
>>> db.my_collection
Collection(Database(Connection('localhost', 27017), u'test'), u'my_collection')
>>> db.my_collection.save({"x": 10})
ObjectId('4aba15ebe23f6b53b0000000')
>>> db.my_collection.save({"x": 8})
ObjectId('4aba160ee23f6b543e000000')
>>> db.my_collection.save({"x": 11})
ObjectId('4aba160ee23f6b543e000002')
>>> db.my_collection.find_one()
{u'x': 10, u'_id': ObjectId('4aba15ebe23f6b53b0000000')}
>>> for item in db.my_collection.find():
...     print item["x"]
...
10
8
11
>>> db.my_collection.create_index("x")
u'x_1'
>>> for item in db.my_collection.find().sort("x", pymongo.ASCENDING):
...     print item["x"]
...
8
10
11
>>> [item["x"] for item in db.my_collection.find().limit(2).skip(1)]
[8, 11]

Documentation

You will need sphinx installed to generate the documentation. Documentation can be generated by running python setup.py doc. Generated documentation can be found in the doc/build/html/ directory.

Testing

The easiest way to run the tests is to install nose (easy_install nose) and run nosetests or python setup.py test in the root of the distribution. Tests are located in the test/ directory.

Project details


Release history Release notifications | RSS feed

This version

2.1.1

Download files

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

Source Distribution

pymongo-2.1.1.tar.gz (200.0 kB view details)

Uploaded Source

Built Distributions

pymongo-2.1.1.win-amd64-py2.7.exe (367.7 kB view details)

Uploaded Source

pymongo-2.1.1.win-amd64-py2.6.exe (367.7 kB view details)

Uploaded Source

pymongo-2.1.1.win32-py2.7.exe (337.8 kB view details)

Uploaded Source

pymongo-2.1.1.win32-py2.6.exe (337.8 kB view details)

Uploaded Source

pymongo-2.1.1.win32-py2.5.exe (205.5 kB view details)

Uploaded Source

pymongo-2.1.1.win32-py2.4.exe (205.5 kB view details)

Uploaded Source

pymongo-2.1.1-py2.7-win-amd64.egg (262.3 kB view details)

Uploaded Source

pymongo-2.1.1-py2.7-win32.egg (259.9 kB view details)

Uploaded Source

pymongo-2.1.1-py2.7-macosx-10.7-intel.egg (294.2 kB view details)

Uploaded Source

pymongo-2.1.1-py2.7-macosx-10.6-intel.egg (299.6 kB view details)

Uploaded Source

pymongo-2.1.1-py2.6-win-amd64.egg (262.8 kB view details)

Uploaded Source

pymongo-2.1.1-py2.6-win32.egg (260.4 kB view details)

Uploaded Source

pymongo-2.1.1-py2.6-macosx-10.7-intel.egg (294.7 kB view details)

Uploaded Source

pymongo-2.1.1-py2.6-macosx-10.6-universal.egg (326.5 kB view details)

Uploaded Source

pymongo-2.1.1-py2.5-win32.egg (263.0 kB view details)

Uploaded Source

pymongo-2.1.1-py2.5-macosx-10.7-x86_64.egg (261.9 kB view details)

Uploaded Source

pymongo-2.1.1-py2.5-macosx-10.6-i386.egg (294.8 kB view details)

Uploaded Source

pymongo-2.1.1-py2.4-win32.egg (265.2 kB view details)

Uploaded Source

File details

Details for the file pymongo-2.1.1.tar.gz.

File metadata

  • Download URL: pymongo-2.1.1.tar.gz
  • Upload date:
  • Size: 200.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymongo-2.1.1.tar.gz
Algorithm Hash digest
SHA256 7dd891ce2088a2d21f172102be530cc3083571a0f1eecfa0aff612da8076c37b
MD5 fa0e171cf2538b77215ccff4f4126edd
BLAKE2b-256 975b5740a876165762552f831aab542154b46dab821246010897e885ab6f0ebf

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1.win-amd64-py2.7.exe.

File metadata

File hashes

Hashes for pymongo-2.1.1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 3ec4103d6e66b81ded778cb652aa2ad59bb34aaa5401e1de1ddd618716a7aeda
MD5 2bdcad8f1cfb0ed9358ebbb869e3cf4c
BLAKE2b-256 9a21730b895d95d518b47b7d0c0afe37967460bd8a3fe74c7e688ff711c823c9

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1.win-amd64-py2.6.exe.

File metadata

File hashes

Hashes for pymongo-2.1.1.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 8cb0bb8089687fbe97325b39686b55812427c46bf6ab0756144746e64d29d865
MD5 c2a0a7fe0c4f4de3272d0d2a9f4b19cd
BLAKE2b-256 afe61e59a70a12ed163110d947d7e1e672b5beb106eec770469d3eab501c4496

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1.win32-py2.7.exe.

File metadata

File hashes

Hashes for pymongo-2.1.1.win32-py2.7.exe
Algorithm Hash digest
SHA256 51050fe65b211f5746f3e9cc192f077a08fe6813d8a5a1e452b030827b50c230
MD5 4e546df2205a79aa4b4a9557719269b2
BLAKE2b-256 fb3216ef10b1353181625b6fb2b6d2e4ddd5ced5a692b6facb1f785646561328

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1.win32-py2.6.exe.

File metadata

File hashes

Hashes for pymongo-2.1.1.win32-py2.6.exe
Algorithm Hash digest
SHA256 6edf4a4a3d1f6aee84bb9f853e61092e6582ed74b05789bb2bac2c84eb135add
MD5 96d06754eeca00dbe01e0cfc8076775e
BLAKE2b-256 0075c86bcc489c2bde23aea72c5fd1ffda3ec0cf426622c3584ec0d527a771ff

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1.win32-py2.5.exe.

File metadata

File hashes

Hashes for pymongo-2.1.1.win32-py2.5.exe
Algorithm Hash digest
SHA256 072478f453d5c85e6a38bf65199a980bb7c67ae2d8af96162fe091dd6537e0f2
MD5 1b7529ef866f244663ae3a49d7fd5843
BLAKE2b-256 934919b5ea302301164abcf9133f252ad854d1f6fc517873f4fcc3d065824c26

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1.win32-py2.4.exe.

File metadata

File hashes

Hashes for pymongo-2.1.1.win32-py2.4.exe
Algorithm Hash digest
SHA256 69ee03dc6c027361dd9c40491f907d41708208b365770524286eff8f5b3ca06b
MD5 968d4c24c12bdaf8175009a836c103f6
BLAKE2b-256 e7bbbd329ba859ceeab513e6f28b0b10498f73e8b47e6e8cb610a1c0b3141578

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.7-win-amd64.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.7-win-amd64.egg
Algorithm Hash digest
SHA256 3da17a9bc7c6aeefb001101aaec0ae6713c213a377f0333c586a4e6808ce9c29
MD5 8aa50db969aa6eb8a92af9a740429dc1
BLAKE2b-256 59417a02622fc2cb0004a397e7008fef052e11e56144713b77fe7f83de48cd02

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.7-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.7-win32.egg
Algorithm Hash digest
SHA256 73338d4f4b8fc6d9fb48a838e778797ec250ed23b34252a53b2b1c24f32c9c43
MD5 2dae7afe905bde908e610469f9b49777
BLAKE2b-256 2beee514135fddfd65fe7ce84a3b0afc6cd2b6b891f4d554d525fd57b2e3482b

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.7-macosx-10.7-intel.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.7-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 f34799824b2ce40ea8615c7c1def1d753ffd9170a01d2b57d34d82b3abd163ab
MD5 a40ddafb3a4ab1222572b2445e6d0842
BLAKE2b-256 9eb18a4db0e280acb2466ff6c7734366f83444b45ef9ef7b65ae76a854a5fd9f

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.7-macosx-10.6-intel.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.7-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 3b4f985e1867a529482f6f4983c73b56650a112431029e042e1ebb407cd6f9a2
MD5 a7c1f275acdb0a9dd9ad12e779778dce
BLAKE2b-256 ae09e0aa226b3f72980ac0902353124078275b3adbf4fa709e16bbfe41f1cd30

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.6-win-amd64.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.6-win-amd64.egg
Algorithm Hash digest
SHA256 a8a695875b8011491a7264886671d8e10b9e2eff6c8de74864911560ad5f2ca0
MD5 3a95378c27108909ed21963ed1205db8
BLAKE2b-256 6649a2ea1f7a930d64783a09278d43201cffb939fb61523e774aa2ab104e0970

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.6-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.6-win32.egg
Algorithm Hash digest
SHA256 861022c4f617843b36b132d2414c13ef7b6aa5756a833b55a36aea5dbe92c3d5
MD5 967bdc69dbf2a263e666c4e18154f57e
BLAKE2b-256 0a8ecec0f393cccf1fab4236412499da30c232a9adb8157d17222dabb427bb15

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.6-macosx-10.7-intel.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.6-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 45e661bf5521abb833f0fd4cac28f2046e61fefa46250868f3fa1957f6d5d634
MD5 e242b67e2643edc31db0851858f28839
BLAKE2b-256 d31f31868d332db126bcc6fdd40aa964cc5b1f55b991dfed76d63274fea15016

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.6-macosx-10.6-universal.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.6-macosx-10.6-universal.egg
Algorithm Hash digest
SHA256 01d3f48dae448eb1d89d537f013bbaca7ba6a1c9e7d03d26f175ef057180cc02
MD5 a34241c1fa1290fad2fe206266a9fdb4
BLAKE2b-256 0ed706e915245a1223dba68e0c598f0fb5c2cee64559ae1debae429f5efaf440

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.5-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.5-win32.egg
Algorithm Hash digest
SHA256 ebc1ce727092e55604ef8d0bc2466268ef9c17ffdd8ecdd8988ae5d35556a2b0
MD5 1be0d36b0041974d7bf4a6d1b32fe2e7
BLAKE2b-256 2492110d8e8de7763043aed91f4a8fab1fae96aae61ff26b5a7a45758b2221af

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.5-macosx-10.7-x86_64.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.5-macosx-10.7-x86_64.egg
Algorithm Hash digest
SHA256 e16ae32ddcdee0df56ab2697acb8efcb6a6e66da7c62da7970a6617e3b7b7c71
MD5 b8cb1450c2a99ea25c3ab29dfc32ea5c
BLAKE2b-256 244af8b0bddfbe827ffb47e5494a2eae80f3f389a23d9e52a80507e6bd9f8078

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.5-macosx-10.6-i386.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.5-macosx-10.6-i386.egg
Algorithm Hash digest
SHA256 91ca4cf1b0c10788b0061ffd1f09221681f6bfaf1426a59e5d8a0e56dd2a7bc0
MD5 2be719e582780beb43c92df5d00adbf1
BLAKE2b-256 d29e88f8603de32db74cf8ac284bdd0e215999049a9215ec92f9725fb387e172

See more details on using hashes here.

File details

Details for the file pymongo-2.1.1-py2.4-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.1.1-py2.4-win32.egg
Algorithm Hash digest
SHA256 25bda357d414012ce83c56310938ff7f1d3964b3ebb0c64ec7e91c9deb3c4982
MD5 e3c199e68fd498a4c90fcdd3a02b4723
BLAKE2b-256 fdb9d5957c300950bb91cde82dedc3979252484369968167b3b169581b38b4d7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page