ast-grep-py

Crates.ioast-grep-py
lib.rsast-grep-py
version0.29.0
sourcesrc
created_at2023-11-15 22:00:03.912887
updated_at2024-10-30 05:37:59.260311
descriptionSearch and Rewrite code at large scale using precise AST pattern
homepage
repositoryhttps://github.com/ast-grep/ast-grep
max_upload_size
id1036896
size42,901
Herrington Darkholme (HerringtonDarkholme)

documentation

README

ast-grep python binding

PyPI Website

ast-grep

ast-grep

ast-grep is a tool for code structural search, lint, and rewriting.

This crate intends to build a native python binding of ast-grep and provide a python API for programmatic usage.

Installation

pip install ast-grep-py

Usage

You can take our tests as examples. For example, test_simple.py shows how to use ast-grep to search for a pattern in a file.

Please see the API usage guide and API reference for more details.

Other resources include ast-grep's official site and repository.

Development

Setup virtualenv

python -m venv venv

Activate venv

source venv/bin/activate

Install maturin

pip install maturin[patchelf]

Build bindings

maturin develop

Run tests

pytest

All tests files are under tests directory.

License

This project is licensed under the MIT license.

Commit count: 2784

cargo fmt