METADATA 7.5 KB

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