Abstract Syntax Trees, ASTs, are a powerful feature of Python. You can write programs that inspect and modify Python code, after the syntax has been parsed, but before it gets compiled to byte code. That opens up a world of possibilities for introspection, testing, and mischief.
The official documentation for the ast module used to be rather brief. A large part of the material from Green Tree Snakes, describing all of the AST node classes, has now been merged into the ast module docs. The remainder here aims to serve as a field guide (or forest guide?) to working with ASTs in practice.
Bandit is a tool designed to find common security issues in Python code. To do this, Bandit processes each file, builds an AST from it, and runs appropriate plugins against the AST nodes. Once Bandit has finished scanning all the files, it generates a report.
This documentation is generated by the Sphinx toolkit and lives in the source tree.