feat: add source parsing and linking #8

Open
jaredhowland wants to merge 9 commits from jaredhowland/add-source-parsing into main
pull from: jaredhowland/add-source-parsing
2 changed files with 2 additions and 27 deletions
Showing only changes of commit 747175fcef - Show all commits

No files matched your search

+2 -1
View File
@@ -211,9 +211,10 @@ class Individual:
- children: List of Individual objects - children: List of Individual objects
""" """
families = [] families = []
# Cache the subject pointer once; it doesn't change across families.
self_pointer = self.element.get_pointer()
for family in self.gedcom.get_families(self.element): for family in self.gedcom.get_families(self.element):
# Get partner # Get partner
self_pointer = self.element.get_pointer()
partners = [ partners = [
Individual(parent, self.gedcom) Individual(parent, self.gedcom)
for parent in self.gedcom.get_family_members(family, "PARENTS") for parent in self.gedcom.get_family_members(family, "PARENTS")
1
-26
View File
@@ -17,26 +17,6 @@ from gedcom_parser import GedcomParser
from individual import Individual from individual import Individual
class TestIndividualBasicInfo:
"""Tests for basic individual information extraction."""
@pytest.fixture
def john_doe(self, sample_gedcom_file):
"""Get the John Doe individual from sample GEDCOM."""
parser = GedcomParser(sample_gedcom_file)
individuals = parser.get_individuals()
"""
Tests for the Individual data model.
This module tests individual person data extraction including:
- Names and IDs
- Birth and death information
- Events and attributes
- Family relationships
- Images and notes
- Custom story tags
"""
class TestIndividualBasicInfo: class TestIndividualBasicInfo:
"""Tests for basic individual information extraction.""" """Tests for basic individual information extraction."""
@@ -350,10 +330,6 @@ class TestEvents:
events = person.get_events() events = person.get_events()
event_types = [e['type'] for e in events] event_types = [e['type'] for e in events]
assert resi['place'] == 'Deepplace'
assert resi['lat'] == '48.8566'
assert resi['long'] == '2.3522'
class TestFamilyRelationships: class TestFamilyRelationships:
"""Tests for family relationship extraction.""" """Tests for family relationship extraction."""
@@ -601,8 +577,6 @@ class TestAttributes:
attrs = person.get_attributes() attrs = person.get_attributes()
assert len(attrs) == 0 assert len(attrs) == 0
return Individual(john[0], parser.parser)
def test_get_id(self, john_doe): def test_get_id(self, john_doe):
"""Test ID extraction without @ symbols.""" """Test ID extraction without @ symbols."""
id_value = john_doe.get_id() id_value = john_doe.get_id()