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.7.tar.gz (29.5 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.7-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyastgrep-1.7.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyastgrep-1.7.tar.gz
Algorithm Hash digest
SHA256 da8b03b8cc1a723fae28d90a1af62ca3eef557a46c9b5d0330d600fa94545e4a
MD5 877f633f563b447676d8b16875159516
BLAKE2b-256 e51e4a594fe5e162c620a8fbf8e4145f9e319e996af47fd8d23dd9d5b5ebf9c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyastgrep-1.7-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyastgrep-1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 81a260751f72336fcf6e85de8f36e0a502e379752f7faf8492ee9be347efbc2c
MD5 2d05f5812f3eb0dcb10e601fdd410970
BLAKE2b-256 bdcbdc7369dbf57a9d011a382e0e823496056800280acd32a31193aaff4cd607

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