Skip to main content

gedcom7

Tests PyPI Python versions License: MIT

Read and write GEDCOM 7 files in Python — a format for exchanging genealogical data between family history applications.

Background

Reading and writing are both based on regular expressions generated directly from the ABNF grammar via abnf-to-regexp, and on the structure and payload tables extracted from the specification. The library targets FamilySearch GEDCOM 7.0.18: it does not attempt to parse files that are not standards compliant, and raises rather than writing malformed lines.

Installation

python -m pip install gedcom7

Usage

import gedcom7

with open("my_gedcom.ged", "rb") as f:
    records = gedcom7.load(f)

with open("out.ged", "wb") as f:
    gedcom7.dump(records, f)

Each record is a GedcomStructure with a tag, an optional xref and pointer, the raw text payload, and children. Its value property casts the payload to the data type the specification gives that structure type.

loads and dumps are the string equivalents. Non-conforming input raises GedcomParseError, a ValueError carrying line_number. A pointer to a record that does not exist is kept rather than rejected; gedcom7.validate(records) lists each one as a dangling-pointer error.

GEDZIP

with gedcom7.GedzipReader("family.gdz") as archive:
    records = archive.records
    with archive.open("media/photo.jpg") as f:  # a FILE payload
        data = f.read()

gedcom7.dump_gedzip(records, "out.gdz", {"media/photo.jpg": data})

File content can be given as bytes, a path, or a function returning an open binary file. Where the files are stored is left to the caller.

Development

python -m pip install --group dev --editable .
pytest && mypy && ruff check . && ruff format --check .

The version is derived from git tags by setuptools-scm. To release, push a vX.Y.Z tag and publish a GitHub release for it.

Credits

Inspiration was drawn from the Javascript parser.

Metadata

Release files for gedcom7 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gedcom7 1.3.0
File Size Uploaded Provenance Actions
gedcom7-1.3.0.tar.gz 65.6 kB With provenance Details for gedcom7-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gedcom7 1.3.0
File Interpreter ABI Platform Actions
gedcom7-1.3.0-py3-none-any.whl Python 3 none any Details for gedcom7-1.3.0-py3-none-any.whl

Total release size: 101.2 kB

Release files / gedcom7-1.3.0.tar.gz

Download URL gedcom7-1.3.0.tar.gz
Size 65.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d745508958a399b3e3b89ddae8194530b20620286cacf5554619416f59da0c5f
BLAKE2b-256 checksum
How to use checksums
b30700c3b513b184d752b466492a5f8be5e6fe7e62f407c7b8bc65012e088235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / gedcom7-1.3.0-py3-none-any.whl

Download URL gedcom7-1.3.0-py3-none-any.whl
Size 35.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b21fda3fe742db0aa6860cb070bf589f7c8d80bbd6edc9fe66b74fd235b01e6
BLAKE2b-256 checksum
How to use checksums
f189d37a05582de892ffc8ea5072bdafff603aaa14df1ad4e07b483754a4942d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for gedcom7 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gedcom7-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page