Skip to main content

Python driver for MongoDB <http://www.mongodb.org>

Project description

Info:

See the mongo site for more information. See github 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 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:

  • (to generate documentation) sphinx

  • (to auto-discover tests) 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 (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

This version

2.0

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.0.tar.gz (171.4 kB view details)

Uploaded Source

Built Distributions

pymongo-2.0.win-amd64-py2.7.exe (352.0 kB view details)

Uploaded Source

pymongo-2.0.win-amd64-py2.6.exe (352.0 kB view details)

Uploaded Source

pymongo-2.0.win32-py2.7.exe (322.3 kB view details)

Uploaded Source

pymongo-2.0.win32-py2.6.exe (322.3 kB view details)

Uploaded Source

pymongo-2.0.win32-py2.5.exe (189.8 kB view details)

Uploaded Source

pymongo-2.0.win32-py2.4.exe (189.8 kB view details)

Uploaded Source

pymongo-2.0-py2.7-win-amd64.egg (226.9 kB view details)

Uploaded Source

pymongo-2.0-py2.7-win32.egg (224.6 kB view details)

Uploaded Source

pymongo-2.0-py2.7-macosx-10.7-intel.egg (258.6 kB view details)

Uploaded Source

pymongo-2.0-py2.7-macosx-10.6-intel.egg (263.8 kB view details)

Uploaded Source

pymongo-2.0-py2.6-win-amd64.egg (227.2 kB view details)

Uploaded Source

pymongo-2.0-py2.6-win32.egg (225.0 kB view details)

Uploaded Source

pymongo-2.0-py2.6-macosx-10.7-intel.egg (259.0 kB view details)

Uploaded Source

pymongo-2.0-py2.6-macosx-10.6-universal.egg (290.5 kB view details)

Uploaded Source

pymongo-2.0-py2.5-win32.egg (227.4 kB view details)

Uploaded Source

pymongo-2.0-py2.5-macosx-10.7-x86_64.egg (226.4 kB view details)

Uploaded Source

pymongo-2.0-py2.5-macosx-10.6-i386.egg (225.7 kB view details)

Uploaded Source

pymongo-2.0-py2.4-win32.egg (229.2 kB view details)

Uploaded Source

pymongo-2.0-py2.4-macosx-10.6-i386.egg (231.1 kB view details)

Uploaded Source

File details

Details for the file pymongo-2.0.tar.gz.

File metadata

  • Download URL: pymongo-2.0.tar.gz
  • Upload date:
  • Size: 171.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymongo-2.0.tar.gz
Algorithm Hash digest
SHA256 7cc2583fc01ae40ff30da9842bf82257ce3e3037f7c3e634f59c2a414b83984e
MD5 8cd04065b115dd186b18cb3e8e3025c6
BLAKE2b-256 db3c19420705d15ab06c2e435b1d9b34bc7f2f5cf138c1523411716e47365008

See more details on using hashes here.

File details

Details for the file pymongo-2.0.win-amd64-py2.7.exe.

File metadata

File hashes

Hashes for pymongo-2.0.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 59cfa6acd50c30ed88c59393c31245765ff525904833c0da664e1ea0293a427d
MD5 e440677f7fa2aa3fdf404c1de50fa39c
BLAKE2b-256 64cf4507c18c5c9dd4c680ebb86e0a945df1f403f53ebdc464e911d2b5f7b846

See more details on using hashes here.

File details

Details for the file pymongo-2.0.win-amd64-py2.6.exe.

File metadata

File hashes

Hashes for pymongo-2.0.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 78e84a6a4d2a97b0dcb74c040730d143cfd3495b0157c7663ee83fd77dcd5adc
MD5 1919499d1e9c0cb9c71f8247080a6cbb
BLAKE2b-256 d6e3b988c0fa0971052a87b222f138bdf159befc04a673f93b01bd23daef1a52

See more details on using hashes here.

File details

Details for the file pymongo-2.0.win32-py2.7.exe.

File metadata

File hashes

Hashes for pymongo-2.0.win32-py2.7.exe
Algorithm Hash digest
SHA256 2fc12f51e858bcbe5a732033f96aa9aa9b573732defb7921922fa1078162277f
MD5 c5af831d702abeec8ef7f724cdcb26b4
BLAKE2b-256 f1e0ea1ef07979f923ee5aeeffc77fd2a1e64708c9c3a75536ab028600f7cbd9

See more details on using hashes here.

File details

Details for the file pymongo-2.0.win32-py2.6.exe.

File metadata

File hashes

Hashes for pymongo-2.0.win32-py2.6.exe
Algorithm Hash digest
SHA256 848f5f3866ac27cbc2b041543f989bf950dc212bce09ea1a287aae065338e7a7
MD5 1b8faddbd60fdcaf8f5171dbe31a4077
BLAKE2b-256 c0bfec791ed7c33c794841c586dde1fe52ac98b37cb9d12dbea0e085b0d2079a

See more details on using hashes here.

File details

Details for the file pymongo-2.0.win32-py2.5.exe.

File metadata

File hashes

Hashes for pymongo-2.0.win32-py2.5.exe
Algorithm Hash digest
SHA256 ca3634c83e790865e084162984dd7e24d861199ddf6c650e41387ccd5e4ca6b3
MD5 54bb8f7d4a606f37c517894bb2c6367c
BLAKE2b-256 1e630b68a5725156e920fcbf598746242586c06a664e0f687e4d65bd4bc52260

See more details on using hashes here.

File details

Details for the file pymongo-2.0.win32-py2.4.exe.

File metadata

File hashes

Hashes for pymongo-2.0.win32-py2.4.exe
Algorithm Hash digest
SHA256 10883c35161148a478325fbaa9304b847aff4f1a1f5b7043d818fdb42c72bc27
MD5 8f3aa18db8f279c5b4013611febc0dbf
BLAKE2b-256 6e183202dcdd12a5352bf8a4c29683537f614eff3c772c29a79cb1455d723eb9

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.7-win-amd64.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.7-win-amd64.egg
Algorithm Hash digest
SHA256 979099b4d845d2fb21794e70da8a9f45a0a39b6fa3f361c20f9cc196773c9104
MD5 aeb0b89cce9d30d3b54cf1f3e68dc081
BLAKE2b-256 a81091726a64ac0fcf4ac62e4a8fa48d075a28d5ec86553c772ed2ac47114e57

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.7-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.7-win32.egg
Algorithm Hash digest
SHA256 1c4f6891585c75bf586da74db465e922a6e2b13f55a43c7c2416aefd38dda0a9
MD5 cec6b53a3839015cbff3fc9e48b6e1f9
BLAKE2b-256 87ec81612f60c7315336e0dd591ff7a6fc8d4033beadb976aaf3a18602eae6cd

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.7-macosx-10.7-intel.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.7-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 15a9e862c8d477d342ad18e022ac06bedace8a445aecbbba97899ea35ace7779
MD5 59979b9e84224e9dc5a21e2a1f2f690e
BLAKE2b-256 1872ef6a2e937ffcd60f06e8b9e4928dcbb961d5f50f4e665d2c3a9e553adc01

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.7-macosx-10.6-intel.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.7-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 a3b0f396730af74aedb4264e0cde73627b6b31c5b7295a8febe1fc7fd27bf743
MD5 b8d63a0d9ac947821edb91d250143b29
BLAKE2b-256 ec87cde6ac68149cd52c74afd68847ee9fbe6e1aa1a7c6f69d3a50fec6173019

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.6-win-amd64.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.6-win-amd64.egg
Algorithm Hash digest
SHA256 0e51e04ddf647076db298297ad7dfcbb866e9d2a5285239a84598f6f845fbc11
MD5 630f0b8362881c103e4ef500134dc3fb
BLAKE2b-256 07767346efa81d0412dce894e2236395dd65db1c28267b4c0cd54c2d50089c75

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.6-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.6-win32.egg
Algorithm Hash digest
SHA256 cf7bf7a6485b7d2b560b0787cf7a9b2c964b3618dea280f7c3afff6dda704425
MD5 1ff3f3e3e10bb004529ad21e15ccb2b2
BLAKE2b-256 b355b8e78a3b18370c3cae004765da572bb04f487eae330fb23c1d56f056cb4c

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.6-macosx-10.7-intel.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.6-macosx-10.7-intel.egg
Algorithm Hash digest
SHA256 4340a1384a375b3b9dedf444bb9c1101162f20c955d2d25a3daebdc4ca63f0f6
MD5 0ff1bd5d07298548a13217e4165e6e95
BLAKE2b-256 f4639c9834b1cea51cb83a43237d66feda3365f41b8371d97656f10b4553f113

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.6-macosx-10.6-universal.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.6-macosx-10.6-universal.egg
Algorithm Hash digest
SHA256 f54e97a9d1b3f27e55de75beee793c56c45e98cc8e03180c12fd75148e060385
MD5 3aff58f765ee13ffa7a718f3ff86910c
BLAKE2b-256 d37b942f0a659732bcc2857f2361d7da24dc0175de393f901c9393ea7c627bc0

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.5-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.5-win32.egg
Algorithm Hash digest
SHA256 53db133666bc46cc6ea4484db49a9fe56252fa279df9227cd9dc2456f9a4ee1b
MD5 fdf792aad95122476afaedce5b81d0fa
BLAKE2b-256 8c47663d5d975cd1d52cb4221803c1fd4dbecc54788617acfc909ac4f150c8d2

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.5-macosx-10.7-x86_64.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.5-macosx-10.7-x86_64.egg
Algorithm Hash digest
SHA256 1f9a22158120aa51cb846da900811d05d6c2bcd4ae73bce31a8452c6958d6d94
MD5 70ad45427d0ad2b3c8aa0b2c90f035d8
BLAKE2b-256 384c1a61bdaff30e97f2529ce02f78be892a26eeebb5387946dea2707a3437d8

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.5-macosx-10.6-i386.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.5-macosx-10.6-i386.egg
Algorithm Hash digest
SHA256 b823ef3f656568291a7ab6214a7444a46026fcc4ce4930e372f77cbc82a92e28
MD5 7c0acbdc6d6cbca635146667188a9f77
BLAKE2b-256 399dbe9f585a467d432af8c5b9b087e72c3a7ff3060d9ff96ac121142f4b95c9

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.4-win32.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.4-win32.egg
Algorithm Hash digest
SHA256 211c6b1c46bb8900921691eacf84f828ee4f4cc4c5c52839d58ec2f83ac05a8c
MD5 d9b0ef0198b52d2f0ba53bdb57fb7c1c
BLAKE2b-256 8d03f4184c902a7844f55070339908f964fc6cacab66d90b99172a1c836a3904

See more details on using hashes here.

File details

Details for the file pymongo-2.0-py2.4-macosx-10.6-i386.egg.

File metadata

File hashes

Hashes for pymongo-2.0-py2.4-macosx-10.6-i386.egg
Algorithm Hash digest
SHA256 3b60d29eaa2ad9b356b8bc543679200f42ee65449bb94a542edf4a35dd3e1e80
MD5 5095ca8a57ef6294018427eaa29906a8
BLAKE2b-256 2f82704f15e16fdb96e1b33366e66840149a7b8dbbdc9b9cba54573e17de8433

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page