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 distribute 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) 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.5.1.win-amd64-py3.3.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2977b7fd36643ca5ab6b0602af959d4db8f6d18fc5aed2ea819b2c0e72fb7dfc |
|
MD5 | 8c636fe9b7d36c8ceac26f1b2a36a64c |
|
BLAKE2b-256 | ccfdfd54e24102fe675f4b50d221300d721f07e473a14df7e1023d8b1db1dad7 |
Hashes for pymongo-2.5.1.win-amd64-py3.2.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | b01e8f8476fdc9a92ef6bbd61c0e31019fb2b48d23e9191a30cfa56ce56dde3d |
|
MD5 | 489946d7092eb04bd8ad6c7496ca4d94 |
|
BLAKE2b-256 | 6b6965240bea0c8878803a13c05179ec13b0f70a85d8ce7811b7497d8cd49165 |
Hashes for pymongo-2.5.1.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 615ff50361f7802907299631bd4b4c530818295218c1db9264b03b1b3d6ebad6 |
|
MD5 | 532d030ad37abddd75c86bb2a48c1cc6 |
|
BLAKE2b-256 | 0ce094ea84807768013b8e65c4c0205167d34e6f0663696d7ad58113bffb077c |
Hashes for pymongo-2.5.1.win-amd64-py2.6.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87cd0f73297b8aa0fa7f42abfd3e437bae199f5851d62317d5b9ff4753b8b498 |
|
MD5 | 6857b030976141b1f3eeeae64e5e5d92 |
|
BLAKE2b-256 | d54b3050b7f6d8618a05733970057a781e64480b9c022f934557c7c36f4b87b1 |
Hashes for pymongo-2.5.1-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c71570e42094de07784e82cab9f6c5db71da259246a5e09e87ff3df3d755ee1e |
|
MD5 | 33a8c267dc28eeef412387040771fc39 |
|
BLAKE2b-256 | 544260693260d76f5912b9d2927bc885b772ffd2944ebc93517001129680908a |
Hashes for pymongo-2.5.1-py3.3-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | b348f8eab6722b4b2197f00e85090ba3a0f82f2c39e5beb7733e416d16c5087e |
|
MD5 | 2a06f3926293a20800c4b2c35183d017 |
|
BLAKE2b-256 | cc502678246624b5258c6c4c36ffeb60f2d1ca1bd8a10b23f68c3a1e20f7d8a9 |
Hashes for pymongo-2.5.1-py3.3-macosx-10.5-fat.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7449ddbcb19da124356cd98da6f5293bceb5180e463ed6a5fdb96c67b7a2b9fe |
|
MD5 | f5ed2d3fd80059e5827e2ee1bf726ea8 |
|
BLAKE2b-256 | 7810be6cd0d762b21dd01377331b245da52e5c2ff268bbf931cda70d6cf07aec |
Hashes for pymongo-2.5.1-py3.2-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fce53c0ceeee2270c25560650d001e43e10d6d8f3001884533c6d7481038a3d |
|
MD5 | d7f06f5341190d3d2850dbda304dd5d0 |
|
BLAKE2b-256 | cc67712562239e43a2b9fba924d55ce6c4df1f56b19b17730e7c22820d646e39 |
Hashes for pymongo-2.5.1-py3.2-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fbf27763234c04eaa02644229b2b0725b0cfce16c1c1132c1a0a57fc2f78250 |
|
MD5 | 470d42b13cce08d174581be76fc4ec12 |
|
BLAKE2b-256 | 4ab54ef89ea596043bb3088c8199278ab894695d06d39cb38673e871808e7da6 |
Hashes for pymongo-2.5.1-py3.2-macosx-10.3-fat.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | abb02a3683fd44f053b048ced8a353754052e2931246d0c78cca79400bc873a2 |
|
MD5 | 1b654adf2063ddc77679495506ce0528 |
|
BLAKE2b-256 | 2c1028a1419db8bcb29232d556b78821e1b4fba968598ee4d826f749ce7b5d02 |
Hashes for pymongo-2.5.1-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a377b2e6213720ddb7e9d70e76f733c1f39145e3ca1310f4cfa164173f28480e |
|
MD5 | 1000b9af993d91688fbb2c7c399817de |
|
BLAKE2b-256 | 093136b6758fd1e026300c3b65e3ca56f6cc5445f3b61ddab8362f05cc20154c |
Hashes for pymongo-2.5.1-py2.7-macosx-10.8-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 839f115730b6f0bfb7c59f4b0fc57433b81ef6b7ffbc34a9127eadfb55a48bc3 |
|
MD5 | 19a27fab33ca644d433c76b2323e37ab |
|
BLAKE2b-256 | e7779576f6d902288249121a8d016a64ec0e3bff6d4760a92b471192d260e012 |
Hashes for pymongo-2.5.1-py2.7-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4541a77c9752ecae6aef5420c4ca63776ca47378feddf7ad19605bd10640ba20 |
|
MD5 | aed55156da6fd92ef7c9687a69f05004 |
|
BLAKE2b-256 | d8692b9de86e5549054c6f15fc16abe016a78c0d744608560f2a86be522a90cf |
Hashes for pymongo-2.5.1-py2.7-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3782ed317a22897aed4ad1e5408f6691cab135b9664e0f3fc0df9fb3cb4c9037 |
|
MD5 | a460007a893e4395f1e8cd001737c123 |
|
BLAKE2b-256 | cd2b9fd6e754a35a662190109413e24714ff8aac7f9ba5f2dbb1068031d9172b |
Hashes for pymongo-2.5.1-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a66ed06504fa81a8367e13ffd3401cb783a9447f82cd72e28447eb1d4679ebd |
|
MD5 | c77bbd1ec484cecd15e549e9fded7a23 |
|
BLAKE2b-256 | c46db8269f4c223cab37eff922ee8a21e7e398612aae15cccaa24528b9b33ac9 |
Hashes for pymongo-2.5.1-py2.6-macosx-10.8-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7952da521b8c563217c8027dd77f71ee266ddf21434a9e846b9458bdca1d1643 |
|
MD5 | e3bb5684206238f50e39a682ee63ed85 |
|
BLAKE2b-256 | 657c9c900092d25f385bcbe87b9f92a8508e67250327e4ab29c8cdd6c798f59c |
Hashes for pymongo-2.5.1-py2.6-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 366d7d4f900b515055dafbf7f771925caccfd76e5c39b76e88575902be21e971 |
|
MD5 | 5927b20114e261f47df9c128bfe1ca56 |
|
BLAKE2b-256 | f23eb54f0458a1cd625c98cc61dfb8937a17917e50be6a27b95e562a7966c716 |
Hashes for pymongo-2.5.1-py2.6-macosx-10.6-universal.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5be9b72e80404d309ee53fa32f5263e7b702e8cd1ad31a1d42c4b7fd50e15cb |
|
MD5 | 3fca5ce44721d6db5e3d1391ef08e64b |
|
BLAKE2b-256 | 30b3ae2ff57f4d12e0d78e2b04100deca3ffd7c99f7fd387bcceaadf5e9ad590 |
Hashes for pymongo-2.5.1-py2.5-macosx-10.8-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac0929967e11609f1dab630df26b304ce6912ef462ea3972811d8b259fac242c |
|
MD5 | f67293e4b49d524fb5f5f2857b1da9a3 |
|
BLAKE2b-256 | c33f7ddfb2e8028e120310525111a4ac151ee8d592266a082c4120c5a3df0070 |
Hashes for pymongo-2.5.1-py2.5-macosx-10.7-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52d10305bf97f7db4ccdd0646d79c0a9682191678a4bbbbc72334da9f8f4b43c |
|
MD5 | 043812aaacc517d12bbd137db38617a4 |
|
BLAKE2b-256 | 6f3af7e53221cc693833328b31aba7862b412aa94fc650b8d172e2891aa0669f |
Hashes for pymongo-2.5.1-py2.5-macosx-10.6-i386.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06cc12496cc5faca2f9676b50ad28cda2c5fc983af3b21b672903def1a3eecb7 |
|
MD5 | 98b222858e915141d4de85b4b394f501 |
|
BLAKE2b-256 | d161e16b79b52c7cb6e06c49611db1049850cddf86fd9903e9e9f6890327574d |