METADATA 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. Metadata-Version: 2.1
  2. Name: parso
  3. Version: 0.8.3
  4. Summary: A Python Parser
  5. Home-page: https://github.com/davidhalter/parso
  6. Author: David Halter
  7. Author-email: davidhalter88@gmail.com
  8. Maintainer: David Halter
  9. Maintainer-email: davidhalter88@gmail.com
  10. License: MIT
  11. Keywords: python parser parsing
  12. Platform: any
  13. Classifier: Development Status :: 4 - Beta
  14. Classifier: Environment :: Plugins
  15. Classifier: Intended Audience :: Developers
  16. Classifier: License :: OSI Approved :: MIT License
  17. Classifier: Operating System :: OS Independent
  18. Classifier: Programming Language :: Python :: 3
  19. Classifier: Programming Language :: Python :: 3.6
  20. Classifier: Programming Language :: Python :: 3.7
  21. Classifier: Programming Language :: Python :: 3.8
  22. Classifier: Programming Language :: Python :: 3.9
  23. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  24. Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
  25. Classifier: Topic :: Utilities
  26. Classifier: Typing :: Typed
  27. Requires-Python: >=3.6
  28. Provides-Extra: qa
  29. Requires-Dist: flake8 (==3.8.3) ; extra == 'qa'
  30. Requires-Dist: mypy (==0.782) ; extra == 'qa'
  31. Provides-Extra: testing
  32. Requires-Dist: docopt ; extra == 'testing'
  33. Requires-Dist: pytest (<6.0.0) ; extra == 'testing'
  34. ###################################################################
  35. parso - A Python Parser
  36. ###################################################################
  37. .. image:: https://github.com/davidhalter/parso/workflows/Build/badge.svg?branch=master
  38. :target: https://github.com/davidhalter/parso/actions
  39. :alt: GitHub Actions build status
  40. .. image:: https://coveralls.io/repos/github/davidhalter/parso/badge.svg?branch=master
  41. :target: https://coveralls.io/github/davidhalter/parso?branch=master
  42. :alt: Coverage Status
  43. .. image:: https://pepy.tech/badge/parso
  44. :target: https://pepy.tech/project/parso
  45. :alt: PyPI Downloads
  46. .. image:: https://raw.githubusercontent.com/davidhalter/parso/master/docs/_static/logo_characters.png
  47. Parso is a Python parser that supports error recovery and round-trip parsing
  48. for different Python versions (in multiple Python versions). Parso is also able
  49. to list multiple syntax errors in your python file.
  50. Parso has been battle-tested by jedi_. It was pulled out of jedi to be useful
  51. for other projects as well.
  52. Parso consists of a small API to parse Python and analyse the syntax tree.
  53. A simple example:
  54. .. code-block:: python
  55. >>> import parso
  56. >>> module = parso.parse('hello + 1', version="3.9")
  57. >>> expr = module.children[0]
  58. >>> expr
  59. PythonNode(arith_expr, [<Name: hello@1,0>, <Operator: +>, <Number: 1>])
  60. >>> print(expr.get_code())
  61. hello + 1
  62. >>> name = expr.children[0]
  63. >>> name
  64. <Name: hello@1,0>
  65. >>> name.end_pos
  66. (1, 5)
  67. >>> expr.end_pos
  68. (1, 9)
  69. To list multiple issues:
  70. .. code-block:: python
  71. >>> grammar = parso.load_grammar()
  72. >>> module = grammar.parse('foo +\nbar\ncontinue')
  73. >>> error1, error2 = grammar.iter_errors(module)
  74. >>> error1.message
  75. 'SyntaxError: invalid syntax'
  76. >>> error2.message
  77. "SyntaxError: 'continue' not properly in loop"
  78. Resources
  79. =========
  80. - `Testing <https://parso.readthedocs.io/en/latest/docs/development.html#testing>`_
  81. - `PyPI <https://pypi.python.org/pypi/parso>`_
  82. - `Docs <https://parso.readthedocs.org/en/latest/>`_
  83. - Uses `semantic versioning <https://semver.org/>`_
  84. Installation
  85. ============
  86. pip install parso
  87. Future
  88. ======
  89. - There will be better support for refactoring and comments. Stay tuned.
  90. - There's a WIP PEP8 validator. It's however not in a good shape, yet.
  91. Known Issues
  92. ============
  93. - `async`/`await` are already used as keywords in Python3.6.
  94. - `from __future__ import print_function` is not ignored.
  95. Acknowledgements
  96. ================
  97. - Guido van Rossum (@gvanrossum) for creating the parser generator pgen2
  98. (originally used in lib2to3).
  99. - `Salome Schneider <https://www.crepes-schnaegg.ch/cr%C3%AApes-schn%C3%A4gg/kunst-f%C3%BCrs-cr%C3%AApes-mobil/>`_
  100. for the extremely awesome parso logo.
  101. .. _jedi: https://github.com/davidhalter/jedi
  102. .. :changelog:
  103. Changelog
  104. ---------
  105. Unreleased
  106. ++++++++++
  107. 0.8.3 (2021-11-30)
  108. ++++++++++++++++++
  109. - Add basic support for Python 3.11 and 3.12
  110. 0.8.2 (2021-03-30)
  111. ++++++++++++++++++
  112. - Various small bugfixes
  113. 0.8.1 (2020-12-10)
  114. ++++++++++++++++++
  115. - Various small bugfixes
  116. 0.8.0 (2020-08-05)
  117. ++++++++++++++++++
  118. - Dropped Support for Python 2.7, 3.4, 3.5
  119. - It's possible to use ``pathlib.Path`` objects now in the API
  120. - The stubs are gone, we are now using annotations
  121. - ``namedexpr_test`` nodes are now a proper class called ``NamedExpr``
  122. - A lot of smaller refactorings
  123. 0.7.1 (2020-07-24)
  124. ++++++++++++++++++
  125. - Fixed a couple of smaller bugs (mostly syntax error detection in
  126. ``Grammar.iter_errors``)
  127. This is going to be the last release that supports Python 2.7, 3.4 and 3.5.
  128. 0.7.0 (2020-04-13)
  129. ++++++++++++++++++
  130. - Fix a lot of annoying bugs in the diff parser. The fuzzer did not find
  131. issues anymore even after running it for more than 24 hours (500k tests).
  132. - Small grammar change: suites can now contain newlines even after a newline.
  133. This should really not matter if you don't use error recovery. It allows for
  134. nicer error recovery.
  135. 0.6.2 (2020-02-27)
  136. ++++++++++++++++++
  137. - Bugfixes
  138. - Add Grammar.refactor (might still be subject to change until 0.7.0)
  139. 0.6.1 (2020-02-03)
  140. ++++++++++++++++++
  141. - Add ``parso.normalizer.Issue.end_pos`` to make it possible to know where an
  142. issue ends
  143. 0.6.0 (2020-01-26)
  144. ++++++++++++++++++
  145. - Dropped Python 2.6/Python 3.3 support
  146. - del_stmt names are now considered as a definition
  147. (for ``name.is_definition()``)
  148. - Bugfixes
  149. 0.5.2 (2019-12-15)
  150. ++++++++++++++++++
  151. - Add include_setitem to get_definition/is_definition and get_defined_names (#66)
  152. - Fix named expression error listing (#89, #90)
  153. - Fix some f-string tokenizer issues (#93)
  154. 0.5.1 (2019-07-13)
  155. ++++++++++++++++++
  156. - Fix: Some unicode identifiers were not correctly tokenized
  157. - Fix: Line continuations in f-strings are now working
  158. 0.5.0 (2019-06-20)
  159. ++++++++++++++++++
  160. - **Breaking Change** comp_for is now called sync_comp_for for all Python
  161. versions to be compatible with the Python 3.8 Grammar
  162. - Added .pyi stubs for a lot of the parso API
  163. - Small FileIO changes
  164. 0.4.0 (2019-04-05)
  165. ++++++++++++++++++
  166. - Python 3.8 support
  167. - FileIO support, it's now possible to use abstract file IO, support is alpha
  168. 0.3.4 (2019-02-13)
  169. +++++++++++++++++++
  170. - Fix an f-string tokenizer error
  171. 0.3.3 (2019-02-06)
  172. +++++++++++++++++++
  173. - Fix async errors in the diff parser
  174. - A fix in iter_errors
  175. - This is a very small bugfix release
  176. 0.3.2 (2019-01-24)
  177. +++++++++++++++++++
  178. - 20+ bugfixes in the diff parser and 3 in the tokenizer
  179. - A fuzzer for the diff parser, to give confidence that the diff parser is in a
  180. good shape.
  181. - Some bugfixes for f-string
  182. 0.3.1 (2018-07-09)
  183. +++++++++++++++++++
  184. - Bugfixes in the diff parser and keyword-only arguments
  185. 0.3.0 (2018-06-30)
  186. +++++++++++++++++++
  187. - Rewrote the pgen2 parser generator.
  188. 0.2.1 (2018-05-21)
  189. +++++++++++++++++++
  190. - A bugfix for the diff parser.
  191. - Grammar files can now be loaded from a specific path.
  192. 0.2.0 (2018-04-15)
  193. +++++++++++++++++++
  194. - f-strings are now parsed as a part of the normal Python grammar. This makes
  195. it way easier to deal with them.
  196. 0.1.1 (2017-11-05)
  197. +++++++++++++++++++
  198. - Fixed a few bugs in the caching layer
  199. - Added support for Python 3.7
  200. 0.1.0 (2017-09-04)
  201. +++++++++++++++++++
  202. - Pulling the library out of Jedi. Some APIs will definitely change.