Skip to main content

PyMongo

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.

Metadata

Release files for pymongo 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymongo 2.0
File Size Uploaded Provenance Actions
pymongo-2.0.tar.gz 171.4 kB Without provenance Details for pymongo-2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pymongo 2.0
File Actions
pymongo-2.0.win-amd64-py2.7.exe Details for pymongo-2.0.win-amd64-py2.7.exe
pymongo-2.0.win-amd64-py2.6.exe Details for pymongo-2.0.win-amd64-py2.6.exe
pymongo-2.0.win32-py2.7.exe Details for pymongo-2.0.win32-py2.7.exe
pymongo-2.0.win32-py2.6.exe Details for pymongo-2.0.win32-py2.6.exe
pymongo-2.0.win32-py2.5.exe Details for pymongo-2.0.win32-py2.5.exe
pymongo-2.0.win32-py2.4.exe Details for pymongo-2.0.win32-py2.4.exe
pymongo-2.0-py2.7-win-amd64.egg Legacy Egg format - - Details for pymongo-2.0-py2.7-win-amd64.egg
pymongo-2.0-py2.7-win32.egg Legacy Egg format - - Details for pymongo-2.0-py2.7-win32.egg
pymongo-2.0-py2.7-macosx-10.7-intel.egg Legacy Egg format - - Details for pymongo-2.0-py2.7-macosx-10.7-intel.egg
pymongo-2.0-py2.7-macosx-10.6-intel.egg Legacy Egg format - - Details for pymongo-2.0-py2.7-macosx-10.6-intel.egg
pymongo-2.0-py2.6-win-amd64.egg Legacy Egg format - - Details for pymongo-2.0-py2.6-win-amd64.egg
pymongo-2.0-py2.6-win32.egg Legacy Egg format - - Details for pymongo-2.0-py2.6-win32.egg
pymongo-2.0-py2.6-macosx-10.7-intel.egg Legacy Egg format - - Details for pymongo-2.0-py2.6-macosx-10.7-intel.egg
pymongo-2.0-py2.6-macosx-10.6-universal.egg Legacy Egg format - - Details for pymongo-2.0-py2.6-macosx-10.6-universal.egg
pymongo-2.0-py2.5-win32.egg Legacy Egg format - - Details for pymongo-2.0-py2.5-win32.egg
pymongo-2.0-py2.5-macosx-10.7-x86_64.egg Legacy Egg format - - Details for pymongo-2.0-py2.5-macosx-10.7-x86_64.egg
pymongo-2.0-py2.5-macosx-10.6-i386.egg Legacy Egg format - - Details for pymongo-2.0-py2.5-macosx-10.6-i386.egg
pymongo-2.0-py2.4-win32.egg Legacy Egg format - - Details for pymongo-2.0-py2.4-win32.egg
pymongo-2.0-py2.4-macosx-10.6-i386.egg Legacy Egg format - - Details for pymongo-2.0-py2.4-macosx-10.6-i386.egg

Total release size: 5.0 MB

Release files / pymongo-2.0.tar.gz

Download URL pymongo-2.0.tar.gz
Size 171.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7cc2583fc01ae40ff30da9842bf82257ce3e3037f7c3e634f59c2a414b83984e
BLAKE2b-256 checksum
How to use checksums
db3c19420705d15ab06c2e435b1d9b34bc7f2f5cf138c1523411716e47365008
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0.win-amd64-py2.7.exe

Download URL pymongo-2.0.win-amd64-py2.7.exe
Size 352.0 kB
Tags Source
SHA-256 checksum
How to use checksums
59cfa6acd50c30ed88c59393c31245765ff525904833c0da664e1ea0293a427d
BLAKE2b-256 checksum
How to use checksums
64cf4507c18c5c9dd4c680ebb86e0a945df1f403f53ebdc464e911d2b5f7b846
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0.win-amd64-py2.6.exe

Download URL pymongo-2.0.win-amd64-py2.6.exe
Size 352.0 kB
Tags Source
SHA-256 checksum
How to use checksums
78e84a6a4d2a97b0dcb74c040730d143cfd3495b0157c7663ee83fd77dcd5adc
BLAKE2b-256 checksum
How to use checksums
d6e3b988c0fa0971052a87b222f138bdf159befc04a673f93b01bd23daef1a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0.win32-py2.7.exe

Download URL pymongo-2.0.win32-py2.7.exe
Size 322.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2fc12f51e858bcbe5a732033f96aa9aa9b573732defb7921922fa1078162277f
BLAKE2b-256 checksum
How to use checksums
f1e0ea1ef07979f923ee5aeeffc77fd2a1e64708c9c3a75536ab028600f7cbd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0.win32-py2.6.exe

Download URL pymongo-2.0.win32-py2.6.exe
Size 322.3 kB
Tags Source
SHA-256 checksum
How to use checksums
848f5f3866ac27cbc2b041543f989bf950dc212bce09ea1a287aae065338e7a7
BLAKE2b-256 checksum
How to use checksums
c0bfec791ed7c33c794841c586dde1fe52ac98b37cb9d12dbea0e085b0d2079a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0.win32-py2.5.exe

Download URL pymongo-2.0.win32-py2.5.exe
Size 189.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca3634c83e790865e084162984dd7e24d861199ddf6c650e41387ccd5e4ca6b3
BLAKE2b-256 checksum
How to use checksums
1e630b68a5725156e920fcbf598746242586c06a664e0f687e4d65bd4bc52260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0.win32-py2.4.exe

Download URL pymongo-2.0.win32-py2.4.exe
Size 189.8 kB
Tags Source
SHA-256 checksum
How to use checksums
10883c35161148a478325fbaa9304b847aff4f1a1f5b7043d818fdb42c72bc27
BLAKE2b-256 checksum
How to use checksums
6e183202dcdd12a5352bf8a4c29683537f614eff3c772c29a79cb1455d723eb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.7-win-amd64.egg

Download URL pymongo-2.0-py2.7-win-amd64.egg
Size 226.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
979099b4d845d2fb21794e70da8a9f45a0a39b6fa3f361c20f9cc196773c9104
BLAKE2b-256 checksum
How to use checksums
a81091726a64ac0fcf4ac62e4a8fa48d075a28d5ec86553c772ed2ac47114e57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.7-win32.egg

Download URL pymongo-2.0-py2.7-win32.egg
Size 224.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
1c4f6891585c75bf586da74db465e922a6e2b13f55a43c7c2416aefd38dda0a9
BLAKE2b-256 checksum
How to use checksums
87ec81612f60c7315336e0dd591ff7a6fc8d4033beadb976aaf3a18602eae6cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.7-macosx-10.7-intel.egg

Download URL pymongo-2.0-py2.7-macosx-10.7-intel.egg
Size 258.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
15a9e862c8d477d342ad18e022ac06bedace8a445aecbbba97899ea35ace7779
BLAKE2b-256 checksum
How to use checksums
1872ef6a2e937ffcd60f06e8b9e4928dcbb961d5f50f4e665d2c3a9e553adc01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.7-macosx-10.6-intel.egg

Download URL pymongo-2.0-py2.7-macosx-10.6-intel.egg
Size 263.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
a3b0f396730af74aedb4264e0cde73627b6b31c5b7295a8febe1fc7fd27bf743
BLAKE2b-256 checksum
How to use checksums
ec87cde6ac68149cd52c74afd68847ee9fbe6e1aa1a7c6f69d3a50fec6173019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.6-win-amd64.egg

Download URL pymongo-2.0-py2.6-win-amd64.egg
Size 227.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
0e51e04ddf647076db298297ad7dfcbb866e9d2a5285239a84598f6f845fbc11
BLAKE2b-256 checksum
How to use checksums
07767346efa81d0412dce894e2236395dd65db1c28267b4c0cd54c2d50089c75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.6-win32.egg

Download URL pymongo-2.0-py2.6-win32.egg
Size 225.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
cf7bf7a6485b7d2b560b0787cf7a9b2c964b3618dea280f7c3afff6dda704425
BLAKE2b-256 checksum
How to use checksums
b355b8e78a3b18370c3cae004765da572bb04f487eae330fb23c1d56f056cb4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.6-macosx-10.7-intel.egg

Download URL pymongo-2.0-py2.6-macosx-10.7-intel.egg
Size 259.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
4340a1384a375b3b9dedf444bb9c1101162f20c955d2d25a3daebdc4ca63f0f6
BLAKE2b-256 checksum
How to use checksums
f4639c9834b1cea51cb83a43237d66feda3365f41b8371d97656f10b4553f113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.6-macosx-10.6-universal.egg

Download URL pymongo-2.0-py2.6-macosx-10.6-universal.egg
Size 290.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
f54e97a9d1b3f27e55de75beee793c56c45e98cc8e03180c12fd75148e060385
BLAKE2b-256 checksum
How to use checksums
d37b942f0a659732bcc2857f2361d7da24dc0175de393f901c9393ea7c627bc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.5-win32.egg

Download URL pymongo-2.0-py2.5-win32.egg
Size 227.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
53db133666bc46cc6ea4484db49a9fe56252fa279df9227cd9dc2456f9a4ee1b
BLAKE2b-256 checksum
How to use checksums
8c47663d5d975cd1d52cb4221803c1fd4dbecc54788617acfc909ac4f150c8d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.5-macosx-10.7-x86_64.egg

Download URL pymongo-2.0-py2.5-macosx-10.7-x86_64.egg
Size 226.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
1f9a22158120aa51cb846da900811d05d6c2bcd4ae73bce31a8452c6958d6d94
BLAKE2b-256 checksum
How to use checksums
384c1a61bdaff30e97f2529ce02f78be892a26eeebb5387946dea2707a3437d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.5-macosx-10.6-i386.egg

Download URL pymongo-2.0-py2.5-macosx-10.6-i386.egg
Size 225.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
b823ef3f656568291a7ab6214a7444a46026fcc4ce4930e372f77cbc82a92e28
BLAKE2b-256 checksum
How to use checksums
399dbe9f585a467d432af8c5b9b087e72c3a7ff3060d9ff96ac121142f4b95c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.4-win32.egg

Download URL pymongo-2.0-py2.4-win32.egg
Size 229.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
211c6b1c46bb8900921691eacf84f828ee4f4cc4c5c52839d58ec2f83ac05a8c
BLAKE2b-256 checksum
How to use checksums
8d03f4184c902a7844f55070339908f964fc6cacab66d90b99172a1c836a3904
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymongo-2.0-py2.4-macosx-10.6-i386.egg

Download URL pymongo-2.0-py2.4-macosx-10.6-i386.egg
Size 231.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
3b60d29eaa2ad9b356b8bc543679200f42ee65449bb94a542edf4a35dd3e1e80
BLAKE2b-256 checksum
How to use checksums
2f82704f15e16fdb96e1b33366e66840149a7b8dbbdc9b9cba54573e17de8433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pymongo 2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0 This release

20 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page