METADATA 6.8 KB

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