API

gron

All imports here are unused in this module but exported as public interface.

gron.gron(input_: str) → str[source]

Transform JSON into parseable str.

This method takes a JSON string and transforms it into a grepable equivalent form.

Parameters:input (str) – JSON
Returns:Transformed output
Return type:str

gron.gron

Gron’s core functions.

gron.gron.convert(name: str) → str[source]

Convert path name into valid JSON.

Parameters:name (str) – a path name
Returns:valid JSON path
Return type:str
gron.gron.gron(input_: str) → str[source]

Transform JSON into parseable str.

This method takes a JSON string and transforms it into a grepable equivalent form.

Parameters:input (str) – JSON
Returns:Transformed output
Return type:str
gron.gron.walk(node: Any, name: str) → str[source]

Translate Python element to JSON.

This method recursively visits each element of a Python object and returns the JSON representation.

Parameters:
  • node – A python object (e.g. dict, list, int, etc)
  • name (str) – The name (i.e. path) of the parent element
Returns:

Transformed JSON for this element

Return type:

str

gron.__main__

Gron’s command line interface (CLI).

gron.__main__.parser

argparse.ArgumentParser

gron.__main__.main()[source]

Gron’s CLI

This method reads the arguments for the command line interface and runs gron.

gron.version

This module provides gron’s version.

gron.version.__VERSION__

str – gron’s version, it follows the semver standard