Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spookylukey/pyastgrep
Grep Python Abstract Syntax Trees (AST) using XPath
https://github.com/spookylukey/pyastgrep
abstract-syntax-tree grepping python xpath
Last synced: 7 days ago
JSON representation
Grep Python Abstract Syntax Trees (AST) using XPath
- Host: GitHub
- URL: https://github.com/spookylukey/pyastgrep
- Owner: spookylukey
- Created: 2022-10-21T15:51:00.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-28T15:39:05.000Z (13 days ago)
- Last Synced: 2025-01-03T20:08:33.211Z (7 days ago)
- Topics: abstract-syntax-tree, grepping, python, xpath
- Language: Python
- Homepage: https://pyastgrep.readthedocs.io/
- Size: 393 KB
- Stars: 91
- Watchers: 5
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Contributing: docs/contributing.rst
Awesome Lists containing this project
README
pyastgrep
=========|badge_fury| |badge_tests| |badge_rtd|
.. |badge_fury| image:: https://badge.fury.io/py/pyastgrep.svg
:target: https://badge.fury.io/py/pyastgrep.. |badge_tests| image:: https://github.com/spookylukey/pyastgrep/actions/workflows/tests.yml/badge.svg
:target: https://github.com/spookylukey/pyastgrep/actions/workflows/tests.yml.. |badge_rtd| image:: https://readthedocs.org/projects/pyastgrep/badge/?version=latest
:target: https://pyastgrep.readthedocs.org/en/latest/A command-line utility 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.See `the documentation `_ for more
information, or the ``docs`` folder.History
-------This project was forked from https://github.com/hchasestevens/astpath by `H.
Chase Stevens `__. Main changes:* Added a test suite
* Many bugs fixed
* Significant rewrite of parts of code
* Changes to match grep/ripgrep, including formatting and automatic filtering.