PHPackages                             necorupt/php-gedcom - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. necorupt/php-gedcom

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

necorupt/php-gedcom
===================

A GEDCOM file parser (read + write) for PHP 8.2+

v3.0.14(5mo ago)1921MITPHPPHP &gt;=8.2CI failing

Since Apr 1Pushed 5mo agoCompare

[ Source](https://github.com/JuliaPlatonkina/php-gedcom)[ Packagist](https://packagist.org/packages/necorupt/php-gedcom)[ Docs](http://github.com/familytree365/php-gedcom)[ GitHub Sponsors](https://github.com/liberu-genealogy)[ RSS](/packages/necorupt-php-gedcom/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (13)Used By (0)

php-gedcom
==========

[](#php-gedcom)

[![Latest Stable Version](https://camo.githubusercontent.com/f7dddaf69a33536dd222edb7c55078493d26d83e3a54dffbb7dc24720cda0823/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6c69626572752d67656e65616c6f67792f7068702d676564636f6d2e737667)](https://camo.githubusercontent.com/f7dddaf69a33536dd222edb7c55078493d26d83e3a54dffbb7dc24720cda0823/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6c69626572752d67656e65616c6f67792f7068702d676564636f6d2e737667)[![Tests](https://github.com/liberu-genealogy/php-gedcom/actions/workflows/run-tests.yml/badge.svg)](https://github.com/liberu-genealogy/php-gedcom/actions/workflows/run-tests.yml)

Requirements
------------

[](#requirements)

- requires PHP 8.2 (or later).

Installation
------------

[](#installation)

There are two ways of installing php-gedcom.

### Composer

[](#composer)

To install php-gedcom in your project using composer, simply add the following require line to your project's `composer.json` file:

```
{
    "require": {
        "necorupt/php-gedcom": "3.0.*"
    }
}

```

### Download and \_\_autoload

[](#download-and-__autoload)

If you are not using composer, you can download an archive of the source from GitHub and extract it into your project. You'll need to setup an autoloader for the files, unless you go through the painstaking process if requiring all the needed files one-by-one. Something like the following should suffice:

```
spl_autoload_register(function ($class) {
    $pathToGedcom = __DIR__ . '/library/'; // TODO FIXME

    if (!substr(ltrim($class, '\\'), 0, 7) == 'Gedcom\\') {
        return;
    }

    $class = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
    if (file_exists($pathToGedcom . $class)) {
        require_once($pathToGedcom . $class);
    }
});
```

### Usage

[](#usage)

To parse a GEDCOM file and load it into a collection of PHP Objects, simply instantiate a new Parser object and pass it the file name to parse. The resulting Gedcom object will contain all the information stored within the supplied GEDCOM file:

```
$parser = new \Gedcom\Parser();
$gedcom = $parser->parse('tmp.ged');

foreach ($gedcom->getIndi() as $individual) {
    $names = $individual->getName();
    if (!empty($names)) {
        $name = reset($names); // Get the first name object from the array
        echo $individual->getId() . ': ' . $name->getSurn() . ', ' . $name->getGivn() . PHP_EOL;
    }
}
```

Contributing
------------

[](#contributing)

Pull requests are welcome, as are issues.

License
-------

[](#license)

MIT License (see License.md). This means you must retain the copyright and permission notice is all copies, or substantial portions of this software.

Contributors
------------

[](#contributors)

[ ![](https://camo.githubusercontent.com/00af225e8d92783f8e0769fa27b0c24ed5a0eff95c1dc0c2e962056396a28c8e/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d6c69626572752d67656e65616c6f67792f7068702d676564636f6d)](https://github.com/liberu-genealogy/php-gedcom/graphs/contributors)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance70

Regular maintenance activity

Popularity13

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~42 days

Total

10

Last Release

173d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9fe2cfedbb1af8522e47aa5dcba6c14c704dc9b0d181ad0a657ddcca604f11b?d=identicon)[Necorupt](/maintainers/Necorupt)

---

Top Contributors

[![curtisdelicata](https://avatars.githubusercontent.com/u/179251?v=4)](https://github.com/curtisdelicata "curtisdelicata (139 commits)")[![sweep-ai-deprecated[bot]](https://avatars.githubusercontent.com/in/307814?v=4)](https://github.com/sweep-ai-deprecated[bot] "sweep-ai-deprecated[bot] (86 commits)")[![mrkrstphr](https://avatars.githubusercontent.com/u/164472?v=4)](https://github.com/mrkrstphr "mrkrstphr (33 commits)")[![jyyblue](https://avatars.githubusercontent.com/u/36446990?v=4)](https://github.com/jyyblue "jyyblue (23 commits)")[![albarin](https://avatars.githubusercontent.com/u/186112?v=4)](https://github.com/albarin "albarin (15 commits)")[![Necorupt](https://avatars.githubusercontent.com/u/132255937?v=4)](https://github.com/Necorupt "Necorupt (14 commits)")[![JoshKisb](https://avatars.githubusercontent.com/u/7253780?v=4)](https://github.com/JoshKisb "JoshKisb (9 commits)")[![heru0502](https://avatars.githubusercontent.com/u/32084622?v=4)](https://github.com/heru0502 "heru0502 (8 commits)")[![juliolopez78](https://avatars.githubusercontent.com/u/5769504?v=4)](https://github.com/juliolopez78 "juliolopez78 (6 commits)")[![juliengeneanet](https://avatars.githubusercontent.com/u/20107278?v=4)](https://github.com/juliengeneanet "juliengeneanet (5 commits)")[![skypal](https://avatars.githubusercontent.com/u/27696696?v=4)](https://github.com/skypal "skypal (4 commits)")[![daymanForse](https://avatars.githubusercontent.com/u/199590308?v=4)](https://github.com/daymanForse "daymanForse (4 commits)")[![stuporglue](https://avatars.githubusercontent.com/u/16576?v=4)](https://github.com/stuporglue "stuporglue (2 commits)")[![tlesseli](https://avatars.githubusercontent.com/u/2758167?v=4)](https://github.com/tlesseli "tlesseli (2 commits)")[![webstar1027](https://avatars.githubusercontent.com/u/32419290?v=4)](https://github.com/webstar1027 "webstar1027 (2 commits)")[![xeanu](https://avatars.githubusercontent.com/u/82022184?v=4)](https://github.com/xeanu "xeanu (2 commits)")[![WorkingDevel](https://avatars.githubusercontent.com/u/774381?v=4)](https://github.com/WorkingDevel "WorkingDevel (1 commits)")[![vfftech](https://avatars.githubusercontent.com/u/67114434?v=4)](https://github.com/vfftech "vfftech (1 commits)")[![ZaxxorBunnyNya](https://avatars.githubusercontent.com/u/219500039?v=4)](https://github.com/ZaxxorBunnyNya "ZaxxorBunnyNya (1 commits)")[![oguz463](https://avatars.githubusercontent.com/u/22803432?v=4)](https://github.com/oguz463 "oguz463 (1 commits)")

---

Tags

parsergedcomgenealogy

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/necorupt-php-gedcom/health.svg)

```
[![Health](https://phpackages.com/badges/necorupt-php-gedcom/health.svg)](https://phpackages.com/packages/necorupt-php-gedcom)
```

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

3.0k404.0M702](/packages/league-commonmark)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
