gedcom7
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.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gedcom7-1.1.0.tar.gz.
File metadata
- Download URL: gedcom7-1.1.0.tar.gz
- Upload date:
- Size: 60.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e18d11c5e39169033d23fd2d240b3ef16549d1ddd6ed9fb3dd47d45fe7a0136
|
|
| MD5 |
81c7b424b06216400649266e29ed0536
|
|
| BLAKE2b-256 |
541a30b3f98ce05a0c39d3df10d937839a4427d7f078f7cceb79e6ce49d9b835
|
Provenance
The following attestation bundles were made for gedcom7-1.1.0.tar.gz:
Publisher:
pypi.yml on DavidMStraub/python-gedcom7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gedcom7-1.1.0.tar.gz -
Subject digest:
2e18d11c5e39169033d23fd2d240b3ef16549d1ddd6ed9fb3dd47d45fe7a0136 - Sigstore transparency entry: 2500941779
- Sigstore integration time:
-
Permalink:
DavidMStraub/python-gedcom7@16bbc22b0ffb0a21d4f08033a87089bcd6548541 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/DavidMStraub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@16bbc22b0ffb0a21d4f08033a87089bcd6548541 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gedcom7-1.1.0-py3-none-any.whl.
File metadata
- Download URL: gedcom7-1.1.0-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1f7abc437778a23b7a9654a396e671b0a90339a31bf20db3743eff720109291
|
|
| MD5 |
ffc421b1ed11e032e31ec0f583245fce
|
|
| BLAKE2b-256 |
dcd5b3fdcc263df986e96aaa992308d2c7e3f9836201302f00eaf3ca847f28b1
|
Provenance
The following attestation bundles were made for gedcom7-1.1.0-py3-none-any.whl:
Publisher:
pypi.yml on DavidMStraub/python-gedcom7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gedcom7-1.1.0-py3-none-any.whl -
Subject digest:
b1f7abc437778a23b7a9654a396e671b0a90339a31bf20db3743eff720109291 - Sigstore transparency entry: 2500941819
- Sigstore integration time:
-
Permalink:
DavidMStraub/python-gedcom7@16bbc22b0ffb0a21d4f08033a87089bcd6548541 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/DavidMStraub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@16bbc22b0ffb0a21d4f08033a87089bcd6548541 -
Trigger Event:
release
-
Statement type: