Leave as is. With above example, field is read in as "ocid;id;date;tag;initiationType;tender" which shows up under additional fields.
Allow a dialect to be passed in. This defers all responsibility to the calling code.
Add a sniff boolean argument. If enabled, flatten-tool sniffs the dialect. The sample size and/or possible delimiters could also be passed in.
For CoVEs, flatten-tool's unflatten is called within lib-cove's convert_spreadsheet, which is called by a CoVE's view. The flattentool_options are derived from arguments to convert_spreadsheet – except for paths, encoding (utf-8-sig, cp1252, latin_1), metatab_vertical_orientation (True), convert_titles (True). So, whatever new arguments are added to unflatten will need to be added to convert_spreadsheet.
I think (2) is best, as it gives the most flexibility to the calling code.
I notice that some CSVs uploaded to the OCDS Data Review Tool use semi-colons.
With commas:
With semicolons:
Some possible behaviors:
sniff
boolean argument. If enabled, flatten-tool sniffs the dialect. The sample size and/or possible delimiters could also be passed in.For CoVEs, flatten-tool's
unflatten
is called within lib-cove'sconvert_spreadsheet
, which is called by a CoVE's view. Theflattentool_options
are derived from arguments toconvert_spreadsheet
– except for paths,encoding
(utf-8-sig, cp1252, latin_1),metatab_vertical_orientation
(True),convert_titles
(True). So, whatever new arguments are added tounflatten
will need to be added toconvert_spreadsheet
.I think (2) is best, as it gives the most flexibility to the calling code.