Utils

Catch-all module containing methods that might be helpful to GNewCash users.

utils.delete_log_files(gnucash_file_path: str) None[source]

Deletes log files at the specified directory.

Parameters:

gnucash_file_path (str) – Directory to delete log files

utils.safe_iso_date_formatting(date_obj: datetime) str[source]

Attempts for format a date with timezone information. If it fails, it tries to format without timezone information.

Parameters:

date_obj (datetime.datetime) – Date object to format

Returns:

Formatted date string

Return type:

str

utils.safe_iso_date_parsing(date_string: str) datetime[source]

Attempts to parse a date with timezone information. If it fails, it tries to parse without timezone information.

Parameters:

date_string (str) – Date string to parse

Returns:

Parsed date object

Return type:

datetime.datetime