update_xl
Despite not being best practice, many teams continue to use Excel as a sort of lightweight ‘database’ due to its accessibility and familiarity.
This module simplifies the process of updating such ‘databases’, providing a set of features to make data updates more effortless, reliable, and traceable.
Key Features
Simplicity: Only needing to provide the data that needs to be updated - leave any other fields blank.
- The system automatically retains the original values for empty cells, streamlining the update process by eliminating the need to re-enter unchanged information.
Traceable Changes: Creates a human readable changelog showing exactly what was updated and when.
Data Validation: Comprehensive validation checks to ensure data integrity, such as checking for duplicates, invalid IDs, etc.
Append At End: Ability to append to, instead of overwrite, existing data. Useful for
Comments/Notescolumns, for instance.Preserve Formatting: Ability to preserve existing notes and formatting in the original data file.
Tracking Options
Configurable tracking options for the generated changelog. WIP.
TrackingOptions
TrackingOptions (ids:list[str], track_all_changes_cols:list[str])
Update
main
main (key_col:str, str_cols:Optional[list]=None, input_file:str='./Book1.xlsx', tracking_opts:__main__.TrackingOptions|None=None, _changelog_dir:str='./')
…
| Type | Default | Details | |
|---|---|---|---|
| key_col | str | Unique id column | |
| str_cols | Optional | None | Add all cols where there may be leading zeroes that should be preserved, or if the values should be read in as string. |
| input_file | str | ./Book1.xlsx | Path to input file |
| tracking_opts | main.TrackingOptions | None | None | TrackingOptions | None |
| _changelog_dir | str | ./ | Set path for changelog yml output. Default is cwd. |
| Returns | None |