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

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.0.1.tar.gz (171.7 kB view details)

Uploaded Source

Built Distributions

pymongo-2.0.1.win-amd64-py2.7.exe (352.1 kB view details)

Uploaded Source

pymongo-2.0.1.win-amd64-py2.6.exe (352.1 kB view details)

Uploaded Source

pymongo-2.0.1.win32-py2.7.exe (322.3 kB view details)

Uploaded Source

pymongo-2.0.1.win32-py2.6.exe (322.3 kB view details)

Uploaded Source

pymongo-2.0.1.win32-py2.5.exe (189.8 kB view details)

Uploaded Source

pymongo-2.0.1.win32-py2.4.exe (189.9 kB view details)

Uploaded Source

pymongo-2.0.1-py2.7-win-amd64.egg (226.9 kB view details)

Uploaded Source

pymongo-2.0.1-py2.7-win32.egg (224.6 kB view details)

Uploaded Source

pymongo-2.0.1-py2.7-macosx-10.7-intel.egg (258.6 kB view details)

Uploaded Source

pymongo-2.0.1-py2.7-macosx-10.6-intel.egg (263.8 kB view details)

Uploaded Source

pymongo-2.0.1-py2.6-win-amd64.egg (227.2 kB view details)

Uploaded Source

pymongo-2.0.1-py2.6-win32.egg (225.0 kB view details)

Uploaded Source

pymongo-2.0.1-py2.6-macosx-10.7-intel.egg (259.0 kB view details)

Uploaded Source

pymongo-2.0.1-py2.6-macosx-10.6-universal.egg (290.4 kB view details)

Uploaded Source

pymongo-2.0.1-py2.5-win32.egg (227.4 kB view details)

Uploaded Source

pymongo-2.0.1-py2.5-macosx-10.7-x86_64.egg (226.4 kB view details)

Uploaded Source

pymongo-2.0.1-py2.5-macosx-10.6-i386.egg (259.0 kB view details)

Uploaded Source

pymongo-2.0.1-py2.4-win32.egg (229.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pymongo-2.0.1.tar.gz
Algorithm Hash digest
SHA256 608b0a1ab378a6f0a74035f6a0e05c00903d47139784b00c56fe47665bfd685c
MD5 36300a5c3568707f6c5f1692f42ca008
BLAKE2b-256 b3cc1fe3e1d6694b7f5a4078e7c489e7f34dee556ad3344f8f78ff5010fb33fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 90942fd533b630d1dff0bc882f193e267d4d3a1ece05fd37c116959ddd8a0d59
MD5 0290ddcfbf908243fed1c4d63ae03564
BLAKE2b-256 2271549912ce18f70add1aecaeedb9f486b7d2091920232aa1397cf8a312a591

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 25bcc943f27d6d6e98af4cbe7929f12be943f1774d1c0a7037eb5ff617ec23c6
MD5 2814195034dbad638ef22f3d3ba17702
BLAKE2b-256 022af2383e25b2879d18cda70c7b67ccbf17c1a665b7a9fef857466e3ee3890d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1.win32-py2.7.exe
Algorithm Hash digest
SHA256 7b1bb17a120928a1c07cd33944b058f0a585f98840b6c4d84cf17b1bf6c24a3a
MD5 2b8f204766dca9df9607a4860510a57a
BLAKE2b-256 0d83d9c9f8c43561cdc290d540e3fb22af914c2e7e8b98a8bdc3fc75f0ab8ea6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1.win32-py2.6.exe
Algorithm Hash digest
SHA256 acee2a05f9ac827acbbd311445632b7e24db83f469e872cc76130097aaa7c939
MD5 6d8c59b5ac64d2b70bbd6900921de996
BLAKE2b-256 8a44b6d01b8e2513f2b2aba8c28c415e7cd8bf0f803a92a65b53deca0fd5fcc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1.win32-py2.5.exe
Algorithm Hash digest
SHA256 d2c088f6f99e2083b9da6781be759abe638271db911a0c819f20d6b030ae2c51
MD5 d6081c5da45140a7db6cfb753c50f53a
BLAKE2b-256 5a61fe016cc9a44822689f0090dd4e0d65e3152611ffdc23d184a5b218212d0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1.win32-py2.4.exe
Algorithm Hash digest
SHA256 1736228f416a060d197a6eeccdde2874cfe5222befff8059c9b2fdc06ca055a3
MD5 e80420027ee8b3d2ad9dd8adc069fec2
BLAKE2b-256 07eb35c865e00316d54081ab5bc92cc2bb2930a6aada88fec81dff7b3562b283

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.7-win-amd64.egg
Algorithm Hash digest
SHA256 243f14e479a91de4f1b3e77046480b04b1a989c48e9dc0b3cfa51d5e270b1d75
MD5 a3c9d5d1fc05944a8c409879362eeac2
BLAKE2b-256 3cd2c80d7e1443e5924027d78da3d7d83474dacb4588585d68db20adf3133e10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.7-win32.egg
Algorithm Hash digest
SHA256 29b2025cd57e33d6499073a88a08ab09889a5acc90ab5ee08b4c52aa9c1120f2
MD5 16e04b762451f4d292e1db8db1a739b0
BLAKE2b-256 73a68e4bfaa42f77774d8d7f35fb63dde34f73438711a73f4b58dd1c2c7d5af6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.7-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 0e306c5cff7ee991e7a8e4ad8d27c8d49970f88579a50e04eb2ae1ab4ff1e6d5
MD5 a7dc5393936237db33a962cddaf25ce3
BLAKE2b-256 ef9c1a1883285310d6cc38e1c6bcb42512f352a852c2aca8f5e3e7566b758d08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.7-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 f47d4598f876f085c62a11f7c2e189446cbd5c1f75079eb94316edc6f14712f3
MD5 36e20ae0feacb6e275bc1b98faae339b
BLAKE2b-256 f9c7c5a62c4d6bddc69ed055c9767eeda95da9bd4b257901c72536dc3df334d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.6-win-amd64.egg
Algorithm Hash digest
SHA256 0354c2a9558c0d0bc17ad49aaec66c1b136a1f3eb1fa6aa86c55da8f8dfd59cc
MD5 6b6277e602571bd02682407597ce722a
BLAKE2b-256 b131510c64ada669d1d80c8f5479d1d334f8d69f06b1806e20fa2343df5156f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.6-win32.egg
Algorithm Hash digest
SHA256 ad68b927f63e0ac92f582fbeda7d8d25bbbd2d29e032253a7e73a16533ecda2a
MD5 9c6dc84097c20421017f2d5cf7f59e05
BLAKE2b-256 b613ab51c6164954dce45f29506f833111ef1f5e2866b413e5ceb30fd32bd9f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.6-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 50a989bd8570b50046e4919f0ddef1825def0385ba251f11f0f7381153d5bac9
MD5 a781dc04e48f08fedcc6cc47ba2b2f16
BLAKE2b-256 ac2400d0c4f1476d825c59a702518035cc24c8be69212d39bce1355744fd27f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.6-macosx-10.6-universal.egg
Algorithm Hash digest
SHA256 f7f6d7f1449b07ced76b4711f74e886ee645fbd8fcc158d3898d891d72970274
MD5 d935056d80444866996d45bcda63ef0a
BLAKE2b-256 cd5c77fddc5338144d23bdbfade77ea8c6705e30c611b7bafb64eebdc11e23dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.5-win32.egg
Algorithm Hash digest
SHA256 b233eb77de311ea3d0b035e62f6760d5e08dcdbdb5b7e8cb144248247c2c5403
MD5 a4ff6bf8b10d283e7bcee993a40e38a2
BLAKE2b-256 b45bdce66ea853ce833b41d8b87dbb6087bebb1347ba05ad4678cbc71a8a1a41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.5-macosx-10.7-x86_64.egg
Algorithm Hash digest
SHA256 cb4158adf4ebc4616012d094282aa414b84c8ddcb517beb6d71d8873cf377808
MD5 bbb91d9c2fed9b77dc7f46e5e42d9690
BLAKE2b-256 6ea5ed7b8b673cbfa7d213f9fa2498d47141f8845def2bb9e8978a31e2b5ffa3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.5-macosx-10.6-i386.egg
Algorithm Hash digest
SHA256 d30c5a6a5c4d0b55b3a2b54a2905f12adb87c20fa6bb1de46b4cee830617269f
MD5 d6044a9c22831ff5b9227aba2b78a841
BLAKE2b-256 a3f597258da7686ec23a8d047460a243c016b7b3ee9da36822fbfe671b31ffdb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.0.1-py2.4-win32.egg
Algorithm Hash digest
SHA256 2565515b38fe02c400d5e9ab41de314ad46f5efa8d888fe8899e236de790a4f9
MD5 d675ca253c207742e23d52bfcc5a84e2
BLAKE2b-256 c3f2b5b01cc58ab9113bce47efb842fd771c207661ba821dcbf892e9aebd071d

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