gno-to-ged
v1.0.5
Published
GenoPro .gno to GEDCOM .ged converter (TypeScript)
Readme
GNO → GED converter (TypeScript)
A minimal, extensible TypeScript tool to convert GenoPro .gno files to GEDCOM .ged and vice versa.
Features:
- Automatically detects and decompresses gzip/zlib/zip-packed
.gnofiles - Parses the resulting XML and maps it heuristically to a simple internal model
- Emits GEDCOM 5.5.1 with comprehensive record support:
- INDI (individuals) with NAME, SEX, events (BIRT/DEAT with DATE/PLAC), FAMC/FAMS
- FAM (families) with HUSB, WIFE, CHIL references
- PLAC with MAP structure (LATI/LONG) for place coordinates embedded in events
- Source records (SOUR) with title, author, and publication info
- Recursively resolves all references:
- Place references (e.g.,
place00055) are resolved and coordinates embedded in events - Source references are fully expanded
- Family child references are properly maintained
- Place references (e.g.,
- Bidirectional conversion: GNO ↔ GED with round-trip fidelity
- Node 20+ and ESM-friendly
Note: GenoPro .gno XML schemas may vary across versions or exports. The mapper aims to handle typical containers and attributes (GenoPro/Genealogy, Individuals/Persons, Families/Unions, Places, Sources, etc.). For best fidelity, share a sample .gno and we can refine the mapper accordingly.
Install
npm i
npm run buildCLI
# Convert .GNO to .GED
npx gno-to-ged -i input.gno -o output.ged
# Convert .GED to .GNO (GenoPro format - default)
npx ged-to-gno -i input.ged -o output.gno
# Convert .GED to .GNO with specific format
npx ged-to-gno -i input.ged -o output.gno --format genopro
npx ged-to-gno -i input.ged -o output.gno --format gramps
npx ged-to-gno -i input.ged -o output.gno --format legacy
npx ged-to-gno -i input.ged -o output.gno --format myheritage
npx ged-to-gno -i input.ged -o output.gno --format generic
# With compression
npx ged-to-gno -i input.ged -o output.gno.gz --gzip
npx ged-to-gno -i input.ged -o output.gno.zip --zipSupported GNO Formats
The converter supports multiple GNO/XML genealogy formats from popular applications:
- genopro (default): GenoPro XML format with proper namespace declarations (
http://genopro.com/), version info, and<GenoPro><Genealogy>root structure - gramps: Gramps XML 1.7.1 format with
<database>root following the Gramps XML schema specification (http://gramps-project.org/xml/1.7.1/) - legacy: Legacy Family Tree format with
<FamilyTree>root and proper namespace declarations - myheritage: MyHeritage format with
<MyHeritage>root and MyHeritage-specific element structure - generic: Generic genealogy XML format (simplified structure without specific namespace requirements)
During development (without building):
npm run dev:gno -- -i input.gno -o output.ged
npm run dev:ged -- -i input.ged -o output.gno --format grampsLibrary API
// When using as an installed package
import { gnoToGed, gedToGno, type GnoFormat } from "gno-to-ged";
// When using locally in this repository
// import { gnoToGed, gedToGno, type GnoFormat } from "./dist";
// Convert GNO to GED
const gedText = await gnoToGed("path/to/input.gno"); // or Buffer
console.log(gedText);
// Convert GED to GNO with format selection
const gedcomText = "0 HEAD\n1 SOUR ...";
const gnoBuffer = await gedToGno(gedcomText, {
format: "legacy", // or "genopro", "gramps", "myheritage", "generic"
gzip: false,
zip: false
});
// Write to file
import fs from "fs/promises";
await fs.writeFile("output.gno", gnoBuffer);How it works
- Reads the
.gnofile as a Buffer. - Detects compression (gzip/zlib/zip) and decompresses if needed.
- Parses the result as XML.
- Maps XML → internal model (persons, families, places, sources).
- Recursively resolves all references (e.g., place IDs → embedded coordinates).
- Serializes internal model → GEDCOM (5.5.1) with proper MAP/LATI/LONG structure for places.
For GED → GNO conversion:
- Parses GEDCOM file into internal model.
- Extracts all records (individuals, families, places from MAP structures, sources).
- Generates GNO XML with proper structure and references.
- Optionally compresses the output (gzip/zip).
Known limitations
- The mapper is heuristic. For full fidelity, we may need to align to your exact
.gnoXML schema and field names. - Only a subset of GEDCOM tags are supported by default. Extending the mapper is straightforward—add fields in
src/mappers/gno-to-model.tsandsrc/mappers/model-to-ged.ts. - Place coordinates are embedded in events using GEDCOM standard MAP/LATI/LONG structure (not as separate records).
Requirements
- Node.js 20+
- macOS/Linux/Windows
License
MIT (adjust as needed).
