METADATA 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. Metadata-Version: 2.0
  2. Name: pymongo
  3. Version: 3.0.2
  4. Summary: Python driver for MongoDB <http://www.mongodb.org>
  5. Home-page: http://github.com/mongodb/mongo-python-driver
  6. Author: Bernie Hackett
  7. Author-email: bernie@mongodb.com
  8. License: Apache License, Version 2.0
  9. Keywords: mongo,mongodb,pymongo,gridfs,bson
  10. Platform: UNKNOWN
  11. Classifier: Development Status :: 5 - Production/Stable
  12. Classifier: Intended Audience :: Developers
  13. Classifier: License :: OSI Approved :: Apache Software License
  14. Classifier: Operating System :: MacOS :: MacOS X
  15. Classifier: Operating System :: Microsoft :: Windows
  16. Classifier: Operating System :: POSIX
  17. Classifier: Programming Language :: Python :: 2
  18. Classifier: Programming Language :: Python :: 2.6
  19. Classifier: Programming Language :: Python :: 2.7
  20. Classifier: Programming Language :: Python :: 3
  21. Classifier: Programming Language :: Python :: 3.2
  22. Classifier: Programming Language :: Python :: 3.3
  23. Classifier: Programming Language :: Python :: 3.4
  24. Classifier: Programming Language :: Python :: Implementation :: CPython
  25. Classifier: Programming Language :: Python :: Implementation :: PyPy
  26. Classifier: Topic :: Database
  27. =======
  28. PyMongo
  29. =======
  30. :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.
  31. :Author: Mike Dirolf
  32. :Maintainer: Bernie Hackett <bernie@mongodb.com>
  33. About
  34. =====
  35. The PyMongo distribution contains tools for interacting with MongoDB
  36. database from Python. The ``bson`` package is an implementation of
  37. the `BSON format <http://bsonspec.org>`_ for Python. The ``pymongo``
  38. package is a native Python driver for MongoDB. The ``gridfs`` package
  39. is a `gridfs
  40. <http://www.mongodb.org/display/DOCS/GridFS+Specification>`_
  41. implementation on top of ``pymongo``.
  42. Support / Feedback
  43. ==================
  44. For issues with, questions about, or feedback for PyMongo, please look into
  45. our `support channels <http://www.mongodb.org/about/support>`_. Please
  46. do not email any of the PyMongo developers directly with issues or
  47. questions - you're more likely to get an answer on the `mongodb-user
  48. <http://groups.google.com/group/mongodb-user>`_ list on Google Groups.
  49. Bugs / Feature Requests
  50. =======================
  51. Think you’ve found a bug? Want to see a new feature in PyMongo? Please open a
  52. case in our issue management tool, JIRA:
  53. - `Create an account and login <https://jira.mongodb.org>`_.
  54. - Navigate to `the PYTHON project <https://jira.mongodb.org/browse/PYTHON>`_.
  55. - Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it.
  56. Bug reports in JIRA for all driver projects (i.e. PYTHON, CSHARP, JAVA) and the
  57. Core Server (i.e. SERVER) project are **public**.
  58. How To Ask For Help
  59. -------------------
  60. Please include all of the following information when opening an issue:
  61. - Detailed steps to reproduce the problem, including full traceback, if possible.
  62. - The exact python version used, with patch level::
  63. $ python -c "import sys; print(sys.version)"
  64. - The exact version of PyMongo used, with patch level::
  65. $ python -c "import pymongo; print(pymongo.version); print(pymongo.has_c())"
  66. - The operating system and version (e.g. Windows 7, OSX 10.8, ...)
  67. - Web framework or asynchronous network library used, if any, with version (e.g.
  68. Django 1.7, mod_wsgi 4.3.0, gevent 1.0.1, Tornado 4.0.2, ...)
  69. Security Vulnerabilities
  70. ------------------------
  71. If you’ve identified a security vulnerability in a driver or any other
  72. MongoDB project, please report it according to the `instructions here
  73. <http://docs.mongodb.org/manual/tutorial/create-a-vulnerability-report>`_.
  74. Installation
  75. ============
  76. If you have `setuptools
  77. <http://pythonhosted.org/setuptools/>`_ installed you
  78. should be able to do **easy_install pymongo** to install
  79. PyMongo. Otherwise you can download the project source and do **python
  80. setup.py install** to install.
  81. Do **not** install the "bson" package. PyMongo comes with its own bson package;
  82. doing "easy_install bson" installs a third-party package that is incompatible
  83. with PyMongo.
  84. Dependencies
  85. ============
  86. The PyMongo distribution is supported and tested on Python 2.x (where
  87. x >= 6) and Python 3.x (where x >= 2). PyMongo versions before 3.0 also
  88. support Python 2.4, 2.5, and 3.1.
  89. Optional packages:
  90. - `backports.pbkdf2 <https://pypi.python.org/pypi/backports.pbkdf2/>`_,
  91. improves authentication performance with SCRAM-SHA-1, the default
  92. authentication mechanism for MongoDB 3.0+. It especially improves
  93. performance on Python older than 2.7.8, or on Python 3 before Python 3.4.
  94. - `pykerberos <https://pypi.python.org/pypi/pykerberos>`_ is required for
  95. the GSSAPI authentication mechanism.
  96. - `Monotime <https://pypi.python.org/pypi/Monotime>`_ adds support for
  97. a monotonic clock, which improves reliability in environments
  98. where clock adjustments are frequent. Not needed in Python 3.3+.
  99. - `wincertstore <https://pypi.python.org/pypi/wincertstore>`_ adds support
  100. for verifying server SSL certificates using Windows provided CA
  101. certificates on older versions of python. Not needed or used with versions
  102. of Python 2 beginning with 2.7.9, or versions of Python 3 beginning with
  103. 3.4.0.
  104. - `certifi <https://pypi.python.org/pypi/certifi>`_ adds support for
  105. using the Mozilla CA bundle with SSL to verify server certificates. Not
  106. needed or used with versions of Python 2 beginning with 2.7.9 on any OS,
  107. versions of Python 3 beginning with Python 3.4.0 on Windows, or versions
  108. of Python 3 beginning with Python 3.2.0 on operating systems other than
  109. Windows.
  110. Additional dependencies are:
  111. - (to generate documentation) sphinx_
  112. - (to run the tests under Python 2.6) unittest2_
  113. Examples
  114. ========
  115. Here's a basic example (for more see the *examples* section of the docs):
  116. .. code-block:: pycon
  117. >>> import pymongo
  118. >>> client = pymongo.MongoClient("localhost", 27017)
  119. >>> db = client.test
  120. >>> db.name
  121. u'test'
  122. >>> db.my_collection
  123. Collection(Database(MongoClient('localhost', 27017), u'test'), u'my_collection')
  124. >>> db.my_collection.insert_one({"x": 10}).inserted_id
  125. ObjectId('4aba15ebe23f6b53b0000000')
  126. >>> db.my_collection.insert_one({"x": 8}).inserted_id
  127. ObjectId('4aba160ee23f6b543e000000')
  128. >>> db.my_collection.insert_one({"x": 11}).inserted_id
  129. ObjectId('4aba160ee23f6b543e000002')
  130. >>> db.my_collection.find_one()
  131. {u'x': 10, u'_id': ObjectId('4aba15ebe23f6b53b0000000')}
  132. >>> for item in db.my_collection.find():
  133. ... print item["x"]
  134. ...
  135. 10
  136. 8
  137. 11
  138. >>> db.my_collection.create_index("x")
  139. u'x_1'
  140. >>> for item in db.my_collection.find().sort("x", pymongo.ASCENDING):
  141. ... print item["x"]
  142. ...
  143. 8
  144. 10
  145. 11
  146. >>> [item["x"] for item in db.my_collection.find().limit(2).skip(1)]
  147. [8, 11]
  148. Documentation
  149. =============
  150. You will need sphinx_ installed to generate the
  151. documentation. Documentation can be generated by running **python
  152. setup.py doc**. Generated documentation can be found in the
  153. *doc/build/html/* directory.
  154. Testing
  155. =======
  156. The easiest way to run the tests is to run **python setup.py test** in
  157. the root of the distribution. Note that you will need unittest2_ to
  158. run the tests under Python 2.6.
  159. To verify that PyMongo works with Gevent's monkey-patching::
  160. $ python green_framework_test.py gevent
  161. Or with Eventlet's::
  162. $ python green_framework_test.py eventlet
  163. .. _sphinx: http://sphinx.pocoo.org/
  164. .. _unittest2: https://pypi.python.org/pypi/unittest2