skillfed

gron

Python library to grep JSON.

gron v1.4.0 514.1K downloads/30d#6,240 on PyPI17
Permissive 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) DORMANT released

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 gron

uv

uv add gron

poetry

poetry add gron

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3

Tags

grep jsonjson line by linejson search tooljson to text formatflatten json for grepjson query command linejson path extraction
json-clitext-processing

More Utilities packages