Gedcom 7 import addon
This is a draft of an import addon for Gedcom 7 files based on the standalone library. The implementation is not complete yet, but ready for testing & feedback.
Two problems regarding the plugin (i.e., independent of the library):
- When using
gedas extension, the plugin is always overruled by the core Gedcom (6) plugin. That's why I had to change the extension toged7, but that's an ugly hack. Is there a way around it? - I added
gramps_gedcom7(with underscore) torequires_modbecause that's the module that is required, but there are two problems with this:- The package is called
gramps-gedcom7(with hyphen) and there is currently no way to specify that in thegprfile - There is currently no way to specify a target version of a pip package.
- The package is called
To install the required package, use
python -m pip install --upgrade gramps-gedcom7
MIT license
Wrong license to be part of Gramps. But ok as third party addon!
EDIT: This is the addons-sources repository and I'm going to bed .... sorry for the noise!!
In a Discourse "Idea" and related feature request, Woody notes that GedTool (VBA software $35) uses a "mapping table" GEDCOM dialect lookup file to map which importer to use. This differentiates between 5.5.x and 7.x and originating software.
https://gramps.discourse.group/t/new-gedcom-import-module/7045
There are other formats that could also benefit from version recognition branching. The built-in vCard importer only recognizes v3.0 (and only a limited subset) but many Smartphones only export v2.1
The format version (e.g. "7.0") is required in the header in the Gedcom 7 specificiation so detecting it is trivial, the problem is just that this would require a change in Gramps core.
I guess I am stupid, but I cannot see how to test (on Mac). I copied the ImportGedcom7 folder to my gramps60/plugins folder. Copied your maximal70.ged (to maximal70.ged7). Then went to FamilyTrees --> Import but gramps does not seem to find the new import type (ged7).
I tried both with and without the standalone (gramps-gedcom7) library - expected error on import without it. No warnings/errors in the console, so I suspect it is not installed correctly.
Does GEDCOM 7 show up in the "Select file type" drop down in the file dialog? (Note: I was first confused because I had to scroll that dialog to see the last, new entry.)
No, it does not. Below is the snapshot - there is no scrolling needed to see the full list.
Was anyone else able to test this? Perhaps it's a Mac issue?
I noticed that this behaviour (Gedcom 7 not offered in the file dialog) happens when the library is not installed or not detected.
I was expecting an error if the library was not installed in the line:
from gramps_gedcom7 import import_gedcom, ImportSettings
but didnt get any. I tried with and without the library installed - no difference. I put the gramps_gedcom7 folder in the same plugins folder (since Mac uses a bundle)
I think the reason there is no error is that the module is listed as mod_required, and if that module is not importable, Gramps skips the initialization of the plugin, so it is silently absent.
D'ohhhh
I manually installed gramps_gedcom7 not using pip (given gramps on a Mac is a bundle, any additional packages need to be added to the bundle and not to the standard OS). So I did not load gedcom7 package.
Once I also loaded gedcom7 v0.4.0, things worked.
Did anyone have a chance to play around? How should I deal with the extension issue, should be advise users to rename their files?
How should I deal with the extension issue, should be advise users to rename their files?
Maybe adapt the suggestion at the end this article?
- 2014-09-28 GEDCOM Version Detection
- https://github.com/FamilySearch/GEDCOM/blob/main/version-detection/version-detection.md
Another way is to look at how the GEDCOM Extensions addon handles exports and see the enhancement request to refactor it to support imports?
- 10550 Refactor Gramps GEDCOM import so as to support GEDCOM extension addons
The GEDCOM extension outputs the file to *.ged2 and afterwards, you can change the extension from ".ged2" to ".ged" and treat as a normal GEDCOM file.
Detecting that a file is GEDCOM7 is easy, the problem is that currently, when it has extension .ged, Gramps core will use the built in parser and ignore the addon.
Then Gramps core needs to be updated to support the detection or feature 10550 be implemented to monkey patch the Gramps GEDCOM import detection in your addon?
Which is what you stated above ¯_(ツ)_/¯
Deleted the internal GEDCOM 5 importer; but probably could have hidden it via the plugin manager; which could be a suggestion to users of the addon at least during development?
Tested using the familysearch ged 7 example files and these so nothing from the wild yet.
Thanks for the addon ✨
Exciting news @glamberson has submitted pr#1 that needs testing ( not sure if it works with this addon yet ) .
This PR adds support for three GEDCOM 7 extensions that enable full compatibility with GRAMPS' advanced data model, addressing the long-standing issue of data loss when exchanging GEDCOM files with GRAMPS
Note the PR was withdrawn see https://github.com/DavidMStraub/gramps-gedcom7/pull/1#issuecomment-3133442884
How do we proceed? I think this could be merged if it weren't for the problem with the extension. Should we go with ged7 for now?
How do we proceed? I think this could be merged if it weren't for the problem with the extension. Should we go with ged7 for now?
This gramplet is a very thin wrapper for the external library. I suspect very little maintenance will be needed in the gramplet, as opposed to updates to the external library.
Decision 1 options:
- Update core gedcom import for 6.1 to add recognizing gedcom version.
- This eliminates the issue of the extension.
- Release separate Gedcom7 import module as 3rd party.
- Would there be a roadmap for migrating from 3rd party to core or more likely, having it subsumed into current core gedcom import?
- Still need the extension name resolved. And it may need changed later if subsumed into core.
Decision 2: how do we deal with the gramps-gedcom7 external library? If it is added to the Win/Mac bundle for 6.1, then its maintenance is tied to core releases, which is not optimal. Alternately, if it is not distributed with 6.1, then Win/Mac users cannot use it. And Linux users will need to pip install the library to access.
I think we need both decisions before going further.
Should we go with ged7 for now?
@DavidMStraub Yes 👍 should allow people to initially use and test it.
And for the next Gramps major (6.1.x or 7.x.x) release decide what should happen?
I think we need both decisions before going further.
I'm open to all options and waiting for the decision to be made.