jqnatividad / qsv

CSVs sliced, diced & analyzed.
The Unlicense
2.31k stars 66 forks source link

[Feature Request] safer safenames #1921

Open terefang opened 1 week ago

terefang commented 1 week ago

while the current safename option are many and database column-name safe, actual naming schema might not be what the user wants.

my proposal would be the (s)afe mode as defined be the following steps:

(s)afe mode should operate in ascii-chars-only mode, (S)afe mode should work in unicode-chars mode.

jqnatividad commented 1 week ago

FYI - I originally designed safenames to help with real-world data ingestion using Datapusher+ for CKAN - especially with spreadsheet header names.

That's why its defaults are heavily informed by CKAN requirements.

I can certainly make it "safer" using your proposal, though I have to prioritize CKAN data ingestion.

Perhaps, I can just add a new command called safernames, so as not to perturb safenames which is working quite well in our pipelines.

terefang commented 1 week ago

hmm .. would the creation of a new subcommand with similar functionality be counter-intuitive ?

jqnatividad commented 1 week ago

Point taken...

I'll just have to add it to safenames then in a way that doesn't have breaking API changes...

terefang commented 1 week ago

how about --mode "s" and --mode "S" ?

jqnatividad commented 1 week ago

Yes... that's the easy part...

The part that I'm thinking about is how the JSON output formats will work...