improver.utilities.cli_utilities module

improver.utilities.cli_utilities module#

Provides support utilities for cli scripts.

load_json_or_none(file_path)[source]#

If there is a path, runs json.load and returns it. Else returns None.

Parameters:

file_path (Optional[str]) – File path to the json file to load.

Return type:

Optional[Dict]

Returns:

A dictionary loaded from a json file, or None.

load_pickle_or_none(file_path)[source]#

If there is a path, load the pickled object and returns it. Else returns None.

Parameters:

file_path (Optional[str]) – File path to the pickled object file to load.

Return type:

Optional[list]

Returns:

A list of contained pickled objects, or None.