ged_io
A GEDCOM parser for Rust 🦀
About This Project
ged_io is a Rust crate for working with GEDCOM files, the standard format
for exchanging genealogical data. It currently focuses on parsing existing
GEDCOM files, with plans to add writing capabilities in the future.
Originally forked from
pirtleshell/rust-gedcom, this
project aims to:
- GEDCOM 5.5.1 Specification Support: Work towards accurate parsing of the GEDCOM 5.5.1 specification
- GEDCOM 7.0 Specification Support: Eventual support for the newer GEDCOM 7.0 specification
- Write-to-File Functionality: Future capability to write
GedcomDataobjects back to GEDCOM files - Practical Reliability: Handle real-world GEDCOM files with proper error handling
This crate is a work in progress. If you need a GEDCOM parser for Rust, it may be useful, but expect ongoing development and potential breaking changes.
Features
- ✅ GEDCOM Parsing - Read GEDCOM files into structured Rust data
- 🚧 GEDCOM 5.5.1 Support - Working towards full specification coverage
- 🚧 GEDCOM 7.0 Support - Planned for future versions
- 🚧 Write Capabilities - Planned ability to generate GEDCOM files
- ✅ JSON Integration - Optional
serdesupport for JSON conversion - ✅ Real-World Testing - Tested with various GEDCOM files including complex examples
Installation
Add this to your Cargo.toml:
[]
= "0.2.0"
For JSON serialization support, add this to your Cargo.toml:
[]
= { = "0.2.0", = ["json"] }
Quick Start
Basic Parsing
use Gedcom;
use fs;
use GedcomError;
With JSON Export
(Requires the json feature to be enabled in Cargo.toml)
use Gedcom;
use Error;
use fs;
Command Line Tool
The included ged_io binary provides a convenient way to test and analyze
GEDCOM files. It is primarily intended for development and testing purposes,
while the main product is the library crate itself.
# Install the CLI tool
# Parse and analyze a GEDCOM file
Example output:
----------------------
| Gedcom Data Stats: |
----------------------
submissions: 0
submitters: 1
individuals: 3
families: 2
repositories: 1
sources: 1
multimedia: 0
----------------------
Status
This is a work-in-progress project. Current capabilities include:
- ✅ Basic GEDCOM 5.5.1 parsing
- ✅ Structured data representation
- ✅ JSON serialization support
- ✅ Command-line utilities
- ✅ Error handling for common cases
Planned features:
- 🚧 Complete GEDCOM 5.5.1 Support - Full specification compliance
- 🚧 GEDCOM 7.0 Support - Modern specification compatibility
- 🚧 Write Functionality - Generate GEDCOM files from data structures
- 🚧 Enhanced Validation - Better error reporting and validation
🚧 Active Development
- Current Focus: Phase 2. Memory Optimization & Performance
- All Progress: View milestones →
Expect breaking changes as development continues.
Testing
The crate is tested against various GEDCOM files, including some complex examples like Heiner Eichmann's test suite. However, testing is ongoing and more comprehensive coverage is needed.
# Run the test suite
# Run with all features
# Linting
Contributing
This project is under active development. Contributions are welcome, but please keep in mind that the API may change as the project evolves. Areas where help would be appreciated:
- GEDCOM 7.0 specification implementation
- Write functionality development
- Test case contributions
- Documentation improvements
- Bug reports and feature requests
Please feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License.
Acknowledgments
Originally forked from pirtleshell/rust-gedcom. Thanks to the original contributors for laying the foundation for this project.