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

Uploaded Source

Built Distributions

pymongo-1.10.1.win32-py2.7.exe (312.6 kB view details)

Uploaded Source

pymongo-1.10.1.win32-py2.6.exe (312.8 kB view details)

Uploaded Source

pymongo-1.10.1.win32-py2.5.exe (177.7 kB view details)

Uploaded Source

pymongo-1.10.1.win32-py2.4.exe (177.7 kB view details)

Uploaded Source

pymongo-1.10.1-py2.7-win32.egg (204.0 kB view details)

Uploaded Source

pymongo-1.10.1-py2.7-macosx-10.6-x86_64.egg (208.6 kB view details)

Uploaded Source

pymongo-1.10.1-py2.6-win32.egg (204.6 kB view details)

Uploaded Source

pymongo-1.10.1-py2.6-macosx-10.6-x86_64.egg (208.9 kB view details)

Uploaded Source

pymongo-1.10.1-py2.5-win32.egg (204.3 kB view details)

Uploaded Source

pymongo-1.10.1-py2.5-macosx-10.6-i386.egg (238.6 kB view details)

Uploaded Source

pymongo-1.10.1-py2.4-win32.egg (205.9 kB view details)

Uploaded Source

pymongo-1.10.1-py2.4-macosx-10.6-i386.egg (210.6 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pymongo-1.10.1.tar.gz
Algorithm Hash digest
SHA256 00487874097c4fda18f57964633fb206d4910121093ae0c5a4478be542cbcf22
MD5 9e94096991285c384adfa8cafaf39c88
BLAKE2b-256 081501740d0050bb79fcb19e3b9d670f93101cc11bb49b18408d1418de13f4ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1.win32-py2.7.exe
Algorithm Hash digest
SHA256 1535d5c80d1897c335d1a14f1f6f87f5a35496e5102b275046a5f0171bf11863
MD5 81ae0d3939c360ad1cae33929b8367a4
BLAKE2b-256 540a53355c32ea19fcd3e53a27155e8e1e86515333297684b75a94d81dc2aa0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1.win32-py2.6.exe
Algorithm Hash digest
SHA256 6e45881326486f74d6455c0fa9df06551704f1136a74d8b2c68925e1c7db8c66
MD5 d029f0affe28eb8cc7fdef31d58d8f89
BLAKE2b-256 dbb685adfb23fdb97b95aec21f48666467ec726a6a6d5a75b93775f277a887d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1.win32-py2.5.exe
Algorithm Hash digest
SHA256 38a87c01829af944f39eee610416de653ca7869db5112ba7d9bf42c9c260949d
MD5 b7563702936b65b7950d9cca745cab6a
BLAKE2b-256 5b1ba714af924d28b0ed8bb54729157a260977a0f3d138bfc70feb684097ba6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1.win32-py2.4.exe
Algorithm Hash digest
SHA256 65a7d60254204ba04aa7d1916d258cf377f541308c44def47f60c1c66e563fe5
MD5 15ce78d5b705eaf8c6467b7aaec84ef1
BLAKE2b-256 a9b9fec1015b63f5985825731d47bd436dbbd0b9203d85ccae2d51e43beb0125

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.7-win32.egg
Algorithm Hash digest
SHA256 f0f44fe53deacfc20b1bcef4fae464c3467fcf951e20f290d7a72b797b73b75d
MD5 a1c626778417698a82c332c034eb28f4
BLAKE2b-256 1a788ce2561bc7af61ca811d32a37b359598276648a39186bf7a039b0cdc3f18

See more details on using hashes here.

File details

Details for the file pymongo-1.10.1-py2.7-macosx-10.6-x86_64.egg.

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.7-macosx-10.6-x86_64.egg
Algorithm Hash digest
SHA256 63972af11362eec55a81a3811fa55c12f475652414fef6bb072adbb72d0dd221
MD5 6b62bd76f6af50dfe171ce13ce7dc181
BLAKE2b-256 690ed77da1c1305e1214b34b68ed13afc87ecb50bc671cc79efef98500535bcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.6-win32.egg
Algorithm Hash digest
SHA256 b74d62b2256c09dae9937b81e2d03f7305a1537c3e079ed604f5ddc643c86862
MD5 41ea37275a316aa7d21fd972f24003ee
BLAKE2b-256 6a1635915b61eafc473174b909ab316c42111bf902a3c428bf8a9ee0d4909a95

See more details on using hashes here.

File details

Details for the file pymongo-1.10.1-py2.6-macosx-10.6-x86_64.egg.

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.6-macosx-10.6-x86_64.egg
Algorithm Hash digest
SHA256 3704ed04d57de13d60b6e6feea9eb1faa8dcf40864e87f13503fa0b1c2906a06
MD5 1691bd8fbace13fc6ce052cf47cfd2de
BLAKE2b-256 e07e8b1875688985378b53fb6afb528865a1fd6fa764cb7b2a143737ababeb78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.5-win32.egg
Algorithm Hash digest
SHA256 64e4482b6eaeb0ef00084b9c5fce35759c06dd4fb172cbe0092030fca52cb2d7
MD5 a0acd3f9261de60cf117653bf7441a5b
BLAKE2b-256 f6cd7abf6b681269fad1a6d6eaca694a8398f87f91e747a17221ce9132f55bdd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.5-macosx-10.6-i386.egg
Algorithm Hash digest
SHA256 9687fad6cf7d602093d377d5420bf27b6780d9edc1ab6a4a58bbfe259d51dfa4
MD5 c3a8ad2ffe1b1415c4b93416e4e9fa15
BLAKE2b-256 085962487827653661833cce596258ad2a1b7b5cbbb383350df8267771a36e21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.4-win32.egg
Algorithm Hash digest
SHA256 27a70d8cb091da46092dd8bd4dd07dd4dc090e4ffa59484ba2e336e894dc7b33
MD5 fd75d0c1effc2f011b61d9572346a86c
BLAKE2b-256 2fdf964556d2ff3124a51074b229b483b2a76411a19f7bb36074e9263fe5375a

See more details on using hashes here.

File details

Details for the file pymongo-1.10.1-py2.4-macosx-10.6-i386.egg.

File metadata

File hashes

Hashes for pymongo-1.10.1-py2.4-macosx-10.6-i386.egg
Algorithm Hash digest
SHA256 9e1908a5c2c01a7329758002469f74fa5af0ec8d7a443f77239bcfae92b4d8b3
MD5 ff6f6b04bebcea4279ba30b5959f9eee
BLAKE2b-256 315de600080012024c0cb81747c7b944263884937f575293ed956ae7a659c595

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