Python tools, libraries and resources about AST (as in Abstract Syntax Trees)
-
"extended documentation for effectively working with the tokenize module"
Project of Aaron Meurer | Repo
-
"the missing Python AST docs"
Project of Thomas Kluyver | Repo.
- astmonkey - Set of tools to play with Python AST
- astor - AST read/write
- astpath - A command-line search utility for Python ASTs using XPath syntax.
- astpretty - Pretty print the output of python stdlib
ast.parse
. - astroid - A common base representation of python source code for pylint and other projects
- astsearch - Search through ASTs using XPath syntax
- astunparse - a factored out version of unparse found in the Python source distribution
- baron - a Full Syntax Tree (FST) library
- parso - parser that supports error recovery and round-trip parsing
- redbaron - Bottom-up approach to refactoring in python
- show_ast - An IPython notebook plugin for visualizing ASTs.
- tokenize-rt - A wrapper around the stdlib
tokenize
which roundtrips.
- autopep8 - A tool that automatically formats Python code to conform to the PEP 8 style guide
- black - The uncompromising Python code formatter | Online demo
- yapf - configurable formatter from Google | Online demo
- flake8 - glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of code
- mccabe - McCabe complexity checker
- pycodestyle - former
pep8
. Check your Python code against some of the style conventions in PEP 8. - pydocstyle - docstring style checker
- pyflakes - A simple program which checks Python source files for errors.
- pylint - code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.
- isort - sort imports alphabetically, and automatically separated into sections
- reorder_python_imports - reordering python imports
- add-trailing-comma - A tool (and pre-commit hook) to automatically add trailing commas to calls and literals.
- pyupgrade - A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
- yesqa - A tool (and pre-commit hook) to automatically remove unnecessary # noqa comments
2010-02-22: Instrumenting the AST
- common dependencies
- "getting into" howto
- static/dynamic code analysis
- pluggable or not