Skip to main content

python-gron

Make JSON grep-able, a Python implementation of gron.

Installation

gron is available on PyPi, to install it use:

$ pip install gron

Documentation

The API documentation can be found here.

Usage

Given a JSON file with the content:

{
  "one": 1,
  "two": 2.2,
  "three-b": "3",
  "four": [1,2,3,4],
  "five": {
    "alpha": ["fo", "fum"],
    "beta": {
      "hey": "How's tricks?"
    }
  },
  "abool": true,
  "abool2": false,
  "isnull": null,
  "id": 66912849
}

you can use gron like this:

$ gron tests/data/one.json
json = {};
json.abool = true;
json.abool2 = false;
json.five = {};
json.five.alpha = [];
json.five.alpha[0] = "fo";
json.five.alpha[1] = "fum";
json.five.beta = {};
json.five.beta.hey = "How's tricks?";
json.four = [];
json.four[0] = 1;
json.four[1] = 2;
json.four[2] = 3;
json.four[3] = 4;
json.id = 66912849;
json.isnull = null;
json.one = 1;
json.two = 2.2;
json["three-b"] = "3";``

Without any arguments gron will read from STDIN:

$ cat tests/data/one.json | gron
json = {};
json.abool = true;
json.abool2 = false;
json.five = {};
json.five.alpha = [];
json.five.alpha[0] = "fo";
json.five.alpha[1] = "fum";
json.five.beta = {};
json.five.beta.hey = "How's tricks?";
json.four = [];
json.four[0] = 1;
json.four[1] = 2;
json.four[2] = 3;
json.four[3] = 4;
json.id = 66912849;
json.isnull = null;
json.one = 1;
json.two = 2.2;
json["three-b"] = "3";

Metadata

Release files for gron 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gron 1.4.0
File Size Uploaded Provenance Actions
gron-1.4.0.tar.gz 5.0 kB Without provenance Details for gron-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gron 1.4.0
File Interpreter ABI Platform Actions
gron-1.4.0-py3-none-any.whl Python 3 none any Details for gron-1.4.0-py3-none-any.whl

Total release size: 10.5 kB

Release files / gron-1.4.0.tar.gz

Download URL gron-1.4.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3dacfa829b6ddf27d27d51a30fae0000d7fe6556ba0676cb6951825b80007053
BLAKE2b-256 checksum
How to use checksums
a5e693f50418b75649725b1ab0e6226a6c193e82a7eadcb59308721038c4e245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / gron-1.4.0-py3-none-any.whl

Download URL gron-1.4.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ed6a56fc9ac7b61f9d96be6bf54cda1db061bd2e721183c5ed796f630adcf3c
BLAKE2b-256 checksum
How to use checksums
d9b50ef1807a4f0a8f73bb344c52a102140359a4ab3441f9a808e1b3de199c70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Security for gron 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page