METADATA 8.0 KB

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