A Python Parser


Keywords
python, parser, parsing
License
MIT
Install
pip install parso==0.6.2

Documentation

parso - A Python Parser

GitHub Actions build status

Coverage Status

PyPI Downloads

image

Parso is a Python parser that supports error recovery and round-trip parsing for different Python versions (in multiple Python versions). Parso is also able to list multiple syntax errors in your python file.

Parso has been battle-tested by jedi. It was pulled out of jedi to be useful for other projects as well.

Parso consists of a small API to parse Python and analyse the syntax tree.

A simple example:

To list multiple issues:

Resources

Installation

pip install parso

Future

  • There will be better support for refactoring and comments. Stay tuned.
  • There's a WIP PEP8 validator. It's however not in a good shape, yet.

Known Issues

  • async/await are already used as keywords in Python3.6.
  • from __future__ import print_function is not ignored.

Acknowledgements

  • Guido van Rossum (@gvanrossum) for creating the parser generator pgen2 (originally used in lib2to3).
  • Salome Schneider for the extremely awesome parso logo.