Source Provenance
SourceProvenance
Where a value came from in the source data, for use in the provenance parameter of the add_... methods.
row is 1-based and counts the header row, matching what a researcher sees in the spreadsheet program.
Invalid input never raises an error:
- An empty
source_filebecomes an empty string and emits a warning. - An empty
sheet,roworcell(for exampleNone,pd.NAor"") becomesNone. - A
sheetorcellthat is not a string is converted to a string. - A
rowthat is not an integer (for example"abc"or5.5) becomesNoneand emits a warning.
Examples:
provenance = xmllib.SourceProvenance(
source_file="data.xlsx",
sheet="Sheet1",
row=5,
cell="C",
)
Source code in dsp/dsp-tools/packages/dsp-tools/src/dsp_tools/xmllib/models/provenance.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |