gedcom-x 0.5.7__py3-none-any.whl → 0.5.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gedcom_x-0.5.7.dist-info → gedcom_x-0.5.8.dist-info}/METADATA +1 -1
- gedcom_x-0.5.8.dist-info/RECORD +56 -0
- gedcomx/Extensions/rs10/rsLink.py +3 -3
- gedcomx/TopLevelTypeCollection.py +1 -1
- gedcomx/__init__.py +43 -42
- gedcomx/{Address.py → address.py} +1 -1
- gedcomx/{Agent.py → agent.py} +32 -16
- gedcomx/{Attribution.py → attribution.py} +3 -3
- gedcomx/{Conclusion.py → conclusion.py} +26 -9
- gedcomx/{Converter.py → converter.py} +54 -39
- gedcomx/{Coverage.py → coverage.py} +23 -5
- gedcomx/{Date.py → date.py} +1 -1
- gedcomx/{Document.py → document.py} +26 -8
- gedcomx/{Event.py → event.py} +13 -13
- gedcomx/{EvidenceReference.py → evidence_reference.py} +2 -2
- gedcomx/{Fact.py → fact.py} +31 -23
- gedcomx/{Gedcom5x.py → gedcom5x.py} +1 -1
- gedcomx/gedcom7/Exceptions.py +9 -0
- gedcomx/gedcom7/Gedcom7.py +160 -0
- gedcomx/gedcom7/GedcomStructure.py +94 -0
- gedcomx/gedcom7/Specification.py +347 -0
- gedcomx/gedcom7/__init__.py +26 -0
- gedcomx/gedcom7/g7interop.py +205 -0
- gedcomx/gedcom7/logger.py +19 -0
- gedcomx/{GedcomX.py → gedcomx.py} +14 -13
- gedcomx/{Gender.py → gender.py} +25 -11
- gedcomx/group.py +63 -0
- gedcomx/{Identifier.py → identifier.py} +4 -4
- gedcomx/{Mutations.py → mutations.py} +49 -25
- gedcomx/{Name.py → name.py} +15 -15
- gedcomx/{Note.py → note.py} +2 -2
- gedcomx/{OnlineAccount.py → online_account.py} +1 -1
- gedcomx/{Person.py → person.py} +18 -16
- gedcomx/{PlaceDescription.py → place_description.py} +18 -16
- gedcomx/{PlaceReference.py → place_reference.py} +4 -4
- gedcomx/{Qualifier.py → qualifier.py} +1 -1
- gedcomx/{Relationship.py → relationship.py} +30 -12
- gedcomx/{Resource.py → resource.py} +2 -2
- gedcomx/{Serialization.py → serialization.py} +31 -32
- gedcomx/{SourceDescription.py → source_description.py} +16 -16
- gedcomx/{SourceReference.py → source_reference.py} +7 -7
- gedcomx/{Subject.py → subject.py} +26 -8
- gedcomx/{Translation.py → translation.py} +1 -1
- gedcomx/{URI.py → uri.py} +42 -26
- gedcom_x-0.5.7.dist-info/RECORD +0 -49
- gedcomx/Group.py +0 -37
- {gedcom_x-0.5.7.dist-info → gedcom_x-0.5.8.dist-info}/WHEEL +0 -0
- {gedcom_x-0.5.7.dist-info → gedcom_x-0.5.8.dist-info}/top_level.txt +0 -0
- /gedcomx/{Exceptions.py → exceptions.py} +0 -0
- /gedcomx/{ExtensibleEnum.py → extensible_enum.py} +0 -0
- /gedcomx/{Gedcom.py → gedcom.py} +0 -0
- /gedcomx/{LoggingHub.py → logging_hub.py} +0 -0
- /gedcomx/{SourceCitation.py → source_citation.py} +0 -0
- /gedcomx/{TextValue.py → textvalue.py} +0 -0
gedcomx/{Gender.py → gender.py}
RENAMED
@@ -1,18 +1,32 @@
|
|
1
1
|
from enum import Enum
|
2
2
|
from typing import List, Optional
|
3
|
+
"""
|
4
|
+
======================================================================
|
5
|
+
Project: Gedcom-X
|
6
|
+
File: gender.py
|
7
|
+
Author: David J. Cartwright
|
8
|
+
Purpose:
|
3
9
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
10
|
+
Created: 2025-08-25
|
11
|
+
Updated:
|
12
|
+
- 2025-08-31:
|
13
|
+
|
14
|
+
======================================================================
|
15
|
+
"""
|
9
16
|
|
10
|
-
|
11
|
-
|
17
|
+
"""
|
18
|
+
======================================================================
|
19
|
+
GEDCOM Module Types
|
20
|
+
======================================================================
|
21
|
+
"""
|
22
|
+
from .attribution import Attribution
|
23
|
+
from .conclusion import ConfidenceLevel, Conclusion
|
24
|
+
from .note import Note
|
25
|
+
from .resource import Resource
|
26
|
+
from .source_reference import SourceReference
|
27
|
+
#=====================================================================
|
12
28
|
|
13
29
|
|
14
|
-
from collections.abc import Sized
|
15
|
-
|
16
30
|
class GenderType(Enum):
|
17
31
|
Male = "http://gedcomx.org/Male"
|
18
32
|
Female = "http://gedcomx.org/Female"
|
@@ -48,7 +62,7 @@ class Gender(Conclusion):
|
|
48
62
|
|
49
63
|
@property
|
50
64
|
def _as_dict_(self):
|
51
|
-
from .
|
65
|
+
from .serialization import Serialization
|
52
66
|
type_as_dict = super()._as_dict_
|
53
67
|
if self.type:
|
54
68
|
type_as_dict['type'] = self.type.value if self.type else None
|
@@ -58,7 +72,7 @@ class Gender(Conclusion):
|
|
58
72
|
|
59
73
|
@classmethod
|
60
74
|
def _from_json_(cls,data):
|
61
|
-
from .
|
75
|
+
from .serialization import Serialization
|
62
76
|
|
63
77
|
return Serialization.deserialize(data, Gender)
|
64
78
|
|
gedcomx/group.py
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
from enum import Enum
|
2
|
+
from typing import List, Optional
|
3
|
+
"""
|
4
|
+
======================================================================
|
5
|
+
Project: Gedcom-X
|
6
|
+
File: group.py
|
7
|
+
Author: David J. Cartwright
|
8
|
+
Purpose:
|
9
|
+
|
10
|
+
Created: 2025-08-25
|
11
|
+
Updated:
|
12
|
+
- 2025-09-01: Updating basic structure, identify TODO s
|
13
|
+
|
14
|
+
======================================================================
|
15
|
+
"""
|
16
|
+
|
17
|
+
"""
|
18
|
+
======================================================================
|
19
|
+
GEDCOM Module Types
|
20
|
+
======================================================================
|
21
|
+
"""
|
22
|
+
from .attribution import Attribution
|
23
|
+
from .conclusion import ConfidenceLevel
|
24
|
+
from .document import Document
|
25
|
+
from .date import Date
|
26
|
+
from .evidence_reference import EvidenceReference
|
27
|
+
from .identifier import Identifier
|
28
|
+
from .note import Note
|
29
|
+
from .place_reference import PlaceReference
|
30
|
+
from .source_reference import SourceReference
|
31
|
+
from .resource import Resource
|
32
|
+
|
33
|
+
from .textvalue import TextValue
|
34
|
+
from .subject import Subject
|
35
|
+
|
36
|
+
class GroupRoleType(Enum): #TODO Impliment
|
37
|
+
def __init__(self) -> None:
|
38
|
+
super().__init__()
|
39
|
+
|
40
|
+
class GroupRole: #TODO Impliment
|
41
|
+
identifier = 'http://gedcomx.org/v1/GroupRole'
|
42
|
+
version = 'http://gedcomx.org/conceptual-model/v1'
|
43
|
+
|
44
|
+
def __init__(self, person: Resource,type: Optional[Enum], date: Optional[Date],details: Optional[str]) -> None:
|
45
|
+
pass
|
46
|
+
|
47
|
+
class Group(Subject): #TODO Impliment
|
48
|
+
identifier = 'http://gedcomx.org/v1/Group'
|
49
|
+
version = 'http://gedcomx.org/conceptual-model/v1'
|
50
|
+
|
51
|
+
def __init__(self,
|
52
|
+
id: str | None, lang: str | None,
|
53
|
+
sources: List[SourceReference] | None,
|
54
|
+
analysis: Document | Resource | None, notes: List[Note] | None, confidence: ConfidenceLevel | None, attribution: Attribution | None, extracted: bool | None, evidence: List[EvidenceReference] | None, media: List[SourceReference] | None, identifiers: List[Identifier] | None,
|
55
|
+
names: List[TextValue],
|
56
|
+
date: Optional[Date],
|
57
|
+
place: Optional[PlaceReference],
|
58
|
+
roles: Optional[List[GroupRole]]) -> None:
|
59
|
+
super().__init__(id, lang, sources, analysis, notes, confidence, attribution, extracted, evidence, media, identifiers)
|
60
|
+
self.names = names if names else []
|
61
|
+
self.date = date
|
62
|
+
self.place = place
|
63
|
+
self.roles = roles if roles else []
|
@@ -5,9 +5,9 @@ from typing import List, Optional, Dict, Any
|
|
5
5
|
|
6
6
|
from collections.abc import Iterator
|
7
7
|
import json
|
8
|
-
from .
|
9
|
-
from .
|
10
|
-
from .
|
8
|
+
from .resource import Resource
|
9
|
+
from .uri import URI
|
10
|
+
from .extensible_enum import ExtensibleEnum
|
11
11
|
|
12
12
|
import secrets
|
13
13
|
import string
|
@@ -51,7 +51,7 @@ class Identifier:
|
|
51
51
|
|
52
52
|
@property
|
53
53
|
def _as_dict_(self):
|
54
|
-
from .
|
54
|
+
from .serialization import Serialization
|
55
55
|
type_as_dict = {}
|
56
56
|
if self.values:
|
57
57
|
type_as_dict["value"] = list(self.values) # or [v for v in self.values]
|
@@ -1,6 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
|
2
|
+
"""
|
3
|
+
======================================================================
|
4
|
+
Project: Gedcom-X
|
5
|
+
File: mutations.py
|
6
|
+
Author: David J. Cartwright
|
7
|
+
Purpose: Objects used to convert TAGs/Structues/Types from GEDCOM Versions
|
8
|
+
when simple parsing will not work. (complex or ambiguous structures)
|
9
|
+
|
10
|
+
Created: 2025-08-25
|
11
|
+
Updated:
|
12
|
+
- 2025-08-31: cleaned up imports and documentation
|
13
|
+
- 2025-09-01: filename PEP8 standard, imports changed accordingly
|
14
|
+
|
15
|
+
======================================================================
|
16
|
+
"""
|
17
|
+
|
18
|
+
"""
|
19
|
+
======================================================================
|
20
|
+
GEDCOM Module Types
|
21
|
+
======================================================================
|
22
|
+
"""
|
23
|
+
from .gedcom5x import Gedcom5xRecord
|
24
|
+
from .fact import Fact, FactType
|
25
|
+
from .event import Event, EventType
|
26
|
+
#=====================================================================
|
4
27
|
|
5
28
|
fact_event_table = {
|
6
29
|
# Person Fact / Event Types
|
@@ -178,33 +201,34 @@ fact_event_table = {
|
|
178
201
|
}
|
179
202
|
|
180
203
|
class GedcomXObject:
|
181
|
-
def __init__(self,record: Gedcom5xRecord
|
182
|
-
self.
|
183
|
-
self.
|
184
|
-
self.
|
204
|
+
def __init__(self,record: Gedcom5xRecord) -> None:
|
205
|
+
self.record = record
|
206
|
+
self.created_with_tag: str | None = record.tag if record and isinstance(record, Gedcom5xRecord) else None
|
207
|
+
self.created_at_level: int | None = record.level if record and isinstance(record, Gedcom5xRecord) else None
|
208
|
+
self.created_at_line_number: int | None = record.line if record and isinstance(record, Gedcom5xRecord) else None
|
185
209
|
|
186
210
|
class GedcomXSourceOrDocument(GedcomXObject):
|
187
|
-
def __init__(self,record: Gedcom5xRecord
|
211
|
+
def __init__(self,record: Gedcom5xRecord) -> None:
|
188
212
|
super().__init__(record)
|
189
|
-
self.title: str = None
|
190
|
-
self.citation: str = None
|
191
|
-
self.page: str = None
|
192
|
-
self.contributor: str = None
|
193
|
-
self.publisher: str = None
|
194
|
-
self.rights: str = None
|
195
|
-
self.url: str = None
|
196
|
-
self.medium: str = None
|
197
|
-
self.type: str = None
|
198
|
-
self.format: str = None
|
199
|
-
self.created: str = None
|
200
|
-
self.modified: str = None
|
201
|
-
self.language: str = None
|
202
|
-
self.relation: str = None
|
203
|
-
self.identifier: str = None
|
204
|
-
self.description: str = None
|
213
|
+
self.title: str | None = None
|
214
|
+
self.citation: str | None = None
|
215
|
+
self.page: str | None = None
|
216
|
+
self.contributor: str | None = None
|
217
|
+
self.publisher: str | None = None
|
218
|
+
self.rights: str | None = None
|
219
|
+
self.url: str | None = None
|
220
|
+
self.medium: str | None = None
|
221
|
+
self.type: str | None = None
|
222
|
+
self.format: str | None = None
|
223
|
+
self.created: str | None = None
|
224
|
+
self.modified: str | None = None
|
225
|
+
self.language: str | None = None
|
226
|
+
self.relation: str | None = None
|
227
|
+
self.identifier: str | None = None
|
228
|
+
self.description: str | None = None
|
205
229
|
|
206
230
|
class GedcomXEventOrFact(GedcomXObject):
|
207
|
-
def __new__(cls,record: Gedcom5xRecord
|
231
|
+
def __new__(cls,record: Gedcom5xRecord, object_stack: dict | None = None) -> object:
|
208
232
|
super().__init__(record)
|
209
233
|
if record.tag in fact_event_table.keys():
|
210
234
|
|
gedcomx/{Name.py → name.py}
RENAMED
@@ -1,6 +1,5 @@
|
|
1
1
|
from enum import Enum
|
2
2
|
from typing import List,Optional
|
3
|
-
from typing_extensions import Self
|
4
3
|
|
5
4
|
"""
|
6
5
|
======================================================================
|
@@ -22,12 +21,13 @@ GEDCOM Module Types
|
|
22
21
|
======================================================================
|
23
22
|
"""
|
24
23
|
#======================================================================
|
25
|
-
from .
|
26
|
-
from .
|
27
|
-
from .
|
28
|
-
from .
|
29
|
-
from .
|
30
|
-
from .
|
24
|
+
from .attribution import Attribution
|
25
|
+
from .conclusion import Conclusion, ConfidenceLevel
|
26
|
+
from .date import Date
|
27
|
+
from .document import Document
|
28
|
+
from .note import Note
|
29
|
+
from .resource import Resource
|
30
|
+
from .source_reference import SourceReference
|
31
31
|
#======================================================================
|
32
32
|
|
33
33
|
|
@@ -145,7 +145,7 @@ class NamePart:
|
|
145
145
|
|
146
146
|
@property
|
147
147
|
def _as_dict_(self):
|
148
|
-
from .
|
148
|
+
from .serialization import Serialization
|
149
149
|
type_as_dict = {}
|
150
150
|
if self.type:
|
151
151
|
type_as_dict['type'] = self.type.value
|
@@ -226,7 +226,7 @@ class NameForm:
|
|
226
226
|
|
227
227
|
@property
|
228
228
|
def _as_dict_(self):
|
229
|
-
from .
|
229
|
+
from .serialization import Serialization
|
230
230
|
type_as_dict = {}
|
231
231
|
if self.lang:
|
232
232
|
type_as_dict['lang'] = self.lang
|
@@ -309,7 +309,7 @@ class Name(Conclusion):
|
|
309
309
|
def __init__(self, id: Optional[str] = None,
|
310
310
|
lang: Optional[str] = None,
|
311
311
|
sources: Optional[List[SourceReference]] = None,
|
312
|
-
analysis: Resource = None,
|
312
|
+
analysis: Optional[Document |Resource] = None,
|
313
313
|
notes: Optional[List[Note]] = None,
|
314
314
|
confidence: Optional[ConfidenceLevel] = None,
|
315
315
|
attribution: Optional[Attribution] = None,
|
@@ -321,16 +321,16 @@ class Name(Conclusion):
|
|
321
321
|
self.nameForms = nameForms if nameForms else []
|
322
322
|
self.date = date
|
323
323
|
|
324
|
-
def _add_name_part(self,
|
325
|
-
if
|
324
|
+
def _add_name_part(self, namepart: NamePart):
|
325
|
+
if namepart and isinstance(namepart, NamePart):
|
326
326
|
for current_namepart in self.nameForms[0].parts:
|
327
|
-
if
|
327
|
+
if namepart == current_namepart:
|
328
328
|
return False
|
329
|
-
self.nameForms[0].parts.append(
|
329
|
+
self.nameForms[0].parts.append(namepart)
|
330
330
|
|
331
331
|
@property
|
332
332
|
def _as_dict_(self):
|
333
|
-
from .
|
333
|
+
from .serialization import Serialization
|
334
334
|
type_as_dict = super()._as_dict_
|
335
335
|
if self.type:
|
336
336
|
type_as_dict['type'] = getattr(self.type, 'value', self.type)
|
gedcomx/{Note.py → note.py}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
from typing import Optional
|
2
2
|
|
3
|
-
from .
|
3
|
+
from .attribution import Attribution
|
4
4
|
|
5
5
|
class Note:
|
6
6
|
identifier = 'http://gedcomx.org/v1/Note'
|
@@ -24,7 +24,7 @@ class Note:
|
|
24
24
|
|
25
25
|
@property
|
26
26
|
def _as_dict_(self):
|
27
|
-
from .
|
27
|
+
from .serialization import Serialization
|
28
28
|
type_as_dict = {}
|
29
29
|
if self.lang:
|
30
30
|
type_as_dict["lang"] = self.lang
|
gedcomx/{Person.py → person.py}
RENAMED
@@ -20,19 +20,19 @@ from urllib.parse import urljoin
|
|
20
20
|
GEDCOM Module Types
|
21
21
|
======================================================================
|
22
22
|
"""
|
23
|
-
from .
|
24
|
-
from .
|
25
|
-
from .
|
26
|
-
from .
|
23
|
+
from .attribution import Attribution
|
24
|
+
from .conclusion import ConfidenceLevel
|
25
|
+
from .date import Date
|
26
|
+
from .evidence_reference import EvidenceReference
|
27
27
|
from .Extensions.rs10.rsLink import _rsLinkList
|
28
|
-
from .
|
29
|
-
from .
|
30
|
-
from .
|
31
|
-
from .
|
32
|
-
from .
|
33
|
-
from .
|
34
|
-
from .
|
35
|
-
from .
|
28
|
+
from .fact import Fact, FactType
|
29
|
+
from .gender import Gender, GenderType
|
30
|
+
from .identifier import IdentifierList
|
31
|
+
from .name import Name, QuickName
|
32
|
+
from .note import Note
|
33
|
+
from .resource import Resource
|
34
|
+
from .source_reference import SourceReference
|
35
|
+
from .subject import Subject
|
36
36
|
|
37
37
|
class Person(Subject):
|
38
38
|
"""A person in the system.
|
@@ -93,6 +93,7 @@ class Person(Subject):
|
|
93
93
|
return False
|
94
94
|
self.facts.append(fact_to_add)
|
95
95
|
return True
|
96
|
+
return False
|
96
97
|
|
97
98
|
def add_name(self, name_to_add: Name) -> bool:
|
98
99
|
if len(self.names) > 5:
|
@@ -105,9 +106,10 @@ class Person(Subject):
|
|
105
106
|
return False
|
106
107
|
self.names.append(name_to_add)
|
107
108
|
return True
|
109
|
+
return False
|
108
110
|
|
109
111
|
def _add_relationship(self, relationship_to_add: object):
|
110
|
-
from .
|
112
|
+
from .relationship import Relationship
|
111
113
|
if isinstance(relationship_to_add,Relationship):
|
112
114
|
self._relationships.append(relationship_to_add)
|
113
115
|
else:
|
@@ -127,7 +129,7 @@ class Person(Subject):
|
|
127
129
|
|
128
130
|
@property
|
129
131
|
def _as_dict_(self):
|
130
|
-
from .
|
132
|
+
from .serialization import Serialization
|
131
133
|
type_as_dict = super()._as_dict_
|
132
134
|
if self.private is not None:
|
133
135
|
type_as_dict['private'] = self.private
|
@@ -149,12 +151,12 @@ class Person(Subject):
|
|
149
151
|
"""
|
150
152
|
Create a Person instance from a JSON-dict (already parsed).
|
151
153
|
"""
|
152
|
-
from .
|
154
|
+
from .serialization import Serialization
|
153
155
|
return Serialization.deserialize(data, Person)
|
154
156
|
|
155
157
|
@classmethod
|
156
158
|
def from_familysearch(cls, pid: str, token: str, *, base_url: Optional[str] = None):
|
157
|
-
from .
|
159
|
+
from .serialization import Serialization
|
158
160
|
"""
|
159
161
|
Fetch a single person by PID from FamilySearch and return a Person.
|
160
162
|
- pid: e.g. "KPHP-4B4"
|
@@ -3,13 +3,13 @@ from typing import List, Optional
|
|
3
3
|
"""
|
4
4
|
======================================================================
|
5
5
|
Project: Gedcom-X
|
6
|
-
File:
|
6
|
+
File: place_description.py
|
7
7
|
Author: David J. Cartwright
|
8
|
-
Purpose:
|
8
|
+
Purpose:
|
9
9
|
|
10
10
|
Created: 2025-08-25
|
11
11
|
Updated:
|
12
|
-
- 2025-
|
12
|
+
- 2025-09-01: filename PEP8 standard
|
13
13
|
|
14
14
|
======================================================================
|
15
15
|
"""
|
@@ -19,17 +19,19 @@ from typing import List, Optional
|
|
19
19
|
GEDCOM Module Types
|
20
20
|
======================================================================
|
21
21
|
"""
|
22
|
-
from .
|
23
|
-
from .
|
24
|
-
from .
|
25
|
-
from .
|
26
|
-
from .
|
27
|
-
from .
|
28
|
-
from .
|
29
|
-
from .
|
30
|
-
from .
|
31
|
-
from .
|
32
|
-
from .
|
22
|
+
from .attribution import Attribution
|
23
|
+
from .conclusion import ConfidenceLevel
|
24
|
+
from .date import Date
|
25
|
+
from .evidence_reference import EvidenceReference
|
26
|
+
from .identifier import IdentifierList
|
27
|
+
from .note import Note
|
28
|
+
from .resource import Resource
|
29
|
+
from .source_reference import SourceReference
|
30
|
+
from .subject import Subject
|
31
|
+
from .textvalue import TextValue
|
32
|
+
from .uri import URI
|
33
|
+
#=====================================================================
|
34
|
+
|
33
35
|
|
34
36
|
class PlaceDescription(Subject):
|
35
37
|
"""PlaceDescription describes the details of a place in terms of
|
@@ -90,7 +92,7 @@ class PlaceDescription(Subject):
|
|
90
92
|
|
91
93
|
@property
|
92
94
|
def _as_dict_(self):
|
93
|
-
from .
|
95
|
+
from .serialization import Serialization
|
94
96
|
type_as_dict = super()._as_dict_
|
95
97
|
|
96
98
|
if self.names:
|
@@ -117,5 +119,5 @@ class PlaceDescription(Subject):
|
|
117
119
|
"""
|
118
120
|
Create a PlaceDescription instance from a JSON-dict (already parsed).
|
119
121
|
"""
|
120
|
-
from .
|
122
|
+
from .serialization import Serialization
|
121
123
|
return Serialization.deserialize(data, PlaceDescription)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from typing import Optional, TYPE_CHECKING
|
3
3
|
if TYPE_CHECKING:
|
4
|
-
from .
|
4
|
+
from .place_description import PlaceDescription
|
5
5
|
|
6
6
|
"""
|
7
7
|
======================================================================
|
@@ -22,7 +22,7 @@ if TYPE_CHECKING:
|
|
22
22
|
GEDCOM Module Types
|
23
23
|
======================================================================
|
24
24
|
"""
|
25
|
-
from .
|
25
|
+
from .resource import Resource
|
26
26
|
|
27
27
|
class PlaceReference:
|
28
28
|
"""defines a reference to a PlaceDescription.
|
@@ -45,7 +45,7 @@ class PlaceReference:
|
|
45
45
|
|
46
46
|
@property
|
47
47
|
def _as_dict_(self):
|
48
|
-
from .
|
48
|
+
from .serialization import Serialization
|
49
49
|
type_as_dict = {}
|
50
50
|
if self.original:
|
51
51
|
type_as_dict['original'] = self.original
|
@@ -55,7 +55,7 @@ class PlaceReference:
|
|
55
55
|
|
56
56
|
@classmethod
|
57
57
|
def _from_json_(cls, data):
|
58
|
-
from .
|
58
|
+
from .serialization import Serialization
|
59
59
|
return Serialization.deserialize(data, PlaceReference)
|
60
60
|
|
61
61
|
|
@@ -1,18 +1,36 @@
|
|
1
1
|
from enum import Enum
|
2
2
|
from typing import List, Optional
|
3
|
+
"""
|
4
|
+
======================================================================
|
5
|
+
Project: Gedcom-X
|
6
|
+
File: relationship.py
|
7
|
+
Author: David J. Cartwright
|
8
|
+
Purpose:
|
3
9
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
from .Person import Person
|
10
|
+
Created: 2025-08-25
|
11
|
+
Updated:
|
12
|
+
- 2025-09-31: filename PEP8 standard
|
13
|
+
|
14
|
+
======================================================================
|
15
|
+
"""
|
11
16
|
|
12
|
-
|
13
|
-
|
17
|
+
"""
|
18
|
+
======================================================================
|
19
|
+
GEDCOM Module Types
|
20
|
+
======================================================================
|
21
|
+
"""
|
22
|
+
from .attribution import Attribution
|
23
|
+
from .conclusion import ConfidenceLevel
|
24
|
+
from .evidence_reference import EvidenceReference
|
25
|
+
from .fact import Fact
|
26
|
+
from .identifier import Identifier
|
27
|
+
from .note import Note
|
28
|
+
from .person import Person
|
29
|
+
from .resource import Resource
|
30
|
+
from .source_reference import SourceReference
|
31
|
+
from .subject import Subject
|
32
|
+
#=====================================================================
|
14
33
|
|
15
|
-
from .Subject import Subject
|
16
34
|
|
17
35
|
class RelationshipType(Enum):
|
18
36
|
Couple = "http://gedcomx.org/Couple"
|
@@ -77,7 +95,7 @@ class Relationship(Subject):
|
|
77
95
|
|
78
96
|
@property
|
79
97
|
def _as_dict_(self):
|
80
|
-
from .
|
98
|
+
from .serialization import Serialization
|
81
99
|
type_as_dict = super()._as_dict_
|
82
100
|
type_as_dict.update({
|
83
101
|
"type": self.type.value if isinstance(self.type, RelationshipType) else self.type,
|
@@ -92,6 +110,6 @@ class Relationship(Subject):
|
|
92
110
|
"""
|
93
111
|
Create a Person instance from a JSON-dict (already parsed).
|
94
112
|
"""
|
95
|
-
from .
|
113
|
+
from .serialization import Serialization
|
96
114
|
return Serialization.deserialize(data, Relationship)
|
97
115
|
|
@@ -20,7 +20,7 @@ GEDCOM Module Types
|
|
20
20
|
======================================================================
|
21
21
|
"""
|
22
22
|
|
23
|
-
from .
|
23
|
+
from .uri import URI
|
24
24
|
|
25
25
|
class Resource:
|
26
26
|
"""
|
@@ -61,7 +61,7 @@ class Resource:
|
|
61
61
|
|
62
62
|
@property
|
63
63
|
def _as_dict_(self):
|
64
|
-
from .
|
64
|
+
from .serialization import Serialization
|
65
65
|
typ_as_dict = {}
|
66
66
|
if self.resource:
|
67
67
|
typ_as_dict['resource'] = self.resource.value if self.resource else None
|