Skip to main content

A search/query tool for Python abstract syntax trees

Project description

badge_fury badge_tests badge_rtd

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyastgrep-1.6.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyastgrep-1.6-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file pyastgrep-1.6.tar.gz.

File metadata

  • Download URL: pyastgrep-1.6.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for pyastgrep-1.6.tar.gz
Algorithm Hash digest
SHA256 ed78dbd6b12f1a5d2fe4e09b8f7c6d00d2c6dc89f9325f1111a63eec9944564b
MD5 055cc2e57de02eb31fa397c11cab5160
BLAKE2b-256 bc68469dd5ff669e783b568feeeefe6526d8869dc4f9fab2a2285ecf4b2db788

See more details on using hashes here.

File details

Details for the file pyastgrep-1.6-py3-none-any.whl.

File metadata

  • Download URL: pyastgrep-1.6-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for pyastgrep-1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6229ff7ad47883b6a3499da53979d414842bc336603e04ddea31c9c45201f3fd
MD5 a6e426bb6685f6a4041a8b8d51fb179b
BLAKE2b-256 dc5929f30b2d8e0e5cf576e62b4ee5161bb426175238c981e8044de73c3aa80e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page