leeper / csvy

Import and Export CSV Data With a YAML Metadata Header
57 stars 3 forks source link

ok to add columnType as valid field descriptor option? #29

Open tvc-amaffei opened 4 years ago

tvc-amaffei commented 4 years ago

I'm strongly considering csvy for a project I'm working on in which I want to indicate meaning "hints" for columns in csv files.

It looks like the frictionless data folks have specified an interesting "columnType" option for their Fiscal Data Package Schema (https://specs.frictionlessdata.io/fiscal-data-package/#columntypes).

In an effort to "keep things simple" I don't see implementing their taxonomy and other parts of this scheme. Rather I would just modify the internal "add_variable_metadata" function to copy the value of columnType as yet another variable attribute (similar to the current label support).

Another approach would be to add a new logical "strict" parameter for read_csvy with a default of "TRUE". If set to "FALSE" it would allow any field variable to be copied as an attribute in the returned R table.

Is this a reasonable thing to do as part of the csvy package? If so, which approach would you prefer? Thank you.