birday icon indicating copy to clipboard operation
birday copied to clipboard

Import and export in JSON

Open LaBaude32 opened this issue 3 years ago • 1 comments

Hi,

This is really a great application, but something is missing: import (and maybe export) in JSON format. I've seen questions asking for CSV format but maybe JSON is simpler.

To simplify the process, maybe you should impose a JSON structure to make parsing easier for you and reduce checks.

Thanks for your work

LaBaude32 avatar Jul 30 '22 18:07 LaBaude32

Hi, i'm glad you like the app! JSON is a great format, but it's pretty useless for the "average user" both in input and in output. I wrote on my (very long, compared to my free time) todo list to add such feature (both csv and JSON), but i'll probably keep it in a "developer settings" zone, since it's not useful for a good 95% of users. Also, there are a few problems:

  • When exporting, i can simply reproduce the db structure, no problem, both in csv and JSON. But since csv and JSON are editable and i should implement an import feature, here comes the second point
  • When importing, i should implement a long series of checks and more importantly, i should write a sort of "smart recognition", else the import would be quite stupid and based on a rigid and fixed structure. There's an high enough chance to mess up the entire db if i forget even a single check, even if, after all, if someone submits an invalid file, he/she could expect this :)

So, long story short: i'll work on it, but any suggestion is well appreciated.

m-i-n-a-r avatar Aug 08 '22 10:08 m-i-n-a-r

I'm working on some experimental and advanced settings, and between them i put a JSON importer and exporter (done in af266fa90cfaa5276ff47b14f2cded8d9c57730e ). It's not super smart, but it won't crash, it will output a well formed and formatted json and the import process will "normalize" the data to avoid weird behaviors and illegal lengths in the fields. It will be available in the next release 😄

m-i-n-a-r avatar Aug 30 '22 11:08 m-i-n-a-r