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.6.1.win-amd64-py3.3.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71fabd4b15146975960c2edc08652ef49d06fb3ddf5da750c3f260fbcab71862 |
|
MD5 | d77e979d65fd1c36b12be9c79ebfbfc2 |
|
BLAKE2b-256 | f29ee79eef90bf5989db1d715c7659841aec797725d70e696a8b0e5e93390c7a |
Hashes for pymongo-2.6.1.win-amd64-py3.2.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | d65fb9e6f2ea729723c4db320e5979734612460fdbcccdd446b6c9d012236ef6 |
|
MD5 | 97b51d0abdc8c4d92ef7b1af88249efa |
|
BLAKE2b-256 | 5cdd0b16be14fe527907741da8e1f1d1918b356f65160a8e19581e1cd351956f |
Hashes for pymongo-2.6.1.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58513d8ed6c49ed7c43c308f6b6fb53bb12560feb33a38b66f232b25ec4683b7 |
|
MD5 | 7218fdc68d3091346c4fac7ecb8ae2e5 |
|
BLAKE2b-256 | 769a0cce577cd72e37c017b01657f5bb121d6caef49f044b35702eef233252eb |
Hashes for pymongo-2.6.1.win-amd64-py2.6.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9c9ea9d74d412e782465db94da0904e1275e470deeb609b4f75a621a4dc41d3 |
|
MD5 | 5ffd0ee69d76acca8679c8a13f9af8ca |
|
BLAKE2b-256 | ecda08504bf6428ce4b3a675da862e2ac7b8577b733eacf9939cd8182db81240 |
Hashes for pymongo-2.6.1-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0cb6bbf499004818bc0dc70588bbab73773d26f667633d20abe9e12fb629865 |
|
MD5 | b6fac53132eb16c6feec5964d928023a |
|
BLAKE2b-256 | 64499de1e2473b683b7f25309ab29bddefd2843f02a2c97a02f2049ca4fc6e28 |
Hashes for pymongo-2.6.1-py3.3-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a77786ba17a89f2e330b40b87fa03ae6a5aa931552a0b10f234ff07ce99c48f8 |
|
MD5 | e4c15975c81f299e7d181faca407061d |
|
BLAKE2b-256 | 220226b303ce925c3dd33978e8ab921af6764ad0240bec882e4cb829f6427e79 |
Hashes for pymongo-2.6.1-py3.2-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb1f03221cbeab9b31007b41abbb45eb24055485e44e2ad02500156c82b66858 |
|
MD5 | 55808614a7332eb5dd4710c9232c075c |
|
BLAKE2b-256 | 281686cca4cd77f2da0f90e56b41c0c6f76c8cba633c3e523ac7ea0ffe4276d4 |
Hashes for pymongo-2.6.1-py3.2-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45cfaf1a2d80ea5188d9e82b65ea115f8172ff3603e966d3e90c153553eb7409 |
|
MD5 | 6a1518d36617b3e4ded648af32e59843 |
|
BLAKE2b-256 | 96ff9e5c281b522d9e67accc9ef0b173f8a2d13aebf7d9db189c7464cd969c13 |
Hashes for pymongo-2.6.1-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd7951fa91fa41829cfa2c2ca2311a2f9d286d805a79b2e89f089403173fe883 |
|
MD5 | d91e95a9d84dd1de556166685e49fff1 |
|
BLAKE2b-256 | 8fa70ccdcb9dfb323559bbc79622bc5769f6994a08a324de9d1d1d36b038b731 |
Hashes for pymongo-2.6.1-py2.7-macosx-10.8-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58a0fa60379f78f9b04efdab658885c97bd9716358fa394a9c4450ba42aaa6ff |
|
MD5 | 20312f069dcfc7348168d2857aa118c0 |
|
BLAKE2b-256 | aca7f53d872a17789007df81d0b3e0939cd35ba7b634ab8b849df4226bbf0b61 |
Hashes for pymongo-2.6.1-py2.7-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0b2a7dc99fd1bb82b31b37fa7affa731bad9d2c633dc984b2ef74f24310a652 |
|
MD5 | e45450a5137cdd05fa1d88ac75751118 |
|
BLAKE2b-256 | 6f51bca882f555e99c8ba99f15d0a6ca3751a5007fc9a1dfca09f868ff916864 |
Hashes for pymongo-2.6.1-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68edcc124e9c8f0600fdfd4dda0ee97113f73dc8f1cf02846f9b4ea8fbfd2353 |
|
MD5 | 69400197b1b6d092b320fa497bdb1e2f |
|
BLAKE2b-256 | 328b053402f19d7b8d4638a2bf1da78ca8c7516ae7b15f7fe9e7b40d544d314a |
Hashes for pymongo-2.6.1-py2.6-macosx-10.8-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6720ccca40e64628096b41717c56f38cf630f1c62c669ad505adfe1c708195d2 |
|
MD5 | 049f68d6188067ac33cb9e152c538c0a |
|
BLAKE2b-256 | d589c23e0e390b3e78fd4ec150a10c45a4f2f7c8c5018d281a65714f241bef21 |
Hashes for pymongo-2.6.1-py2.6-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56bde87b6d63f8d06abe2378f30cb646fdbe27f0bb1d22e6fcf6ac31e2c86333 |
|
MD5 | 57bd72d399c2b5a764026f7492d17f57 |
|
BLAKE2b-256 | c0efe1e03c30b1cbfe55576a03d8783044caa980f9864fb3c818feb0d802773f |
Hashes for pymongo-2.6.1-py2.5-macosx-10.8-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf7c5487593b81de1979182f1d9020fad6ea34c3edee52b23de6d03b37adbe7 |
|
MD5 | d7e226fd16f85c517adea0d72c7fbfcf |
|
BLAKE2b-256 | 52380b6d25253bc459c367e70b4be1180db5017a70ed5987e619c28210cd263f |
Hashes for pymongo-2.6.1-py2.5-macosx-10.7-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7a0fb9b03fdb807a46b57bc51c2d1c5f2f92d405c54e45bbb95cecdb0581e3e |
|
MD5 | b150383ce5e9fbdab722c1b4ba05a0b8 |
|
BLAKE2b-256 | 02de71069e85beaa300141dcbd40028163092b7e4f380f6aa524d0c13953ebc7 |