simple-gedcom


Namesimple-gedcom JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/mcobtechnology/simple-gedcom
SummaryA Python module for parsing and analyzing GEDCOM files.
upload_time2025-07-14 23:37:41
maintainerNone
docs_urlNone
authormcobtechnology
requires_python>=3.6
licenseGPLv2
keywords python gedcom parser
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Simple GEDCOM Parser

A simplified Python library for extracting genealogy data from GEDCOM files, focused on two primary use cases:

1. **Extract basic person data** - Get a clean list of people with vital information and family relationships
2. **Extract person-source relationships** - Map people to their documentary sources

## Features

- Parse GEDCOM 5.5 files
- Extract person data: names, birth/death dates and places, parents
- Extract source citations linked to individuals
- Simple, clean API designed for data analysis
- Easy integration with pandas DataFrames


## Quick Start

```python
from gedcom import GedcomParser
import pandas as pd

# Parse GEDCOM file
parser = GedcomParser()
parser.parse_file('family_tree.ged')

# Get list of all people
people = parser.get_person_list()
people_df = pd.DataFrame(people)

# Get person-source relationships
person_sources = parser.get_person_sources()
sources_df = pd.DataFrame(person_sources)
```

## API Reference

### GedcomParser

#### `parse_file(file_path, strict=False)`
Parse a GEDCOM file.

**Parameters:**
- `file_path` (str): Path to the GEDCOM file
- `strict` (bool): If True, raise exceptions on parse errors

#### `get_person_list()`
Returns a list of dictionaries containing person data:

```python
[
    {
        'Person ID': '@I1@',
        'First Name': 'John',
        'Last Name': 'Doe',
        'Birth Date': '1990',
        'Birth Place': 'New York',
        'Death Date': '',
        'Death Place': '',
        'Father First Name': 'Robert',
        'Father Last Name': 'Doe',
        'Mother First Name': 'Jane',
        'Mother Last Name': 'Smith'
    },
    # ... more people
]
```

#### `get_person_sources()`
Returns a list of dictionaries with person-source relationships:

```python
[
    {
        'Person ID': '@I1@',
        'Source ID': '@S1@',
        'Source Title': 'Birth Certificate',
        'Source Author': '',
        'Source Publication': 'City Records',
        'Source Repository': 'City Hall'
    },
    # ... more person-source combinations
]
```

## Example Usage

### Basic Person Data

```python
from gedcom import GedcomParser

parser = GedcomParser()
parser.parse_file('my_family.ged')

# Get all people
people = parser.get_person_list()

# Print summary
print(f"Found {len(people)} people in the family tree")

# Look at first person
if people:
    person = people[0]
    print(f"Name: {person['First Name']} {person['Last Name']}")
    print(f"Born: {person['Birth Date']} in {person['Birth Place']}")
```

### With Pandas

```python
import pandas as pd
from gedcom import GedcomParser

parser = GedcomParser()
parser.parse_file('my_family.ged')

# Create DataFrames
people_df = pd.DataFrame(parser.get_person_list())
sources_df = pd.DataFrame(parser.get_person_sources())

# Analyze the data
print("Birth places:")
print(people_df['Birth Place'].value_counts())

print("\nSource types:")
print(sources_df['Source Title'].value_counts())
```

## Requirements

- Python 3.6+
- No external dependencies for core functionality
- pandas (optional, for DataFrame examples)

## License

This project is licensed under the GNU General Public License v2.0 - see the [LICENSE](LICENSE) file for details.

## Attribution

This project is derived from [python-gedcom](https://github.com/nickreynke/python-gedcom) by Nicklas Reincke and contributors. The original project provided the foundation for GEDCOM parsing, which has been simplified and focused for specific genealogy data extraction use cases.

Original Copyright (C) 2018-2019 Nicklas Reincke and contributors  
Simplified version Copyright (C) 2025 [mcobtechnology]

## Contributing

This is a simplified, focused library. If you need additional GEDCOM functionality, consider using the full-featured [python-gedcom](https://github.com/nickreynke/python-gedcom) library.

For bug fixes and improvements to the core functionality, feel free to open issues or submit pull requests.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mcobtechnology/simple-gedcom",
    "name": "simple-gedcom",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python gedcom parser",
    "author": "mcobtechnology",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b1/f8/a25fb100ae440cd348f58c61fe8ccae3f1e745c3064211d4bfb4dee7484e/simple-gedcom-1.0.0.tar.gz",
    "platform": null,
    "description": "# Simple GEDCOM Parser\n\nA simplified Python library for extracting genealogy data from GEDCOM files, focused on two primary use cases:\n\n1. **Extract basic person data** - Get a clean list of people with vital information and family relationships\n2. **Extract person-source relationships** - Map people to their documentary sources\n\n## Features\n\n- Parse GEDCOM 5.5 files\n- Extract person data: names, birth/death dates and places, parents\n- Extract source citations linked to individuals\n- Simple, clean API designed for data analysis\n- Easy integration with pandas DataFrames\n\n\n## Quick Start\n\n```python\nfrom gedcom import GedcomParser\nimport pandas as pd\n\n# Parse GEDCOM file\nparser = GedcomParser()\nparser.parse_file('family_tree.ged')\n\n# Get list of all people\npeople = parser.get_person_list()\npeople_df = pd.DataFrame(people)\n\n# Get person-source relationships\nperson_sources = parser.get_person_sources()\nsources_df = pd.DataFrame(person_sources)\n```\n\n## API Reference\n\n### GedcomParser\n\n#### `parse_file(file_path, strict=False)`\nParse a GEDCOM file.\n\n**Parameters:**\n- `file_path` (str): Path to the GEDCOM file\n- `strict` (bool): If True, raise exceptions on parse errors\n\n#### `get_person_list()`\nReturns a list of dictionaries containing person data:\n\n```python\n[\n    {\n        'Person ID': '@I1@',\n        'First Name': 'John',\n        'Last Name': 'Doe',\n        'Birth Date': '1990',\n        'Birth Place': 'New York',\n        'Death Date': '',\n        'Death Place': '',\n        'Father First Name': 'Robert',\n        'Father Last Name': 'Doe',\n        'Mother First Name': 'Jane',\n        'Mother Last Name': 'Smith'\n    },\n    # ... more people\n]\n```\n\n#### `get_person_sources()`\nReturns a list of dictionaries with person-source relationships:\n\n```python\n[\n    {\n        'Person ID': '@I1@',\n        'Source ID': '@S1@',\n        'Source Title': 'Birth Certificate',\n        'Source Author': '',\n        'Source Publication': 'City Records',\n        'Source Repository': 'City Hall'\n    },\n    # ... more person-source combinations\n]\n```\n\n## Example Usage\n\n### Basic Person Data\n\n```python\nfrom gedcom import GedcomParser\n\nparser = GedcomParser()\nparser.parse_file('my_family.ged')\n\n# Get all people\npeople = parser.get_person_list()\n\n# Print summary\nprint(f\"Found {len(people)} people in the family tree\")\n\n# Look at first person\nif people:\n    person = people[0]\n    print(f\"Name: {person['First Name']} {person['Last Name']}\")\n    print(f\"Born: {person['Birth Date']} in {person['Birth Place']}\")\n```\n\n### With Pandas\n\n```python\nimport pandas as pd\nfrom gedcom import GedcomParser\n\nparser = GedcomParser()\nparser.parse_file('my_family.ged')\n\n# Create DataFrames\npeople_df = pd.DataFrame(parser.get_person_list())\nsources_df = pd.DataFrame(parser.get_person_sources())\n\n# Analyze the data\nprint(\"Birth places:\")\nprint(people_df['Birth Place'].value_counts())\n\nprint(\"\\nSource types:\")\nprint(sources_df['Source Title'].value_counts())\n```\n\n## Requirements\n\n- Python 3.6+\n- No external dependencies for core functionality\n- pandas (optional, for DataFrame examples)\n\n## License\n\nThis project is licensed under the GNU General Public License v2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Attribution\n\nThis project is derived from [python-gedcom](https://github.com/nickreynke/python-gedcom) by Nicklas Reincke and contributors. The original project provided the foundation for GEDCOM parsing, which has been simplified and focused for specific genealogy data extraction use cases.\n\nOriginal Copyright (C) 2018-2019 Nicklas Reincke and contributors  \nSimplified version Copyright (C) 2025 [mcobtechnology]\n\n## Contributing\n\nThis is a simplified, focused library. If you need additional GEDCOM functionality, consider using the full-featured [python-gedcom](https://github.com/nickreynke/python-gedcom) library.\n\nFor bug fixes and improvements to the core functionality, feel free to open issues or submit pull requests.\n\n",
    "bugtrack_url": null,
    "license": "GPLv2",
    "summary": "A Python module for parsing and analyzing GEDCOM files.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/mcobtechnology/simple-gedcom"
    },
    "split_keywords": [
        "python",
        "gedcom",
        "parser"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d7c222564e74982d155f67379eccfb4e1c5b65475349f65fe8117c0cfbda774",
                "md5": "ca8f1224c1f0afbeb76f51f436b68241",
                "sha256": "3c78819c770fd28e9788054cad7caaa2663282195674aaf28265a0563ad446b3"
            },
            "downloads": -1,
            "filename": "simple_gedcom-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca8f1224c1f0afbeb76f51f436b68241",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13562,
            "upload_time": "2025-07-14T23:37:40",
            "upload_time_iso_8601": "2025-07-14T23:37:40.212012Z",
            "url": "https://files.pythonhosted.org/packages/8d/7c/222564e74982d155f67379eccfb4e1c5b65475349f65fe8117c0cfbda774/simple_gedcom-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1f8a25fb100ae440cd348f58c61fe8ccae3f1e745c3064211d4bfb4dee7484e",
                "md5": "4d7cde82445110396c3f30bfe056a547",
                "sha256": "b7dd3a0e2f6a6ee429d25093c94e9559fcf43efcb2e80ca8f743feda1121038d"
            },
            "downloads": -1,
            "filename": "simple-gedcom-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4d7cde82445110396c3f30bfe056a547",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 13898,
            "upload_time": "2025-07-14T23:37:41",
            "upload_time_iso_8601": "2025-07-14T23:37:41.618334Z",
            "url": "https://files.pythonhosted.org/packages/b1/f8/a25fb100ae440cd348f58c61fe8ccae3f1e745c3064211d4bfb4dee7484e/simple-gedcom-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 23:37:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mcobtechnology",
    "github_project": "simple-gedcom",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "simple-gedcom"
}
        
Elapsed time: 0.69355s