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