idmtools.utils.json module#

JSON utilities for idmtools such as encoders and decoders.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools.utils.json.IDMJSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]#

Bases: JSONEncoder

IDMJSONEncoder handles encoding IDM specific items.

default(o)[source]#

JSON Encode item.

Parameters:

o – Object to encode

Returns:

JSON encoded object

idmtools.utils.json.load_json_file(path: str) Dict[Any, Any] | List[source]#

Load a json object from a file.

Parameters:

path – Path to file

Returns:

Contents of file parsed by JSON