Parse JSON data out of a .gedcom file using gedcompy & python2.7
TODO: clean up code :: implement dates globally
Mac Installation
Windows Installation
Linux Installation
Download with this repository, and follow the installation steps.
navigate into the gedcompy folder and install:
cd gedcompy
python setup.py build
python setup.py install - may have to use sudo
Clone from this repository & move any .ged files into the GedComParse folder to be parsed into json.
python2.7: see abovepip(package installer python, included in python download)datetime(pip install datetime)gedcompy: see belowsix(pip install six)
child-process- running python from nodemulter- for uploading filesbody-parserexpressmongoose
- Move the gedcom file into the GedComParse folder for use.
Usage:
$ python gedcomparse.py INPUT_FILE.ged OUTPUT_FILE.json
$ python gedcomparent.py INPUT_FILE.ged OUTPUT_FILE.json
$ python gedcompairbonds.py INPUT_FILE.ged OUTPUT_FILE.json
$ python gedcominfo.py INPUT_FILE.ged OUTPUT_FILE.json
Parse a .gedcom file into .json for use in FamilyGenie
Parses out information for individual people in a gedcom file, into json.
Attributes:
- First Name
- Last Name
- Sex
- Birth Date (and if the date is approximated)
- Birth Place
- Death Date (and if the date is approximated)
- Death Place
- Person Id
Parses out information for child / parent relationships. There are different records for each relationship, so each individual may have a separate record for each of their parent relationships.
Attributes:
- Child Id
- Parent Id
- Relationship Type (father / mother)
- Sub Type (biological)
- Start Date (defaults to birthday of the child, and if that date is approximate)
- End Date
Parses out information for pair bond relationships. Any given person may have multiple relationships. Any given person may have a relationship where the second partner is not known.
Attributes:
- Person One Id
- Person Two Id
- Relationship Type
- Start Date (and if it's approximated)
- Sub Type
- End Date
Parses out any extraneous information about a person. Events, Source information, Residence information, etc.
Source Attributes: **
- Person Id
- Person Source Id
- Source Reference
- Source Page
Event Attributes:
- Person Id
- Event Type
- Event Date
- Event Place
- Event Info
Residence Attributes:
- Person Id
- Residence Information
- Residence Start Date (and if it's approximated)
- Residence Place
- Residence Source + Source Information **
Various Events Attributes:
- Person Id
- Event Type
- Event Date (and if it's approximated)
- Event Place
- Event Info
- Event Source + Source Information **
Burial Attributes:
- Person Id
- Burial Date (and if it's approximated)
- Burial Place
- Burial Source**
Divorce Attributes:
- Person Id
- Divorce Date (and if it's approximated)
- Divorce Place
- Divorce Source + Source Information **
if the given file does not hold any particular record,
nullwill be the value given
Multer (npm package) handles the uploads and places them in a folder.
exec (child_process, npm package) handles the execution of the python program in the terminal, from the node server without any additional work.
post to the 'uploads' folder (or wherever you like), and the exec function will run it through the parser, placing the result in another folder.
// multer options
var upload = multer({ dest : 'uploads/' });
// executable child process:
var exec = require('child_process').exec;
//run the process on post
app.post('/uploads', upload,
function(req,res,next) {
// run the python parser on the gedcom file
exec('python path/to/gedcomparse.py path/to/gedcom-file.ged path/to/new-json-file.json',
function(err) {
if(err) {
console.log(err);
}
// then to put the files into mongo ...
exec('mongoimport --db database --collection collection --type json --file path/to/json-file.json --jsonArray',
function(err) {
if(err) {
console.log(err);
}
});
});
res.redirect('/');
});Python library to parse and work with GEDCOM (genealogy/family tree) files.
It's goal is to support GEDCOM v5.5 (Specification Here).
This is released under the GNU General Public Licence version 3 (or at your option, a later version). See the file LICENCE for more.
My fork of gedcompy here.