import json


def load_configs_from_json(file):
    """ Load Librarian service configuration from local json config file

    See documentation for expected contents of the config file

    Args:
        file (str): json file containing the config values

    Raises:
        ValueError: if file given is not defined
        TypeError: if data in environment variable is not valid json
    """
    # Load the file:
    with open(file, 'rb') as f:
        config = json.load(f)
    return config