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.

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

gedcom7-1.0.0.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gedcom7-1.0.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file gedcom7-1.0.0.tar.gz.

File metadata

  • Download URL: gedcom7-1.0.0.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gedcom7-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f5de714b4f3a1fbf2a79517caeb355e5086656fa3841ad95415eb00d8f3f4cbf
MD5 6ad617a8be87a2536f323fd93bc94805
BLAKE2b-256 dce8a4edc8f7c5e36cfec107392c10111e856c6346d19b864174eec2a8328e83

See more details on using hashes here.

Provenance

The following attestation bundles were made for gedcom7-1.0.0.tar.gz:

Publisher: pypi.yml on DavidMStraub/python-gedcom7

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gedcom7-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gedcom7-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gedcom7-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 919a7eaf4feecdf3d624fd602f2a9b0d8013d2e8448b5fd5090306ae37bdd913
MD5 02d5e448dfe17b044a5731095d05dc04
BLAKE2b-256 cbd8b1289eae3f35b51f58fd7607af35026bb27504872e1ea4b76c4932c0378e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gedcom7-1.0.0-py3-none-any.whl:

Publisher: pypi.yml on DavidMStraub/python-gedcom7

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.1.0

2 files

This release

1.0.0 This release

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page