gron
Python library to grep JSON.
What it is and what it does
Gron is a Python implementation of the original gron tool that converts JSON into a line-oriented, grep-friendly format. Each line represents one value assignment with its complete path, making it straightforward to search, filter, and analyze JSON data using standard Unix tools like grep, awk, and sed.
The tool reads JSON from a file or stdin and outputs each field and value as a separate line in the form `json.path.to.field = value;`, with array indices shown as `[n]`. This transformation makes JSON data searchable without needing specialized JSON query tools, and the output can be piped back through gron's reverse function to reconstruct the original JSON. It requires Python 3.10 or later and has no external runtime dependencies.
Use it for:
- Search for specific keys or values in large JSON files using grep patterns.
- Extract particular fields from complex nested JSON structures via command-line filters.
- Debug API responses by viewing JSON in a line-by-line format that's easier to scan.
- Combine JSON queries with Unix text processing tools (grep, awk, sed) in shell pipelines.
- Convert JSON to a format suitable for version control diffs or line-based analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Transforms JSON into grep-able line-by-line output, where each line represents a single value assignment with its full path, making it easier to search and filter JSON data.
Yes, if you work with JSON on the command line and want to leverage Unix text tools for searching and filtering. The package is stable, has no dependencies, and installs easily. The dormant maintenance status is not a concern for a mature, single-purpose tool with no external dependencies, but verify that the feature set meets your needs—it is primarily a CLI tool, not a general-purpose JSON library.
Install
gron on PyPI
pip
pip install gronuv
uv add gronpoetry
poetry add gronInstalling gron
Before you install
Low friction install with no runtime dependencies. Maintenance is dormant (last commit 2024-11-25, no activity for 720 days), but the package is marked Production/Stable and has received a recent release.
License in practice
MIT License permits unrestricted use, modification, and distribution with only attribution and liability disclaimer required—no restrictions on commercial or private use.
Quickstart
pip install gron
# Command-line usage:
gron input.json
# Or pipe JSON to stdin:
cat data.json | gron
Requires Python 3.10 or later.
Verify before relying
- Whether the package provides a Python API for programmatic use or is primarily a CLI tool.
- Performance characteristics when handling large JSON files.
- Exact feature parity with the original Go implementation of gron.
Package facts
| License | MIT License Copyright (c) 2018 Bastian Venthur Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 720 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 514,095/month — #6,240 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gron-1.4.0-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
parquetReads Apache Parquet files in pure Python and…
permissive · top 15,000 on PyPI
pandocfiltersProvides Python utilities for writing pandoc…
permissive · top 1,000 on PyPI
JSON_minifyMinifies JSON by removing whitespace and…
permissive · top 15,000 on PyPI
jsonlinesSimplifies reading and writing jsonlines…
permissive · top 5,000 on PyPI
ast-grep-cliast-grep-cli is a command-line tool for…
permissive · top 5,000 on PyPI
grep-astSearch source code files by pattern and display…
permissive · top 5,000 on PyPI
tensor-grepA high-performance grep-compatible command-line…
unclear · top 15,000 on PyPI
bashProvides a Python wrapper for running bash…
copyleft · top 15,000 on PyPI
ripgrepProvides a Python interface to ripgrep (rg), a…
permissive · top 15,000 on PyPI
igittigittA spec-compliant .gitignore parser that matches…
permissive · top 15,000 on PyPI