scdynomics.utils.json

JSON file related tools

author: jy, nkmtmsys

Functions

decode([path])

Decode data from JSON format file.

encode([data, save_path, indent])

Encode data in json format file.

scdynomics.utils.json.decode(path: str = None)

Decode data from JSON format file.

Parameters:

path – <str Default = None> Path to the input file.

Returns:

<class ‘dict’>

scdynomics.utils.json.encode(data=None, save_path: str = 'out.js', indent: int = 4)

Encode data in json format file.

Parameters:
  • data – Either dict() or list() data to be encoded.

  • save_path – <str Default = ‘out.js’> Path to save the output file.

  • indent – <int Default = 4> Length of each indent.