dr_data.utilities package

Submodules

dr_data.utilities.db module

class dr_data.utilities.db.DatabaseUtility(conn_info)[source]

Bases: object

Database utility class

truncate_db()[source]

Truncates all of the delete in the database :return: None :rtype: None

dr_data.utilities.file module

class dr_data.utilities.file.FileUtility[source]

Bases: object

File utility class

static append_to_file(json_data, filename)[source]

This append JSON data to a file :param json_data: JSON data to append :type json_data: JSON :param filename: Name of the file :type filename: str :return: None :rtype: None

static generate_json_file(name, path, data)[source]

Generates a JSON file :param name: name of file to create :type name: str :param path: Path of the file to create :type path: str :param data: The JSON data to insert into the file :type data: JSON :return: Filename :rtype: str

static get_directory_files(directory)[source]

Get the files in a directory :param directory: Path of the directory :type directory: str :return: Dictionary of files :rtype: dict

static get_filename(name)[source]

Get the name of the file with date :param name: Name of file :type name: str :return: String of filename :rtype: str

static is_csv_file(selected_file)[source]

Check if a file is a CSV file :param selected_file: Path of the file to check :type selected_file: str :return: Boolean :rtype: bool

static read_file(file_path)[source]

Reads a file’s contents :param file_path: Path of the file :type file_path: str :return: Content of file :rtype: str

Module contents