Contents¶
Reading GEDCOM files¶
The function gedcom.parse()
reads a file, string, or file-like object and returns a gedcom.GedcomFile
.
-
gedcom.
parse
(obj)¶ Parse and return this object, if it’s a file.
If it’s a filename, it calls
parse_filename()
, for file-like objects,parse_fp
, for strings, callsparse_string
.Parameters: obj – filename, open file-like object or string contents of GEDCOM file Returns: GedcomFile
Writing GEDCOM files¶
gedcom.GedcomFile.save()
saves a gedcom.GedcomFile
to a specified filename, or file-like object.
-
GedcomFile.
save
(fileout)¶ Saves the contents of this GEDCOM file to specified filename or file-like object.
Parameters: fileout – Filename or open file-like object to save this to. Raises: Exception – if the filename exists
gedcompy¶

Python library to parse and work with GEDCOM (geneology/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.
Example Usage¶
>>> import gedcom
>>> gedcomfile = gedcom.parse("myfamilytree.ged")
>>> for person in gedcomfile.individuals:
... firstname, lastname = person.name
... print "{0} {1} is in the file".format(firstname, lastname)
Contributing¶
Run all unitttests with tox.