Python driver for MongoDB <http://www.mongodb.org>
Project description
=======
PyMongo
=======
:Info: See `the mongo site <http://www.mongodb.org>`_ for more information. See `github <http://github.com/mongodb/mongo-python-driver/tree>`_ 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 <http://bsonspec.org>`_ for Python. The ``pymongo``
package is a native Python driver for MongoDB. The ``gridfs`` package
is a `gridfs
<http://www.mongodb.org/display/DOCS/GridFS+Specification>`_
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
<http://jira.mongodb.org>`_. 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
<http://packages.python.org/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. If you need to
use Python 2.3 please contact us.
Additional dependencies are:
- (to generate documentation) sphinx_
- (to auto-discover tests) `nose <http://somethingaboutorange.com/mrl/projects/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
<http://somethingaboutorange.com/mrl/projects/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.
.. _sphinx: http://sphinx.pocoo.org/
PyMongo
=======
:Info: See `the mongo site <http://www.mongodb.org>`_ for more information. See `github <http://github.com/mongodb/mongo-python-driver/tree>`_ 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 <http://bsonspec.org>`_ for Python. The ``pymongo``
package is a native Python driver for MongoDB. The ``gridfs`` package
is a `gridfs
<http://www.mongodb.org/display/DOCS/GridFS+Specification>`_
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
<http://jira.mongodb.org>`_. 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
<http://packages.python.org/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. If you need to
use Python 2.3 please contact us.
Additional dependencies are:
- (to generate documentation) sphinx_
- (to auto-discover tests) `nose <http://somethingaboutorange.com/mrl/projects/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
<http://somethingaboutorange.com/mrl/projects/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.
.. _sphinx: http://sphinx.pocoo.org/
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
pymongo-2.2.tar.gz
(228.8 kB
view hashes)
Built Distributions
pymongo-2.2.win-amd64-py3.2.exe
(359.4 kB
view hashes)
pymongo-2.2.win-amd64-py2.7.exe
(358.8 kB
view hashes)
pymongo-2.2.win-amd64-py2.6.exe
(358.8 kB
view hashes)
pymongo-2.2.win32-py3.2.exe
(329.8 kB
view hashes)
pymongo-2.2.win32-py2.7.exe
(330.0 kB
view hashes)
pymongo-2.2.win32-py2.6.exe
(330.0 kB
view hashes)
pymongo-2.2.win32-py2.5.exe
(196.4 kB
view hashes)
pymongo-2.2.win32-py2.4.exe
(196.4 kB
view hashes)
pymongo-2.2-py3.2-win-amd64.egg
(262.1 kB
view hashes)
pymongo-2.2-py3.2-win32.egg
(260.5 kB
view hashes)
pymongo-2.2-py3.2-macosx-10.3-fat.egg
(280.8 kB
view hashes)
pymongo-2.2-py2.7-win-amd64.egg
(258.5 kB
view hashes)
pymongo-2.2-py2.7-win32.egg
(257.2 kB
view hashes)
pymongo-2.2-py2.6-win-amd64.egg
(259.0 kB
view hashes)
pymongo-2.2-py2.6-win32.egg
(257.7 kB
view hashes)
pymongo-2.2-py2.5-win32.egg
(258.9 kB
view hashes)
pymongo-2.2-py2.4-win32.egg
(261.7 kB
view hashes)
Close
Hashes for pymongo-2.2-py3.2-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a8edd8a0719e564b641e09dfb4fe63f221e5315cc9a2867cf704462ced93c2b |
|
MD5 | 1e709eaf13edae19dd5fb132e3ed948b |
|
BLAKE2b-256 | f7632353f8808a93c087b8c3fa08d56118923db024c6e2ebaa8223ea6119dfb1 |
Close
Hashes for pymongo-2.2-py3.2-macosx-10.3-fat.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbb15d68a8b20f84037424230bdb2f3c104c03b524462d3f3aeab0a96b9a062e |
|
MD5 | a753fcfc7ce66adb2838da5827be67c8 |
|
BLAKE2b-256 | 25e99ccd20809651232c13cecc7f97f9b638c3603f6671d6226cf2058158aacd |
Close
Hashes for pymongo-2.2-py2.7-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6381ae94b8bbb65a0bb5617af87edebecb09506bb46508473195fd21d0856119 |
|
MD5 | 644c4e381f3293bf626364d1dbd6c23e |
|
BLAKE2b-256 | 6a6517bb2ec639fa4adf769297569744fadbeb16cafabe8377709f8a47b1a811 |
Close
Hashes for pymongo-2.2-py2.7-macosx-10.6-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddf498fe62cfe9418db7b311f073f71c67d5760f9cfcb4915406f948c57fd628 |
|
MD5 | 380c0cc00970faecc630ba3fcd47f98e |
|
BLAKE2b-256 | db00f63497d010c007b4a8a747b4c5a829d178b675d934fbe6474253ed61087c |
Close
Hashes for pymongo-2.2-py2.6-macosx-10.7-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f72ee5c68e6f890a612235659b63104193e579eef31c9a31b4aa025bd73bb3 |
|
MD5 | 75124de2efe7c7935a8a5d9ce339bc4b |
|
BLAKE2b-256 | 215b7fceb1301bfa55bc157bad2cbe023ae6aad3f13f0cf456467059d7d4e6ba |
Close
Hashes for pymongo-2.2-py2.6-macosx-10.6-universal.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb4ca0b3d65530826afbad5a824a9e5be74608b882d86bc65ba0ac29a89158db |
|
MD5 | 35975c17c2e30fdc4054d8680cd34bf6 |
|
BLAKE2b-256 | 0b4010b6fefbd0bbb1ae64af803e049167f68a01c85ac376b6d4df8c8dfd5d51 |
Close
Hashes for pymongo-2.2-py2.5-macosx-10.7-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4eff2154134fbb14676fcd24a6a4c47cc8bb35f386cee7a628bb3aea780361d |
|
MD5 | 41c5bca136a5f05ee5e48ba5258aaff5 |
|
BLAKE2b-256 | ef4d0b38e5148d0bb5610ff628e8bfccca8a09dfc7d54cd538b371a6a2046401 |
Close
Hashes for pymongo-2.2-py2.5-macosx-10.6-i386.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1282e881f7227d2f90ae4fc42af47092a299f245a5a3de8f7d5e4d36fcbebd2 |
|
MD5 | c4d39bc79301a45d866cb33af463f9b5 |
|
BLAKE2b-256 | a334d31bc2e5c5ec1b0853def61d22016298db50c09bf7c83436ab648232ae55 |