read_json#

read_json(json_file: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], print_file: bool = True) dict[source]#

Read a JSON file

>>> json_path = 'D:/path/to/json.json'
>>> read_json(json_path, print_file=False)
{"A": 1, "B": 2}
Parameters
  • json_file (Union[str, CloudPath, Path]) – Path to JSON file

  • print_file (bool) – Print the configuration file

Returns

JSON data

Return type

dict