gritql
Python bindings for GritQL
What it is and what it does
GritQL is a Python binding for a code query and transformation language built in Rust. It lets you write declarative patterns to find and modify code across JavaScript, TypeScript, Python, JSON, Java, Terraform, Solidity, CSS, Markdown, YAML, Rust, Go, and SQL without needing to understand AST details—any code snippet can serve as a starting pattern. The language is designed to scale to large repositories and includes a module system with reusable patterns.
You install it as a Python package, but it acts as a bridge to the underlying Rust engine. Since the package is dormant (last release 657 days ago), it is no longer actively maintained, so you should expect no updates or bug fixes. It has no Python runtime dependencies, making installation lightweight.
Use it for:
- Search and refactor a large codebase across multiple languages using a single query syntax.
- Automate code migrations or standardization tasks across JavaScript, Python, and other supported languages.
- Build custom linting or code-quality rules that apply pattern-based fixes automatically.
- Query and modify infrastructure-as-code files (Terraform, YAML) alongside application code.
- Reuse or share code transformation patterns via Grit's module system across teams.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
GritQL is a Python binding for a declarative query language that searches and modifies source code across multiple programming languages using pattern matching.
Yes, if you need multi-language code search and transformation at scale and can tolerate a dormant package. The MIT license and zero runtime dependencies make it low-friction to try. However, be aware that no active maintenance means you will not receive updates, bug fixes, or support for new language versions. Suitable for one-off migrations or stable, self-contained use cases; not recommended if you need ongoing support or frequent updates.
Install
gritql on PyPI
pip
pip install gritqluv
uv add gritqlpoetry
poetry add gritqlInstalling gritql
Before you install
Installation is straightforward with no runtime dependencies. The package is dormant (657 days since last release), so expect no active maintenance or bug fixes going forward.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use, modify, and distribute this package freely as long as you include the license notice.
Quickstart
pip install gritql
import gritql
# Use gritql module to construct and run queries on source code
The package is a Python binding to a Rust-based tool; the underlying GritQL engine must be available in your environment for queries to execute.
Verify before relying
- Whether the Rust-based GritQL engine is bundled with the wheel or must be installed separately.
- What Python version is actually required (classifiers list 2.7 through 3.12, but requires_python is unspecified).
- Whether dormant status means the binding is stable or no longer maintained alongside upstream GritQL.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 657 days since the last release |
| First released | |
| Downloads | 114,847/month — #12,277 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gritql-0.2.0-py2.py3-none-any.whl; gritql-0.2.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
ast-grep-cliast-grep-cli is a command-line tool for…
permissive · top 5,000 on PyPI
sqloxidesqloxide parses SQL queries into a typed…
permissive · top 15,000 on PyPI
rumdlA Rust-based Markdown linter and formatter that…
permissive · top 5,000 on PyPI
ast-grep-pyast-grep-py is a Python binding for ast-grep, a…
permissive · top 5,000 on PyPI
tensor-grepA high-performance grep-compatible command-line…
unclear · top 15,000 on PyPI
google-pastaParse Python source code into an AST, modify…
permissive · top 1,000 on PyPI
hogql-parser-rsParses HogQL query expressions into JSON AST…
permissive · top 5,000 on PyPI
sqlglotSQLGlot parses, transpiles, optimizes, and…
permissive · top 1,000 on PyPI
lintroLintro unifies code formatting, linting, and…
permissive · top 15,000 on PyPI
zipcodesQuery and validate U.S. zipcodes with embedded…
permissive · top 15,000 on PyPI