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.

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.2.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.2.0
File Size Uploaded
gedcom7-1.2.0.tar.gz 61.5 kB Details

Built distribution (wheel)

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

Total release size: 93.9 kB

Release files / gedcom7-1.2.0.tar.gz

Download URL gedcom7-1.2.0.tar.gz
Size 61.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb07e4a43cb69d891bd1abc73d2c2bd66b3e0d33bb73448ebeaa75f0da4c046e
BLAKE2b-256 checksum
How to use checksums
7cc50a4fe7833c0af95feb3f9034ce0f3a6cdcbfc0bceb376f66438ad9cf10b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

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

Download URL gedcom7-1.2.0-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e830d6aca47539126071541dc1b8744fced28106c5624c73ccb915ed4dc2e4a
BLAKE2b-256 checksum
How to use checksums
f5acb9274a08183b0fe82b88532b8b724ac9e7b1955e34b2836c699e1ba17650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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