lisc.io.io.load_api_key

lisc.io.io.load_api_key(file_name, directory=None, required=False)[source]

Load an API key from a file.

Parameters
file_namestr

Name of the file to load.

directorystr or Path or SCDB, optional

Folder or database object specifying the location of the file to load.

requiredbool, optional, default: False

Whether loading the API key file is required for continued execution. If True, this function will raise an error if the requested file is not found. If False, this function will return None if the file is not found.

Returns
api_keystr or None

The loaded API key.

Raises
FileNotFoundError

If the requested file. Only raised if required is True.

Notes

This function assumes the API key is in a single-line txt file.