METADATA 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. Metadata-Version: 2.1
  2. Name: pymongo
  3. Version: 3.12.0
  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.7
  21. Classifier: Programming Language :: Python :: 3
  22. Classifier: Programming Language :: Python :: 3.4
  23. Classifier: Programming Language :: Python :: 3.5
  24. Classifier: Programming Language :: Python :: 3.6
  25. Classifier: Programming Language :: Python :: 3.7
  26. Classifier: Programming Language :: Python :: 3.8
  27. Classifier: Programming Language :: Python :: 3.9
  28. Classifier: Programming Language :: Python :: Implementation :: CPython
  29. Classifier: Programming Language :: Python :: Implementation :: PyPy
  30. Classifier: Topic :: Database
  31. Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
  32. Provides-Extra: aws
  33. Requires-Dist: pymongo-auth-aws (<2.0.0) ; extra == 'aws'
  34. Provides-Extra: encryption
  35. Requires-Dist: pymongocrypt (<2.0.0,>=1.1.0) ; extra == 'encryption'
  36. Provides-Extra: gssapi
  37. Requires-Dist: winkerberos (>=0.5.0) ; extra == 'gssapi'
  38. Provides-Extra: ocsp
  39. Requires-Dist: pyopenssl (>=17.2.0) ; extra == 'ocsp'
  40. Requires-Dist: requests (<3.0.0) ; extra == 'ocsp'
  41. Requires-Dist: service-identity (>=18.1.0) ; extra == 'ocsp'
  42. Requires-Dist: wincertstore (>=0.2) ; extra == 'ocsp'
  43. Provides-Extra: snappy
  44. Requires-Dist: python-snappy ; extra == 'snappy'
  45. Provides-Extra: srv
  46. Requires-Dist: dnspython (<1.17.0,>=1.16.0) ; extra == 'srv'
  47. Provides-Extra: tls
  48. Requires-Dist: ipaddress ; extra == 'tls'
  49. Provides-Extra: zstd
  50. Requires-Dist: zstandard ; extra == 'zstd'
  51. =======
  52. PyMongo
  53. =======
  54. :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.
  55. :Documentation: Available at `pymongo.readthedocs.io <https://pymongo.readthedocs.io/en/stable/>`_
  56. :Author: Mike Dirolf
  57. :Maintainer: Bernie Hackett <bernie@mongodb.com>
  58. About
  59. =====
  60. The PyMongo distribution contains tools for interacting with MongoDB
  61. database from Python. The ``bson`` package is an implementation of
  62. the `BSON format <http://bsonspec.org>`_ for Python. The ``pymongo``
  63. package is a native Python driver for MongoDB. The ``gridfs`` package
  64. is a `gridfs
  65. <http://www.mongodb.org/display/DOCS/GridFS+Specification>`_
  66. implementation on top of ``pymongo``.
  67. PyMongo supports MongoDB 2.6, 3.0, 3.2, 3.4, 3.6, 4.0, 4.2, 4.4, and 5.0.
  68. Support / Feedback
  69. ==================
  70. For issues with, questions about, or feedback for PyMongo, please look into
  71. our `support channels <https://support.mongodb.com/welcome>`_. Please
  72. do not email any of the PyMongo developers directly with issues or
  73. questions - you're more likely to get an answer on the `MongoDB Community
  74. Forums <https://developer.mongodb.com/community/forums/tag/python-driver>`_.
  75. Bugs / Feature Requests
  76. =======================
  77. Think you’ve found a bug? Want to see a new feature in PyMongo? Please open a
  78. case in our issue management tool, JIRA:
  79. - `Create an account and login <https://jira.mongodb.org>`_.
  80. - Navigate to `the PYTHON project <https://jira.mongodb.org/browse/PYTHON>`_.
  81. - Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it.
  82. Bug reports in JIRA for all driver projects (i.e. PYTHON, CSHARP, JAVA) and the
  83. Core Server (i.e. SERVER) project are **public**.
  84. How To Ask For Help
  85. -------------------
  86. Please include all of the following information when opening an issue:
  87. - Detailed steps to reproduce the problem, including full traceback, if possible.
  88. - The exact python version used, with patch level::
  89. $ python -c "import sys; print(sys.version)"
  90. - The exact version of PyMongo used, with patch level::
  91. $ python -c "import pymongo; print(pymongo.version); print(pymongo.has_c())"
  92. - The operating system and version (e.g. Windows 7, OSX 10.8, ...)
  93. - Web framework or asynchronous network library used, if any, with version (e.g.
  94. Django 1.7, mod_wsgi 4.3.0, gevent 1.0.1, Tornado 4.0.2, ...)
  95. Security Vulnerabilities
  96. ------------------------
  97. If you’ve identified a security vulnerability in a driver or any other
  98. MongoDB project, please report it according to the `instructions here
  99. <http://docs.mongodb.org/manual/tutorial/create-a-vulnerability-report>`_.
  100. Installation
  101. ============
  102. PyMongo can be installed with `pip <http://pypi.python.org/pypi/pip>`_::
  103. $ python -m pip install pymongo
  104. Or ``easy_install`` from
  105. `setuptools <http://pypi.python.org/pypi/setuptools>`_::
  106. $ python -m easy_install pymongo
  107. You can also download the project source and do::
  108. $ python setup.py install
  109. Do **not** install the "bson" package from pypi. PyMongo comes with its own
  110. bson package; doing "easy_install bson" installs a third-party package that
  111. is incompatible with PyMongo.
  112. Dependencies
  113. ============
  114. PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3.5+.
  115. **WARNING** Support for Python 2.7, 3.4 and 3.5 is deprecated. Those Python
  116. versions will not be supported by PyMongo 4.
  117. Optional dependencies:
  118. GSSAPI authentication requires `pykerberos
  119. <https://pypi.python.org/pypi/pykerberos>`_ on Unix or `WinKerberos
  120. <https://pypi.python.org/pypi/winkerberos>`_ on Windows. The correct
  121. dependency can be installed automatically along with PyMongo::
  122. $ python -m pip install pymongo[gssapi]
  123. MONGODB-AWS authentication requires `pymongo-auth-aws
  124. <https://pypi.org/project/pymongo-auth-aws/>`_::
  125. $ python -m pip install pymongo[aws]
  126. Support for mongodb+srv:// URIs requires `dnspython
  127. <https://pypi.python.org/pypi/dnspython>`_::
  128. $ python -m pip install pymongo[srv]
  129. TLS / SSL support may require `ipaddress
  130. <https://pypi.python.org/pypi/ipaddress>`_ and `certifi
  131. <https://pypi.python.org/pypi/certifi>`_ or `wincertstore
  132. <https://pypi.python.org/pypi/wincertstore>`_ depending on the Python
  133. version in use. The necessary dependencies can be installed along with
  134. PyMongo::
  135. $ python -m pip install pymongo[tls]
  136. .. note:: Users of Python versions older than 2.7.9 will also
  137. receive the dependencies for OCSP when using the tls extra.
  138. OCSP (Online Certificate Status Protocol) requires `PyOpenSSL
  139. <https://pypi.org/project/pyOpenSSL/>`_, `requests
  140. <https://pypi.org/project/requests/>`_ and `service_identity
  141. <https://pypi.org/project/service_identity/>`_::
  142. $ python -m pip install pymongo[ocsp]
  143. Wire protocol compression with snappy requires `python-snappy
  144. <https://pypi.org/project/python-snappy>`_::
  145. $ python -m pip install pymongo[snappy]
  146. Wire protocol compression with zstandard requires `zstandard
  147. <https://pypi.org/project/zstandard>`_::
  148. $ python -m pip install pymongo[zstd]
  149. Client-Side Field Level Encryption requires `pymongocrypt
  150. <https://pypi.org/project/pymongocrypt/>`_::
  151. $ python -m pip install pymongo[encryption]
  152. You can install all dependencies automatically with the following
  153. command::
  154. $ python -m pip install pymongo[gssapi,aws,ocsp,snappy,srv,tls,zstd,encryption]
  155. Other optional packages:
  156. - `backports.pbkdf2 <https://pypi.python.org/pypi/backports.pbkdf2/>`_,
  157. improves authentication performance with SCRAM-SHA-1 and SCRAM-SHA-256.
  158. It especially improves performance on Python versions older than 2.7.8.
  159. - `monotonic <https://pypi.python.org/pypi/monotonic>`_ adds support for
  160. a monotonic clock, which improves reliability in environments
  161. where clock adjustments are frequent. Not needed in Python 3.
  162. Additional dependencies are:
  163. - (to generate documentation) sphinx_
  164. Examples
  165. ========
  166. Here's a basic example (for more see the *examples* section of the docs):
  167. .. code-block:: python
  168. >>> import pymongo
  169. >>> client = pymongo.MongoClient("localhost", 27017)
  170. >>> db = client.test
  171. >>> db.name
  172. u'test'
  173. >>> db.my_collection
  174. Collection(Database(MongoClient('localhost', 27017), u'test'), u'my_collection')
  175. >>> db.my_collection.insert_one({"x": 10}).inserted_id
  176. ObjectId('4aba15ebe23f6b53b0000000')
  177. >>> db.my_collection.insert_one({"x": 8}).inserted_id
  178. ObjectId('4aba160ee23f6b543e000000')
  179. >>> db.my_collection.insert_one({"x": 11}).inserted_id
  180. ObjectId('4aba160ee23f6b543e000002')
  181. >>> db.my_collection.find_one()
  182. {u'x': 10, u'_id': ObjectId('4aba15ebe23f6b53b0000000')}
  183. >>> for item in db.my_collection.find():
  184. ... print(item["x"])
  185. ...
  186. 10
  187. 8
  188. 11
  189. >>> db.my_collection.create_index("x")
  190. u'x_1'
  191. >>> for item in db.my_collection.find().sort("x", pymongo.ASCENDING):
  192. ... print(item["x"])
  193. ...
  194. 8
  195. 10
  196. 11
  197. >>> [item["x"] for item in db.my_collection.find().limit(2).skip(1)]
  198. [8, 11]
  199. Documentation
  200. =============
  201. Documentation is available at `pymongo.readthedocs.io <https://pymongo.readthedocs.io/en/stable/>`_.
  202. To build the documentation, you will need to install sphinx_.
  203. Documentation can be generated by running **python
  204. setup.py doc**. Generated documentation can be found in the
  205. *doc/build/html/* directory.
  206. Testing
  207. =======
  208. The easiest way to run the tests is to run **python setup.py test** in
  209. the root of the distribution.
  210. To verify that PyMongo works with Gevent's monkey-patching::
  211. $ python green_framework_test.py gevent
  212. Or with Eventlet's::
  213. $ python green_framework_test.py eventlet
  214. .. _sphinx: https://www.sphinx-doc.org/en/master/