Gedcom.Vector
1.0.0
See the version list below for details.
dotnet add package Gedcom.Vector --version 1.0.0
NuGet\Install-Package Gedcom.Vector -Version 1.0.0
<PackageReference Include="Gedcom.Vector" Version="1.0.0" />
<PackageVersion Include="Gedcom.Vector" Version="1.0.0" />
<PackageReference Include="Gedcom.Vector" />
paket add Gedcom.Vector --version 1.0.0
#r "nuget: Gedcom.Vector, 1.0.0"
#:package Gedcom.Vector@1.0.0
#addin nuget:?package=Gedcom.Vector&version=1.0.0
#tool nuget:?package=Gedcom.Vector&version=1.0.0
Gedcom.Vector
A portable .NET 8 GEDCOM 5.5.1 parser, lexer, encoder, and serializer. Zero genealogy-app-specific dependencies — just Microsoft.Extensions abstractions.
Features
- 📄 Full GEDCOM 5.5.1 support — parses HEAD, INDI, FAM, OBJE, and TRLR records
- 🔡 Multi-encoding support — UTF-8 (with/without BOM), UTF-16 (with BOM), ANSEL, and ANSI/Windows-1252
- ⚡ Streaming lexer — low-allocation line-by-line tokeniser backed by
GedcomLexerandGedcomTreeBuilder - 📦 NuGet-ready — structured for
dotnet packwith symbols (.snupkg) - 💉 DI-friendly — integrates with
Microsoft.Extensions.DependencyInjectionviaAddGedcomImport() - 🔒 No app-specific dependencies — only
Microsoft.Extensions.*abstractions; no EF Core, no ASP.NET, no databases - ✅ Deterministic builds — reproducible byte-for-byte output
Quick Start
Install
dotnet add package Gedcom.Vector
Register with Dependency Injection
// Program.cs / Startup.cs
builder.Services.AddGedcomImport(builder.Configuration);
This registers IGedcomImportAdapter as a singleton, bound to the GedcomImport configuration section.
// appsettings.json
{
"GedcomImport": {
"MaxFileSizeBytes": 52428800
}
}
Parse a GEDCOM file
public class MyService(IGedcomImportAdapter gedcom)
{
public GedcomParseResult Import(Stream gedcomStream)
{
var result = gedcom.Parse(gedcomStream);
foreach (var person in result.Persons)
Console.WriteLine($"{person.FirstName} {person.LastName}");
foreach (var family in result.Families)
Console.WriteLine($"Family: {family.HusbandXref} + {family.WifeXref}");
return result;
}
}
Export to GEDCOM
public class ExportService(IGedcomExportWriter writer)
{
public async Task ExportAsync(GedcomParseResult data, Stream output)
{
await writer.WriteAsync(data, output);
}
}
Without DI (direct use)
using var stream = File.OpenRead("family.ged");
var adapter = new GedcomImportAdapter(
NullLogger<GedcomImportAdapter>.Instance,
Options.Create(new GedcomImportOptions { MaxFileSizeBytes = 10_000_000 })
);
var result = adapter.Parse(stream);
Encoding Detection
GedcomEncodingDetector automatically selects the correct decoder:
Declared CHAR tag |
Encoding used |
|---|---|
UTF-8 |
UTF-8 |
UNICODE |
UTF-16 LE/BE (via BOM) |
ANSEL |
Custom ANSEL decoder |
ANSI |
Windows-1252 |
| (absent) | UTF-8 (default) |
BOM detection takes priority over the declared tag.
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
MaxFileSizeBytes |
long |
52428800 |
Maximum allowed GEDCOM file size (bytes) |
Project Structure
gedcom-vector/
├── src/
│ └── Gedcom.Vector/
│ ├── Parsing/ # Lexer, tree builder, ANSEL decoder
│ ├── GedcomImportAdapter.cs
│ ├── GedcomExportWriter.cs
│ ├── GedcomEncodingDetector.cs
│ └── ...
├── tests/
│ └── Gedcom.Vector.Tests/
│ ├── AnselDecoderTests.cs
│ ├── GedcomEncodingDetectorTests.cs
│ └── ...
├── .github/workflows/
│ ├── ci.yml
│ └── publish.yml
├── LICENSE
└── README.md
License
Free for non-commercial use under the PolyForm Noncommercial License 1.0.0.
This covers:
- Personal projects, hobby use, research, and education
- Non-profit and public-sector organizations
Commercial use requires a separate license. Please open an issue or contact the author to discuss commercial licensing terms.
Contributing
This library is extracted from the FAMTree project. Bug reports and suggestions are welcome via GitHub Issues.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.