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 – 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 – 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 – 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 – 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
Type:argparse.ArgumentParser
gron.__main__.main() → None[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.