Utils

Utility functions used throughout the project.

source

get_repo_directory

 get_repo_directory ()

source

get_data_directory

 get_data_directory ()

source

get_latest_file

 get_latest_file (directory:pathlib.Path)

Return the latest file, sorting by name for a given directory. Only returns files, not directories.


source

extract_file

 extract_file (filepath:pathlib.Path)

source

extract_files

 extract_files (filepath:pathlib.Path)

source

get_latest_directory

 get_latest_directory (directory:pathlib.Path)

Return the latest subdirectory, sorting by name for a given directory. Only returns directories, not files.


source

read_file

 read_file (filepath:pathlib.Path, format:str='json')

Read a file in either JSON or CSV format and return its contents.


source

append_to_file

 append_to_file (filepath:pathlib.Path, record:dict)

source

extract_file_name

 extract_file_name (path:pathlib.Path)