Closed reecehill closed 1 week ago
Note to self:
Due to a circular import when importing project.npda.general_functions.csv_upload, I have:
project.npda.general_functions.csv
To further improve distinction between read_csv()
pd.read_csv()
,
project.npda.general_functions.read_csv.read_csv()
has been renamed (and moved) to
project.npda.general_functions.csv.csv_parse.csv_parse()
This pull request includes significant refactoring and enhancements to the CSV handling functionality in the
project/npda/general_functions
module. The changes primarily focus on organizing the CSV-related functions into a dedicated subdirectory, adding new functionalities, and improving existing ones.Key changes include:
Refactoring and Reorganization:
project/npda/general_functions/csv
and updated import paths accordingly. [1] [2] [3] [4] [5] [6]New Functionality:
download_file
to handle file downloads and refactoreddownload_csv
to use this function. Introduced a newdownload_xlsx
function for downloading XLSX files. [1] [2]Enhancements:
csv_parse
function to parse CSV files into pandas DataFrames, handling various edge cases and data type conversions.write_errors_to_xlsx
function to generate an XLSX file highlighting validation errors in the CSV data.Bug Fixes:
serialize_error
function to ensure keys are correctly serialized as integers.Additional Improvements: