How does Gramps open a GEDCOM directly

When you choose a GEDCOM file from your OS desktop and choose Gramps as the Tool to open it, then Gramps launches, creates a new Tree with the filename and imports the selected GEDCOM file.

How can this same simplified and streamlined import process (for a specified GEDCOM file) be done in code?

And can such a process be called from a ‘hotlink’ styled text in a Gramplet or QuickReport?

@Serge did a nice bit of experimental work in PR1297 to create a starting family in a new tree in response to Novice user UX proposed solution and Novice Onboarding Gramplet. But it is too heavy in the Interface (the user has to make too many choices and they have to be completed in the correct order) and the sample family is hard-coded (an embedded XML) and only with English placeholder names. Finally, it is fairly well hidden and ONLY available if NO Trees exist in the Manage Family Trees dialog. (The last item makes the feature and its interface tedious to beta test.)

It would be more flexible to have links to starter GEDCOMs (or .gramps files) with a common naming pattern: StartingFamily-en.ged, StartingFamily-fr.ged, StartingFamily-fr.gramps
Non-programmers could create/submit Trees with localized surnaming conventions.

I have done some preliminary work with a spreadsheet within cell ranges that can be copied and pasted into the Import Text gramplet if TSV delimiter dialect has been selected. (An added benefit to the Import Text is that the input data is visible before and after being processed.) A spreadsheet (or its CSV export file) is more universally accessible than GEDCOM. Few computer users have GEDCOM inspection or editing tools installed.

There are some hiccups. It is hard to explain Principle and Selection of the Tab delimiter dialect. (The difficulty is in regards to both the purpose and accessing the interface.) Also, the CSV field names have some idiosyncrasies. (Such as the “Death Cause” is actually the “Death Description” for a Death event “type”, not the description for a “Other → Cause Of Death” Event type. And the Date for a Place is ambiguous. Is it the date of existence for the Place name? Or the date of enclosure?)


(preliminary .ods spreadsheet downloadable from my GitHub repository)