Skip to content

CSV and JSON import export tips

minar edited this page Feb 10, 2023 · 2 revisions

Manage your events in CSV or JSON format

Even if this feature is experimental and advanced, Birday can export the events in CSV and JSON format, and restore files in the same format in the smartest way possible. If you want to use this export/import strategy and edit the files without breaking the import procedure, follow this simple guide!

0 - Before proceeding

CSV and JSON are advanced file formats, ideal to store text but unoptimized for images. So this kind of import/export won't support images, ever. Every other field is just text, so it is fully supported and editable. JSON is just text but you can manage and format it online (Google is your friend) and CSV can be opened using Excel or other similar programs.

1 - JSON import/export

Here's an example of exported JSON for different event types:

[
  {
    "name": "Jennifer",
    "notes": "this is a note",
    "originalDate": "1969-02-11",
    "surname": "Aniston",
    "type": "BIRTHDAY",
    "yearMatter": true
  },
  {
    "name": "World Water Day",
    "notes": "still note",
    "originalDate": "2021-03-22",
    "surname": "",
    "type": "OTHER",
    "yearMatter": false
  },
  {
    "name": "Damiano",
    "notes": "this is another note",
    "originalDate": "2021-09-22",
    "surname": "David",
    "type": "NAME_DAY",
    "yearMatter": false
  }
]

The only important condition here is the YYYY-MM-DD date format, the event type name (see the following paragraph for details) and the existence of the main fields (basically just name and originalDate) You can import a similar JSON in a no-SQL DB like MongoDB to edit and manipulate it, if you wish.

2 - CSV import/export

Here's an example of exported CSV for different event types:

type, name, surname, yearMatter, date, notes
BIRTHDAY,Jennifer,Aniston,true,1969-02-11,this is a note
OTHER,World Water Day,,false,2021-03-22,still note
NAME_DAY,Damiano,David,false,2021-09-22,this is another note

As you can see, the order is important (Birday will try to import your CSV even if the first line is missing). If the last name is missing, just leave it empty, same for the notes. The date format is important, and is YYYY-MM-DD. The number of commas is important! The event type must be one of the following:

  • BIRTHDAY
  • ANNIVERSARY
  • DEATH_ANNIVERSARY
  • NAME_DAY
  • OTHER

If the type is unspecified or invalid, Birday will import it as a birthday.

3 - Additional ideas!

In case you don't know, there are many VCF to CSV converters online, and even ICS to CSV converters. This means that you can import almost any file into Birday, if you properly convert and adapt it. I'll try to improve the import strategy to recognize and map the fields if possible, but of course, some fields are unrecognizable and I still don't work miracles 😄

If you want to request a new section, please open an issue. I'll gladly accept any suggetion, especially if it can help other users to contribute in the project or to use the app 😄

Clone this wiki locally