Python driver for MongoDB <http://www.mongodb.org>
Project description
- Info:
See the mongo site for more information. See github for the latest source.
- 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:
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
Built Distributions
Hashes for pymongo-2.1.1.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ec4103d6e66b81ded778cb652aa2ad59bb34aaa5401e1de1ddd618716a7aeda |
|
MD5 | 2bdcad8f1cfb0ed9358ebbb869e3cf4c |
|
BLAKE2b-256 | 9a21730b895d95d518b47b7d0c0afe37967460bd8a3fe74c7e688ff711c823c9 |
Hashes for pymongo-2.1.1.win-amd64-py2.6.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cb0bb8089687fbe97325b39686b55812427c46bf6ab0756144746e64d29d865 |
|
MD5 | c2a0a7fe0c4f4de3272d0d2a9f4b19cd |
|
BLAKE2b-256 | afe61e59a70a12ed163110d947d7e1e672b5beb106eec770469d3eab501c4496 |
Hashes for pymongo-2.1.1-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3da17a9bc7c6aeefb001101aaec0ae6713c213a377f0333c586a4e6808ce9c29 |
|
MD5 | 8aa50db969aa6eb8a92af9a740429dc1 |
|
BLAKE2b-256 | 59417a02622fc2cb0004a397e7008fef052e11e56144713b77fe7f83de48cd02 |
Hashes for pymongo-2.1.1-py2.7-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f34799824b2ce40ea8615c7c1def1d753ffd9170a01d2b57d34d82b3abd163ab |
|
MD5 | a40ddafb3a4ab1222572b2445e6d0842 |
|
BLAKE2b-256 | 9eb18a4db0e280acb2466ff6c7734366f83444b45ef9ef7b65ae76a854a5fd9f |
Hashes for pymongo-2.1.1-py2.7-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b4f985e1867a529482f6f4983c73b56650a112431029e042e1ebb407cd6f9a2 |
|
MD5 | a7c1f275acdb0a9dd9ad12e779778dce |
|
BLAKE2b-256 | ae09e0aa226b3f72980ac0902353124078275b3adbf4fa709e16bbfe41f1cd30 |
Hashes for pymongo-2.1.1-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8a695875b8011491a7264886671d8e10b9e2eff6c8de74864911560ad5f2ca0 |
|
MD5 | 3a95378c27108909ed21963ed1205db8 |
|
BLAKE2b-256 | 6649a2ea1f7a930d64783a09278d43201cffb939fb61523e774aa2ab104e0970 |
Hashes for pymongo-2.1.1-py2.6-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45e661bf5521abb833f0fd4cac28f2046e61fefa46250868f3fa1957f6d5d634 |
|
MD5 | e242b67e2643edc31db0851858f28839 |
|
BLAKE2b-256 | d31f31868d332db126bcc6fdd40aa964cc5b1f55b991dfed76d63274fea15016 |
Hashes for pymongo-2.1.1-py2.6-macosx-10.6-universal.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01d3f48dae448eb1d89d537f013bbaca7ba6a1c9e7d03d26f175ef057180cc02 |
|
MD5 | a34241c1fa1290fad2fe206266a9fdb4 |
|
BLAKE2b-256 | 0ed706e915245a1223dba68e0c598f0fb5c2cee64559ae1debae429f5efaf440 |
Hashes for pymongo-2.1.1-py2.5-macosx-10.7-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e16ae32ddcdee0df56ab2697acb8efcb6a6e66da7c62da7970a6617e3b7b7c71 |
|
MD5 | b8cb1450c2a99ea25c3ab29dfc32ea5c |
|
BLAKE2b-256 | 244af8b0bddfbe827ffb47e5494a2eae80f3f389a23d9e52a80507e6bd9f8078 |
Hashes for pymongo-2.1.1-py2.5-macosx-10.6-i386.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91ca4cf1b0c10788b0061ffd1f09221681f6bfaf1426a59e5d8a0e56dd2a7bc0 |
|
MD5 | 2be719e582780beb43c92df5d00adbf1 |
|
BLAKE2b-256 | d29e88f8603de32db74cf8ac284bdd0e215999049a9215ec92f9725fb387e172 |