GEDCOM Codec

Codec to serialize/deserialize GEDCOM strings.

Codec works on most GEDCOM formats since it validates only lines format and levels nesting.

Usage

import 'package:gedcom_codec/gedcom_codec.dart';

void main() {
  // GEDCOM parsing:
  final document = GedcomCodec().decode(gedcomString);
  //           or  GedcomDecoder().convert(gedcomString);

  // GEDCOM usage:
  final individuals = document.getAllByTag('INDI');
  for (final individual in individuals) {
    print(
      'Individual ${individual.xref}: '
      '${individual.getByTagOrNull('NAME')?.lineVal}',
    );
  }
  
  // GEDCOM encoding:
  final encodedGedcomString = 
        GedcomCodec().encode(gedcomString);
  // or GedcomEncoder().convert(gedcomString, indent: '', eol: '\n');
  print(encodedGedcomString)
}

Additional information

Links:

GEDCOM files sources:

NOTICE:
This work comprises, is based on, or is derived from the FAMILYSEARCH GEDCOM™
Specification, © 1984-2025 Intellectual Reserve, Inc. All rights reserved.
“FAMILYSEARCH GEDCOM™” and “FAMILYSEARCH®” are trademarks of Intellectual
Reserve, Inc. and may not be used except as allowed by the Apache 2.0 license that governs this
work or as expressly authorized in writing and in advance by Intellectual Reserve, Inc.