METADATA 7.4 KB

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