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@mongodb.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.
Support / Feedback
For issues with, questions about, or feedback for PyMongo, please look into our support channels. Please do not email any of the PyMongo developers directly with issues or questions - you’re more likely to get an answer on the mongodb-user list on Google Groups.
Bugs / Feature Requests
Think you’ve found a bug? Want to see a new feature in PyMongo? Please open a case in our issue management tool, JIRA:
Navigate to the PYTHON project.
Click Create Issue - Please provide as much information as possible about the issue type and how to reproduce it.
Bug reports in JIRA for all driver projects (i.e. PYTHON, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are public.
How To Ask For Help
Please include all of the following information when opening an issue:
Detailed steps to reproduce the problem, including full traceback, if possible.
The exact python version used, with patch level:
$ python -c "import sys; print(sys.version)"
The exact version of PyMongo used, with patch level:
$ python -c "import pymongo; print(pymongo.version); print(pymongo.has_c())"
The operating system and version (e.g. Windows 7, OSX 10.8, …)
Web framework or asynchronous network library used, if any, with version (e.g. Django 1.7, mod_wsgi 4.3.0, gevent 1.0.1, Tornado 4.0.2, …)
Security Vulnerabilities
If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.
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.
Do not install the “bson” package. PyMongo comes with its own bson package; doing “easy_install bson” installs a third-party package that is incompatible with PyMongo.
Dependencies
The PyMongo distribution is supported and tested on Python 2.x (where x >= 4) and Python 3.x (where x >= 1). PyMongo versions <= 1.3 also supported Python 2.3, but that is no longer supported.
Additional dependencies are:
Examples
Here’s a basic example (for more see the examples section of the docs):
>>> import pymongo
>>> client = pymongo.MongoClient("localhost", 27017)
>>> db = client.test
>>> db.name
u'test'
>>> db.my_collection
Collection(Database(MongoClient('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.8-py3.4-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | d26765a1e8389343199c05c6a2bc96f0b5a3b16ae5745fd849f3ae1f7314c999 |
|
MD5 | 3b2ba862b1b3e9b5f5a55d553101df77 |
|
BLAKE2b-256 | 62ea64e207b8b18221597e87a5e3e0137c2a7e0a965c90f171ba61f7cbb53c4f |
Hashes for pymongo-2.8-py3.3-macosx-10.6-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba5c4b4b91aba994e330bb4f36f3d63a8aff662684abc56d8c7ab0c5a0002c15 |
|
MD5 | e8d17f02b65c0ff482dad4001a2d3af1 |
|
BLAKE2b-256 | d0d41c344585e70dc87f6b879fc7bbccd8f7b374408e253c839c0e1e2fb503ce |
Hashes for pymongo-2.8-py3.2-macosx-10.6-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5a6c33f8097d1c7e955754871163ad824b040d7e3a38a5de33504f5733a8eb9 |
|
MD5 | 9a6d55a495166b6fe38df794ed0602ce |
|
BLAKE2b-256 | d4aea0c8eccaf39dea2ef0cfeb8d5a5543d5aecc2dad6e03a71254b855d2c140 |
Hashes for pymongo-2.8-py2.7-macosx-10.10-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2977640df42ee4b359009586917e9ae43a00c781dc083e2e3509623e9a63514f |
|
MD5 | f24c1350f06faf18e5059ef40b147468 |
|
BLAKE2b-256 | 24938c630f331c7f04ae38cde1fd32154566a1edcbddfef2c382ee1ae154e974 |
Hashes for pymongo-2.8-py2.7-macosx-10.9-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec7bce08532ef294cec0210091fa5a5d1065f4956e7700315c19362ed91286b9 |
|
MD5 | 6e775831cda9b550f6a3c0341ca6c1f1 |
|
BLAKE2b-256 | 7b0fa618be6b07852a0489329dcadb53d019b72051d88a287af93baff8090f6f |
Hashes for pymongo-2.8-py2.7-macosx-10.8-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c513933616c25ac67856f3c5278e34008e2f405e8f14eed1bea3ac24fbda2ef0 |
|
MD5 | bed5b42c03262ff9ab2ad82ff1d2a726 |
|
BLAKE2b-256 | 2f101b854c2fb9eaec3d297f3a7e3e4a129b9c27576e364effc869fcfc0ca5af |
Hashes for pymongo-2.8-py2.6-macosx-10.10-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d0cdf4319d36f567bc9d6ad9d61ae28986c2e7a42b307ce19460e39ed95cf5d |
|
MD5 | fa5699d9d59742c73b6c01d7a4c8f6b1 |
|
BLAKE2b-256 | fe01faa7810ff39a34bf1730c8d6743e706958dd4cbbdd20191ed5b9a4d3e8cd |
Hashes for pymongo-2.8-py2.6-macosx-10.9-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 582d6501f087d8421c58190e840799e7734fac2aabd1d016e2e1e21bbf1581cf |
|
MD5 | ecda0bc9b78de8f8c910020ee2304eb7 |
|
BLAKE2b-256 | 988f432d027109a3010f574ae91f7228700dc6509d6d0f6a5f1119cd12defa91 |
Hashes for pymongo-2.8-py2.6-macosx-10.8-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f14c0636eda28412ebb2e583cc1453b65c44ead96bf0381c0d49bb63162f7712 |
|
MD5 | 8d44334e3378d1cae55eb289629fbe77 |
|
BLAKE2b-256 | 3491f9ca22dab60b36e830ba48ed53e69fac6485dba74abbf655ff27cfd243dd |
Hashes for pymongo-2.8-py2.5-macosx-10.9-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d96aaac7806697648443922770dce6a49d9d46f7ae1e71ea87485321ec55adb |
|
MD5 | c438a421f4a84dd378100604708605b0 |
|
BLAKE2b-256 | bc0df076b5bb2acfcc8f2102f6c5cf4c5319aaceebba9899a323c18162fbbd64 |
Hashes for pymongo-2.8-py2.5-macosx-10.8-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1443b59a7fcfa5db732a19c077057dd8dc65836d0eb951fc0db2731cffa30ee |
|
MD5 | abdf75d5c6bc5a0f7bcde5f5c2ffce71 |
|
BLAKE2b-256 | fca937f8b6370e563894635da1f9dfa4739da94f04225c874c2ae0cd1633d76f |
Hashes for pymongo-2.8-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea57ecaa11b912f2b0339de3b59b27971c7315623f28fb368fd2ccaa35f8c8c8 |
|
MD5 | 103252f8d209aecdf949c4a7b2265643 |
|
BLAKE2b-256 | da454919c33891716ae7792e9b6528b050a0962ab8da8e149823f3f7b78f012d |
Hashes for pymongo-2.8-cp34-cp34m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39e014abb53ed5ef302b69a07b1e6c6ef1d7395af15283001148949ce9676c2f |
|
MD5 | 8e3ff1c48c504fa30b8f34d1991ad455 |
|
BLAKE2b-256 | 665f475b41dda347f99ff1479de4b23287ef52d1921c75987e788c9e2bfee5fb |
Hashes for pymongo-2.8-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28d06f38fb8b20df792c3436724041c330902f3bfdfaa71e6e5825a00f328179 |
|
MD5 | 7585182756f0a62be62eb17d1b9239cc |
|
BLAKE2b-256 | 2c17a3e4e75269f83588370cb4993d37abc45f125a3ab92fe4aeb3067f064866 |
Hashes for pymongo-2.8-cp33-cp33m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1108c3f21541b03d1a8ff49daea5cdbf76da75ff9c09057d8cb0b16c17933ef1 |
|
MD5 | d00cc91ecd6c7c9360b5e6db063e7a49 |
|
BLAKE2b-256 | 89e72e7836c11e4424442f7f7fa04ccb4fb9b58719c2184e35961aa0be437e83 |
Hashes for pymongo-2.8-cp32-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 751918b7dc3bbbc05c071073a50e85a4a265fe5ca2d6ed939d65c1403a0701b0 |
|
MD5 | 21ca96c9af8735278c9763f4e737ef62 |
|
BLAKE2b-256 | 1a8b109f8b19d3a9ed38aca100f5607608b9991840e78847677edb4cdd9a33bf |
Hashes for pymongo-2.8-cp32-cp32m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8a60148a665ff8287559e8fb3835cc144256ee708e3afd3bfa9f23766350af7 |
|
MD5 | f10f308052860f56b6561e6e85f7f5f7 |
|
BLAKE2b-256 | 2ac673dc6fe30d9ec673e0c18a7d6e680f76c94e787e5c355d9f3eda6ee427a6 |
Hashes for pymongo-2.8-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a99b554bbeb2f3c8b2df793f187f5c969a3871aa613abd93cc3280c353573dd1 |
|
MD5 | 5c4e328e0584b1221e2c7c4d624b18f3 |
|
BLAKE2b-256 | 974f01d65b04f946d2fcee0ca644c3ca83f054dc2c44cffebc7a374496cdacb7 |
Hashes for pymongo-2.8-cp27-none-macosx_10_10_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7483795284e961e33f78637936b14dd99fdc4c004ffdcbdec9b0e5017a7e7bf |
|
MD5 | 4539ae69c1670c9e896a57e0119b8892 |
|
BLAKE2b-256 | 5f99693c1bf974d51501ee6c349153fa2a92790ec3ecab260f8a005a159165df |
Hashes for pymongo-2.8-cp27-none-macosx_10_9_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91bd48766b99094f646ebf34b35055aa2660d6c1fee7b8d5102ee838213f9387 |
|
MD5 | 59c2e650d31037e2162c71bf7c3a0a5f |
|
BLAKE2b-256 | d4d7213c7c0540883d67dd3259a2e14ed60368629eaadceb699e5aac68164791 |
Hashes for pymongo-2.8-cp27-none-macosx_10_8_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65e217533c332a85dfe58e0fc1f44521103f030f97e5429499e0c880f50b666d |
|
MD5 | 37a87f08a29ccc59904c831abe0e9934 |
|
BLAKE2b-256 | b6765cb98e2ddf07eeaf2e37d612f7f8f8d3f390570f97d52f0950fb562182f5 |
Hashes for pymongo-2.8-cp26-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e410bfbfc880d63c608c48a787db46284e68642197068855ef1dfc5ff2771b01 |
|
MD5 | a7deab4f3509f2dfcbc37c02d7c2bacf |
|
BLAKE2b-256 | f7637f31cea9f2ebec6b6956c0fb4b53dd277d8fdafb8157cf1fe0057d3d3ae0 |
Hashes for pymongo-2.8-cp26-none-macosx_10_10_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bc017a05f95e6bcb281cc64386822af484f04e8e74a2eb2351c96615a97490f |
|
MD5 | 66e7319d9bdccd9f0bd76968287188f9 |
|
BLAKE2b-256 | a49764449ff6c6d28bdd4b1a8e65d7b96fe3e5263bfc9de9f7f63f2f59c03bc3 |
Hashes for pymongo-2.8-cp26-none-macosx_10_9_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf8d4cb28188705da876eb64adacf5c582769dd7c96425e8aaba3e0d6e2d9e77 |
|
MD5 | 5679dc24f81851092dc7bf561e77dc82 |
|
BLAKE2b-256 | d235d539d31133a8dd2a83cd1bff0152dd46c2f6f3607e52304ad49fab369eff |
Hashes for pymongo-2.8-cp26-none-macosx_10_8_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f06963ac44d5d8110cf7a3602c990f9196c06160b73a58bf54285667e71d9a22 |
|
MD5 | c3a5babb9205da7a8f0a724cd350caa9 |
|
BLAKE2b-256 | 8956dfca895ad655443cf6837663193a0876b61f95af1fd7e7a3d7d06d00bcca |