METADATA 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. Metadata-Version: 2.1
  2. Name: graphene
  3. Version: 3.2.1
  4. Summary: GraphQL Framework for Python
  5. Home-page: https://github.com/graphql-python/graphene
  6. Author: Syrus Akbary
  7. Author-email: me@syrusakbary.com
  8. License: MIT
  9. Keywords: api graphql protocol rest relay graphene
  10. Classifier: Development Status :: 3 - Alpha
  11. Classifier: Intended Audience :: Developers
  12. Classifier: Topic :: Software Development :: Libraries
  13. Classifier: Programming Language :: Python :: 3.6
  14. Classifier: Programming Language :: Python :: 3.7
  15. Classifier: Programming Language :: Python :: 3.8
  16. Classifier: Programming Language :: Python :: 3.9
  17. Classifier: Programming Language :: Python :: 3.10
  18. License-File: LICENSE
  19. Requires-Dist: graphql-core (<3.3,>=3.1)
  20. Requires-Dist: graphql-relay (<3.3,>=3.1)
  21. Requires-Dist: aniso8601 (<10,>=8)
  22. Provides-Extra: dev
  23. Requires-Dist: black (==22.3.0) ; extra == 'dev'
  24. Requires-Dist: flake8 (<5,>=4) ; extra == 'dev'
  25. Requires-Dist: pytest (<7,>=6) ; extra == 'dev'
  26. Requires-Dist: pytest-benchmark (<4,>=3.4) ; extra == 'dev'
  27. Requires-Dist: pytest-cov (<4,>=3) ; extra == 'dev'
  28. Requires-Dist: pytest-mock (<4,>=3) ; extra == 'dev'
  29. Requires-Dist: pytest-asyncio (<2,>=0.16) ; extra == 'dev'
  30. Requires-Dist: snapshottest (<1,>=0.6) ; extra == 'dev'
  31. Requires-Dist: coveralls (<4,>=3.3) ; extra == 'dev'
  32. Requires-Dist: mock (<5,>=4) ; extra == 'dev'
  33. Requires-Dist: pytz (==2022.1) ; extra == 'dev'
  34. Requires-Dist: iso8601 (<2,>=1) ; extra == 'dev'
  35. Provides-Extra: test
  36. Requires-Dist: pytest (<7,>=6) ; extra == 'test'
  37. Requires-Dist: pytest-benchmark (<4,>=3.4) ; extra == 'test'
  38. Requires-Dist: pytest-cov (<4,>=3) ; extra == 'test'
  39. Requires-Dist: pytest-mock (<4,>=3) ; extra == 'test'
  40. Requires-Dist: pytest-asyncio (<2,>=0.16) ; extra == 'test'
  41. Requires-Dist: snapshottest (<1,>=0.6) ; extra == 'test'
  42. Requires-Dist: coveralls (<4,>=3.3) ; extra == 'test'
  43. Requires-Dist: mock (<5,>=4) ; extra == 'test'
  44. Requires-Dist: pytz (==2022.1) ; extra == 'test'
  45. Requires-Dist: iso8601 (<2,>=1) ; extra == 'test'
  46. |Graphene Logo| `Graphene <http://graphene-python.org>`__ |Build Status| |PyPI version| |Coverage Status|
  47. =========================================================================================================
  48. `���� Join the community on
  49. Slack <https://join.slack.com/t/graphenetools/shared_invite/enQtOTE2MDQ1NTg4MDM1LTA4Nzk0MGU0NGEwNzUxZGNjNDQ4ZjAwNDJjMjY0OGE1ZDgxZTg4YjM2ZTc4MjE2ZTAzZjE2ZThhZTQzZTkyMmM>`__
  50. **We are looking for contributors**! Please check the
  51. `ROADMAP <https://github.com/graphql-python/graphene/blob/master/ROADMAP.md>`__
  52. to see how you can help ������
  53. Introduction
  54. ------------
  55. `Graphene <http://graphene-python.org>`__ is an opinionated Python
  56. library for building GraphQL schemas/types fast and easily.
  57. - **Easy to use:** Graphene helps you use GraphQL in Python without
  58. effort.
  59. - **Relay:** Graphene has builtin support for Relay.
  60. - **Data agnostic:** Graphene supports any kind of data source: SQL
  61. (Django, SQLAlchemy), NoSQL, custom Python objects, etc. We believe
  62. that by providing a complete API you could plug Graphene anywhere
  63. your data lives and make your data available through GraphQL.
  64. Integrations
  65. ------------
  66. Graphene has multiple integrations with different frameworks:
  67. +-------------------+-------------------------------------------------+
  68. | integration | Package |
  69. +===================+=================================================+
  70. | Django | `graphene-django <https:/ |
  71. | | /github.com/graphql-python/graphene-django/>`__ |
  72. +-------------------+-------------------------------------------------+
  73. | SQLAlchemy | `graphene-sqlalchemy <https://git |
  74. | | hub.com/graphql-python/graphene-sqlalchemy/>`__ |
  75. +-------------------+-------------------------------------------------+
  76. | Google App Engine | `graphene-gae <http |
  77. | | s://github.com/graphql-python/graphene-gae/>`__ |
  78. +-------------------+-------------------------------------------------+
  79. Also, Graphene is fully compatible with the GraphQL spec, working
  80. seamlessly with all GraphQL clients, such as
  81. `Relay <https://github.com/facebook/relay>`__,
  82. `Apollo <https://github.com/apollographql/apollo-client>`__ and
  83. `gql <https://github.com/graphql-python/gql>`__.
  84. Installation
  85. ------------
  86. To install `graphene`, just run this command in your shell
  87. .. code:: bash
  88. pip install "graphene>=3.0"
  89. Examples
  90. --------
  91. Here is one example for you to get started:
  92. .. code:: python
  93. import graphene
  94. class Query(graphene.ObjectType):
  95. hello = graphene.String(description='A typical hello world')
  96. def resolve_hello(self, info):
  97. return 'World'
  98. schema = graphene.Schema(query=Query)
  99. Then Querying ``graphene.Schema`` is as simple as:
  100. .. code:: python
  101. query = '''
  102. query SayHello {
  103. hello
  104. }
  105. '''
  106. result = schema.execute(query)
  107. If you want to learn even more, you can also check the following
  108. `examples <examples/>`__:
  109. - **Basic Schema**: `Starwars example <examples/starwars>`__
  110. - **Relay Schema**: `Starwars Relay
  111. example <examples/starwars_relay>`__
  112. Documentation
  113. -------------
  114. Documentation and links to additional resources are available at
  115. https://docs.graphene-python.org/en/latest/
  116. Contributing
  117. ------------
  118. After cloning this repo, create a
  119. `virtualenv <https://virtualenv.pypa.io/en/stable/>`__ and ensure
  120. dependencies are installed by running:
  121. .. code:: sh
  122. virtualenv venv
  123. source venv/bin/activate
  124. pip install -e ".[test]"
  125. Well-written tests and maintaining good test coverage is important to
  126. this project. While developing, run new and existing tests with:
  127. .. code:: sh
  128. py.test graphene/relay/tests/test_node.py # Single file
  129. py.test graphene/relay # All tests in directory
  130. Add the ``-s`` flag if you have introduced breakpoints into the code for
  131. debugging. Add the ``-v`` (���verbose���) flag to get more detailed test
  132. output. For even more detailed output, use ``-vv``. Check out the
  133. `pytest documentation <https://docs.pytest.org/en/latest/>`__ for more
  134. options and test running controls.
  135. You can also run the benchmarks with:
  136. .. code:: sh
  137. py.test graphene --benchmark-only
  138. Graphene supports several versions of Python. To make sure that changes
  139. do not break compatibility with any of those versions, we use ``tox`` to
  140. create virtualenvs for each Python version and run tests with that
  141. version. To run against all Python versions defined in the ``tox.ini``
  142. config file, just run:
  143. .. code:: sh
  144. tox
  145. If you wish to run against a specific version defined in the ``tox.ini``
  146. file:
  147. .. code:: sh
  148. tox -e py36
  149. Tox can only use whatever versions of Python are installed on your
  150. system. When you create a pull request, Travis will also be running the
  151. same tests and report the results, so there is no need for potential
  152. contributors to try to install every single version of Python on their
  153. own system ahead of time. We appreciate opening issues and pull requests
  154. to make graphene even more stable & useful!
  155. Building Documentation
  156. ~~~~~~~~~~~~~~~~~~~~~~
  157. The documentation is generated using the excellent
  158. `Sphinx <http://www.sphinx-doc.org/>`__ and a custom theme.
  159. An HTML version of the documentation is produced by running:
  160. .. code:: sh
  161. make docs
  162. .. |Graphene Logo| image:: http://graphene-python.org/favicon.png
  163. .. |Build Status| image:: https://travis-ci.org/graphql-python/graphene.svg?branch=master
  164. :target: https://travis-ci.org/graphql-python/graphene
  165. .. |PyPI version| image:: https://badge.fury.io/py/graphene.svg
  166. :target: https://badge.fury.io/py/graphene
  167. .. |Coverage Status| image:: https://coveralls.io/repos/graphql-python/graphene/badge.svg?branch=master&service=github
  168. :target: https://coveralls.io/github/graphql-python/graphene?branch=master