utils

uk_covid19.utils.save_data(data: str, path: str, ext: uk_covid19.data_format.DataFormat) → NoReturn[source]

Saves the data in a file.

Parameters
  • data (str) – Data to be saved.

  • path (str) – Path (relative or absolute) to the file in which the data is to be saved. The path must end with the value defined for the ext argument.

  • ext (DataFormat) – Extension (type) of the file.

Returns

Return type

NoReturn

Raises
  • IsADirectoryError – If the filename is not defined in the path.

  • ValueError: – If the filename does not end with the correct extension for the requested format.

  • NotADirectoryError – If the parent directory does not exist.

  • PermissionError – If the current user does not have permission to write in the directory.