citylearn.utilities module
- class citylearn.utilities.FileHandler[source]
Bases:
object
- static read_json(filepath: str, **kwargs) dict [source]
Return JSON document as dictionary.
- Parameters:
filepath (str)
document. (pathname of JSON)
**kwargs (dict) – Other infrequently used keyword arguments to be parsed to simplejson.load.
- Returns:
JSON document converted to dictionary.
- Return type:
dict
- static read_pickle(filepath: str, **kwargs) Any [source]
Return pickle file as some Python class object.
- Parameters:
filepath (str)
file. (pathname of pickle)
**kwargs (dict) – Other infrequently used keyword arguments to be parsed to pickle.load.
- Returns:
Pickle file as a Python object.
- Return type:
Any
- static read_yaml(filepath: str) dict [source]
Return YAML document as dictionary.
- Parameters:
filepath (str)
document. (pathname of YAML)
- Returns:
YAML document converted to dictionary.
- Return type:
dict
- static write_json(filepath: str, dictionary: dict, **kwargs)[source]
Write dictionary to JSON file.
- Parameters:
filepath (str) – pathname of JSON document.
dictionary (dict) – dictionary to convert to JSON.
**kwargs (dict) – Other infrequently used keyword arguments to be parsed to simplejson.dump.