Skip to main content

gedcomtools

A comprehensive Python toolkit for parsing, converting, validating, and analyzing genealogical data using the GEDCOM 5.x, GEDCOM 7, and GEDCOM X data models.

gedcomtools provides:

  • GEDCOM 5.x parser and high-level facade
  • GEDCOM 7 parser, 18-phase validator, serializer, and interactive CLI
  • GEDCOM X structured object model
  • GEDCOM 5.x → GEDCOM X conversion
  • CLI tooling (gxcli, g7cli, validate7)
  • Advanced logging via loggingkit
  • Graph export utilities

Designed for historical records processing, genealogy research, and archival data pipelines.


Features

  • ✅ GEDCOM 5.x parser (gedcom5)
  • ✅ GEDCOM 7 parser, validator, and serializer (gedcom7)
  • 🔧 GEDCOM X object model (gedcomx) — in progress
  • 🔧 Converter (GEDCOM 5.x → GEDCOM X) — in progress
  • ✅ CLI tools (gxcli, g7cli, validate7)
  • ✅ Structured logging (loggingkit)
  • ✅ Sub-loggers (conversion, parser, io, etc.)
  • ✅ Runtime log inspection
  • ✅ Extensible schema system
  • ✅ Source, person, family, relationship modeling
  • ✅ Place and event normalization
  • ✅ Metadata and attribution handling
  • 🔧 Graph database export (ArangoDB) — in progress

Project Structure

gedcomtools/
├── gedcom5/                # GEDCOM 5.x parsing layer
│   ├── gedcom5.py          # High-level facade (Gedcom5)
│   ├── parser.py           # Low-level parser engine (Gedcom5x)
│   ├── elements.py         # Typed element/record classes
│   ├── helpers.py          # Element query helpers
│   ├── tags.py             # GEDCOM 5.x tag constants
│   └── source.py           # Source record helpers
├── gedcom7/                # GEDCOM 7 parsing, validation, and serialization
│   ├── gedcom7.py          # Parser + Gedcom7 class
│   ├── structure.py        # In-memory tree node (GedcomStructure)
│   ├── validator.py        # 18-phase structural/semantic validator
│   ├── writer.py           # GEDCOM 7 serializer
│   ├── models.py           # High-level detail dataclasses
│   ├── specification.py    # Tag rules, cardinality, enumerations
│   ├── g7interop.py        # Tag ↔ URI mapping
│   ├── exceptions.py       # Exception hierarchy
│   ├── g7cli.py            # Interactive browser/editor shell
│   └── validate7.py        # validate7 CLI entry point
├── gedcomx/                # GEDCOM X object model and conversion (in progress)
├── graph.py                # Graph export (persons, relationships)
├── loggingkit.py           # Structured logging framework
└── utils/                  # Shared utilities

Installation

pip install gedcomtools

Or from source:

git clone https://github.com/cartwrightdj/gedcomtools.git
cd gedcomtools
pip install -e .

Quick Start

Parse GEDCOM 5.x

from gedcomtools.gedcom5 import Gedcom5

g = Gedcom5("family.ged")

for person in g.individual_details():
    print(person.full_name, person.birth_year, person.death_year)

for family in g.family_details():
    print(family.husband_xref, family.wife_xref, family.marriage_year)

Parse and validate GEDCOM 7

from gedcomtools.gedcom7 import Gedcom7

g = Gedcom7("family.ged")

issues = g.validate()
for issue in issues:
    print(f"[{issue.severity}] {issue.code}: {issue.message}")

# Write back out
g.write("family_out.ged")

Convert GEDCOM 5.x → GEDCOM X (in progress)

The GEDCOM X object model and converter are under active development. The core object model (persons, families, relationships, sources, events, places, names, facts) is implemented. Conversion and CLI tooling are still being worked on.

from gedcomtools.gedcomx import GedcomX, GedcomConverter

converter = GedcomConverter()
gx = converter.Gedcom5x_GedcomX(ged)

CLI Tools

validate7 — GEDCOM 7 validator

validate7 family.ged
validate7 --lenient family.ged   # suppress undeclared extension tag errors
Exit code Meaning
0 Clean (warnings may still be printed)
1 One or more validation errors
2 Not a GEDCOM 7 file
3 File not found or cannot be read

g7cli — interactive GEDCOM 7 browser/editor

g7cli family.ged

Commands: load, reload, write, validate, info, ls, cd, pwd, show, find, set, add, rm, help, quit.

gxcli — GEDCOM X CLI

gxcli convert input.ged output.json

Logging

The project uses loggingkit for structured logging.

from gedcomtools.loggingkit import setup_logging, LoggerSpec

mgr = setup_logging("gedcomtools")
mgr.get_sublogger(LoggerSpec(name="conversion"))
mgr.get_sublogger(LoggerSpec(name="parser"))

Library modules use:

from gedcomtools.loggingkit import get_log

log = get_log("conversion")
log.info("Starting conversion")

Design Goals

  • Centralized logging control
  • Library-safe imports (no logging side effects)
  • Extensible schema support
  • Accurate GEDCOM X modeling
  • Robust error reporting
  • CLI + API parity
  • Clear separation of concerns

Roadmap

  • GEDCOM 5.x → GEDCOM 7 converter
  • GEDCOM X → GEDCOM 7 converter
  • JSON-LD export
  • RAG pipeline integration
  • Full test suite

License

MIT License


Author

David J. Cartwright


Build genealogy tooling like infrastructure: structured, observable, extensible.

Metadata

Release files for gedcomtools 0.6.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 gedcomtools 0.6.0
File Size Uploaded Provenance Actions
gedcomtools-0.6.0.tar.gz 213.2 kB Without provenance Details for gedcomtools-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 451.1 kB

Release files / gedcomtools-0.6.0.tar.gz

Download URL gedcomtools-0.6.0.tar.gz
Size 213.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5b01c29430a3b02887dd897381366afcfebf88cb19288ff8e8a5abee274b7d02
BLAKE2b-256 checksum
How to use checksums
d5794f972141666af28d0383f14a367a044312ff88318ec0480e38eebe9baf58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / gedcomtools-0.6.0-py3-none-any.whl

Download URL gedcomtools-0.6.0-py3-none-any.whl
Size 237.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b629442f2f29b3e80d32961b1e09c7730bff0fb091d4203905483e17bce494db
BLAKE2b-256 checksum
How to use checksums
96b4065fa2da3c694e23e688e5bd9250bda773cbbc8a326cdd748dc2f4cbf48e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for gedcomtools 0.6.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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