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

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

Uploaded Source

Built Distributions

pymongo-2.1.win-amd64-py2.7.exe (367.2 kB view details)

Uploaded Source

pymongo-2.1.win-amd64-py2.6.exe (367.2 kB view details)

Uploaded Source

pymongo-2.1.win32-py2.7.msi (245.8 kB view details)

Uploaded Source

pymongo-2.1.win32-py2.7.exe (337.3 kB view details)

Uploaded Source

pymongo-2.1.win32-py2.6.msi (245.8 kB view details)

Uploaded Source

pymongo-2.1.win32-py2.6.exe (337.3 kB view details)

Uploaded Source

pymongo-2.1.win32-py2.5.exe (205.1 kB view details)

Uploaded Source

pymongo-2.1.win32-py2.4.exe (205.0 kB view details)

Uploaded Source

pymongo-2.1-py2.7-win-amd64.egg (261.3 kB view details)

Uploaded Source

pymongo-2.1-py2.7-win32.egg (258.9 kB view details)

Uploaded Source

pymongo-2.1-py2.7-macosx-10.7-intel.egg (293.2 kB view details)

Uploaded Source

pymongo-2.1-py2.7-macosx-10.6-intel.egg (298.6 kB view details)

Uploaded Source

pymongo-2.1-py2.6-win-amd64.egg (261.8 kB view details)

Uploaded Source

pymongo-2.1-py2.6-win32.egg (259.4 kB view details)

Uploaded Source

pymongo-2.1-py2.6-macosx-10.7-intel.egg (293.7 kB view details)

Uploaded Source

pymongo-2.1-py2.6-macosx-10.6-universal.egg (325.5 kB view details)

Uploaded Source

pymongo-2.1-py2.5-win32.egg (262.0 kB view details)

Uploaded Source

pymongo-2.1-py2.5-macosx-10.7-x86_64.egg (260.8 kB view details)

Uploaded Source

pymongo-2.1-py2.5-macosx-10.6-i386.egg (293.8 kB view details)

Uploaded Source

pymongo-2.1-py2.4-win32.egg (264.2 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pymongo-2.1.tar.gz
Algorithm Hash digest
SHA256 49dbefef8d37fc0b09c0383b71ac9eab23c05170ea95f51a86bd8ffd20dd5bee
MD5 40f8c8be0edcea398ba41d5d3ba5e8b0
BLAKE2b-256 326d7c7fcdc90670b5d9459ae6d1e656a7a56e552f24ee3222f5938345e04fe7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 3f495806ffd749263c4d15b23cdbc9b1ab1784ecd449cad4d910a1bb277ffee6
MD5 0d625fc602be0104b90d07671df90c2e
BLAKE2b-256 f9314e43bfc8fd6f7b25658b51f476f083c28781ae73c48b1aaf2a28c488f4c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 da3c979d1de03bbeea17f2b0ff72b3a790ad4ec67d938d5f2edec9089a0911e7
MD5 fb8ad9d31f2ba85be67dec2fea70a111
BLAKE2b-256 47ad82e17fb46f8a78edcccd597ff39538cce24dc18760be4b69546354b78801

See more details on using hashes here.

File details

Details for the file pymongo-2.1.win32-py2.7.msi.

File metadata

File hashes

Hashes for pymongo-2.1.win32-py2.7.msi
Algorithm Hash digest
SHA256 b36adc0cf097d24e4c6ce23dfa45f64304d20fb31d781d3b6a2107c28391057b
MD5 fff331a77833f23830e335430f163cf3
BLAKE2b-256 bf173fd180629307c5dd6b782e097c85290ab28f54ad0c4c75536e016cfb41e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1.win32-py2.7.exe
Algorithm Hash digest
SHA256 d9253f5c59ce0c39991b1d8b8276c9f67dc819d3a673671e4111a9ff8e18a01c
MD5 77d76fde1171ddc6aff2daff10e9dc96
BLAKE2b-256 e18f05d154c0b52b60626b9074516b62e52c5c457ccf8842f5389a939c8166f0

See more details on using hashes here.

File details

Details for the file pymongo-2.1.win32-py2.6.msi.

File metadata

File hashes

Hashes for pymongo-2.1.win32-py2.6.msi
Algorithm Hash digest
SHA256 176bdf431764d4cfbfa990ab2f7775fe794df163d8c0785cab661b17e9768579
MD5 3cae48e0e347bdb1f0686802f34c726a
BLAKE2b-256 8b4ce75f0720b006155ec294011956fb430e406eecf8b8e8b6de9adc190950ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1.win32-py2.6.exe
Algorithm Hash digest
SHA256 d56320781a97df449758ba183f0d68acbf41620fcb34bb78f59c55ada4ad4693
MD5 34f5df16a600d47adc95e61f264925a5
BLAKE2b-256 3f168952d1ee16af4676568eb44426d187ed70ac1a4c07bef583b83207d2e833

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1.win32-py2.5.exe
Algorithm Hash digest
SHA256 9421dd3db3fa452bfbe4cabaf8b09af03b9bc7618f9dbf4d94ed14f019ac5b5d
MD5 d7d2d1435ce1cf134da3d27e0355ae7f
BLAKE2b-256 845ba4d70da5156796f08064a9d74e2c23cf076cd10de30074e9bae7fd001610

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1.win32-py2.4.exe
Algorithm Hash digest
SHA256 490e846386adf0104dcf8455eff19989cf4a8077fa0b3091c49805fefb1e7548
MD5 518ccdb5584aededa4f28c8a1e8ac1ca
BLAKE2b-256 f063c3ec7822f01705e5b466ebb04d74a2fb622bda934cd3b9464a023f002a87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.7-win-amd64.egg
Algorithm Hash digest
SHA256 e83fa9d8be63cad01ce470127f155da71e14c257e02e850f27349e15b2bae6b6
MD5 8c8970f25fe16e7ac978a03432d78959
BLAKE2b-256 e2a3fc744659cb70ab561a29a6f13b4123603a2a3c0e11f8aad99d946305a9e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.7-win32.egg
Algorithm Hash digest
SHA256 c177c3343858db69681d1ea4716c8d0f41dab5dd5e53edb280c12514ae07f850
MD5 57abb8a10e8d251990bcb59c882a8e61
BLAKE2b-256 040900e7febafb28a889fc80bd3b8c1fc548e4742bdeb994a5256cd93c2063ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.7-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 e7caa5f10ab7c1abdd9263571a189bdb9ce46ba3c9b91ea3ee008ea14875c9e1
MD5 4e0a7cc425f89741a5099981b3e4d470
BLAKE2b-256 8ace0f7acbe6b20d665a3dbfef067c53accfacbb72147398d22b6c30baa82901

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.7-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 d95b56fd18eef7ac3f33481598a6912fbab27d0da3344f84862f411238c3844a
MD5 38957417dda41d6503c4ffb0d3a2ab60
BLAKE2b-256 c5e4f3794f8a1ab4102a2232dba39472519a3680b8a262ade1ebc10c8cd731cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.6-win-amd64.egg
Algorithm Hash digest
SHA256 e6bdf2d9a6a7e3a3027cd6c95e3f14b99a1977536d773749b66cad219c0e7c6a
MD5 a76e0af7971c9c55831c3ef11704e8d2
BLAKE2b-256 b8110f26173f95f6f9ed98d90d280e65087cfc9e9e4e28fbf89a812c09ba1252

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.6-win32.egg
Algorithm Hash digest
SHA256 6720488169d45aeb429c5770bf305cf1011d42f957b5cd85e205ff3f6d1ca5bb
MD5 96201227d249847ae687d5efaff17339
BLAKE2b-256 3f1d53cb3da438e314927f30689c44eb3cd9a5baa153738046a99cdd1e384011

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.6-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 766030c4e57ecf196f98f176372603c94b46c8f8d8567db7b7722159470f1ed7
MD5 713bf1257f3dae43f8d713a71a399514
BLAKE2b-256 9115318029266222bd6aa423a20e833b1876925a40d14aa2ff40178c0dbf26c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.6-macosx-10.6-universal.egg
Algorithm Hash digest
SHA256 3b5983e618e01b653cb7f93f625804870ab5c98d3380bb3b674a23a52a919411
MD5 416cbea124a8d9edd8b517672314bd1c
BLAKE2b-256 b417792c302fa50cd748bc7105ac256f52155f0525ef496edda4bb475a8deb3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.5-win32.egg
Algorithm Hash digest
SHA256 8b68456a7a2c11b57928160bc1afb00af5bd92b37d5a1675a17f599ddd020c94
MD5 a29044ededd81f294378fedb11b26fb4
BLAKE2b-256 5e4c75e78656114e72b12b2aeacf7a6fa449096da4472a03324e2b2cd97d4047

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.5-macosx-10.7-x86_64.egg
Algorithm Hash digest
SHA256 31f0c8197d704250872e9a3abbecf50a544bd0ef20dc7e8cec2a164a57fa0f41
MD5 9fd6aad6e4e7bff1972726da53483843
BLAKE2b-256 d3570963123487567a93710ce9dc5d61b2bbafd53262535d3059dac7cadce3a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.5-macosx-10.6-i386.egg
Algorithm Hash digest
SHA256 0c54f35b8acbb903a90dc07614e98f41da92d0d02d66e14c4ab477fdf8405bc9
MD5 eb565b6500cb1a5e6212c3be699d20ce
BLAKE2b-256 0365efa4339ad8bf7cce313f756abc46fbfed8b169097bd78c6a57c1338ac44a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymongo-2.1-py2.4-win32.egg
Algorithm Hash digest
SHA256 1cd78beab280400c83d5874cba01c17ff003096fedff514235e10d2d91e1ec85
MD5 a1e802afe5a5db16f31736124dfd9659
BLAKE2b-256 9a78a97b828cc79046d4d2877416a74e6a42f211f8e31acb4dcc879c3267246f

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