Welcome to pyastgrep’s documentation!
pyastgrep is a command-line utility (and library) for grepping Python files using XPath syntax (or CSS selectors) against the Python AST (Abstract Syntax Tree).
In other words, this allows you to search Python code against specific syntax elements (function definitions, arguments, assignments, variables etc), instead of grepping for string matches.
The interface and behaviour is designed to match grep and ripgrep as far as it makes sense to do so.
The project is hosted on Github.
- Installation
- Basic usage
- Examples
- Ignoring files
- CSS selectors
- Use as a library
- Editor integration
- Tips
- Bugs and limitations
- Contributing
- History
- Version 1.3.3 - unreleased
- Version 1.3.2 - 2024-01-10
- Version 1.3.1 - 2023-07-19
- Version 1.3 - 2023-07-18
- Version 1.2.2 - 2023-06-27
- Version 1.2.1 - 2023-06-22
- Version 1.2 - 2023-06-21
- Version 1.1 - 2023-06-09
- Version 1.0 - 2023-04-17
- Version 0.11 - 2023-02-20
- Version 0.10 - 2022-11-25
- Version 0.9 - 2022-11-16
- Version 0.8 - 2022-11-14
- Version 0.7 - 2022-11-07
- Version 0.6 - 2022-11-07
- Version 0.5 - 2022-11-07
- Version 0.4 - 2022-11-07
- Version 0.3 - 2022-10-27
- Version 0.2 - 2022-10-26
- Version 0.1 - 2022-10-26