gedcom-x 0.5.7__tar.gz → 0.5.8__tar.gz
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 → gedcom_x-0.5.8}/PKG-INFO +1 -1
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcom_x.egg-info/PKG-INFO +1 -1
- gedcom_x-0.5.8/gedcom_x.egg-info/SOURCES.txt +88 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcomx/Extensions/rs10/rsLink.py +3 -3
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcomx/TopLevelTypeCollection.py +1 -1
- gedcom_x-0.5.8/gedcomx/__init__.py +50 -0
- gedcom_x-0.5.7/gedcomx/Address.py → gedcom_x-0.5.8/gedcomx/address.py +1 -1
- gedcom_x-0.5.7/gedcomx/Agent.py → gedcom_x-0.5.8/gedcomx/agent.py +32 -16
- gedcom_x-0.5.7/gedcomx/Attribution.py → gedcom_x-0.5.8/gedcomx/attribution.py +3 -3
- gedcom_x-0.5.7/gedcomx/Conclusion.py → gedcom_x-0.5.8/gedcomx/conclusion.py +26 -9
- gedcom_x-0.5.7/gedcomx/Converter.py → gedcom_x-0.5.8/gedcomx/converter.py +54 -39
- gedcom_x-0.5.7/gedcomx/Coverage.py → gedcom_x-0.5.8/gedcomx/coverage.py +23 -5
- gedcom_x-0.5.7/gedcomx/Date.py → gedcom_x-0.5.8/gedcomx/date.py +1 -1
- gedcom_x-0.5.7/gedcomx/Document.py → gedcom_x-0.5.8/gedcomx/document.py +26 -8
- gedcom_x-0.5.7/gedcomx/Event.py → gedcom_x-0.5.8/gedcomx/event.py +13 -13
- gedcom_x-0.5.7/gedcomx/EvidenceReference.py → gedcom_x-0.5.8/gedcomx/evidence_reference.py +2 -2
- gedcom_x-0.5.7/gedcomx/Fact.py → gedcom_x-0.5.8/gedcomx/fact.py +31 -23
- gedcom_x-0.5.7/gedcomx/Gedcom5x.py → gedcom_x-0.5.8/gedcomx/gedcom5x.py +1 -1
- gedcom_x-0.5.8/gedcomx/gedcom7/Exceptions.py +9 -0
- gedcom_x-0.5.8/gedcomx/gedcom7/Gedcom7.py +160 -0
- gedcom_x-0.5.8/gedcomx/gedcom7/GedcomStructure.py +94 -0
- gedcom_x-0.5.8/gedcomx/gedcom7/Specification.py +347 -0
- gedcom_x-0.5.8/gedcomx/gedcom7/__init__.py +26 -0
- gedcom_x-0.5.8/gedcomx/gedcom7/g7interop.py +205 -0
- gedcom_x-0.5.8/gedcomx/gedcom7/logger.py +19 -0
- gedcom_x-0.5.7/gedcomx/GedcomX.py → gedcom_x-0.5.8/gedcomx/gedcomx.py +14 -13
- gedcom_x-0.5.7/gedcomx/Gender.py → gedcom_x-0.5.8/gedcomx/gender.py +25 -11
- gedcom_x-0.5.8/gedcomx/group.py +63 -0
- gedcom_x-0.5.7/gedcomx/Identifier.py → gedcom_x-0.5.8/gedcomx/identifier.py +4 -4
- gedcom_x-0.5.7/gedcomx/Mutations.py → gedcom_x-0.5.8/gedcomx/mutations.py +49 -25
- gedcom_x-0.5.7/gedcomx/Name.py → gedcom_x-0.5.8/gedcomx/name.py +15 -15
- gedcom_x-0.5.7/gedcomx/Note.py → gedcom_x-0.5.8/gedcomx/note.py +2 -2
- gedcom_x-0.5.7/gedcomx/OnlineAccount.py → gedcom_x-0.5.8/gedcomx/online_account.py +1 -1
- gedcom_x-0.5.7/gedcomx/Person.py → gedcom_x-0.5.8/gedcomx/person.py +18 -16
- gedcom_x-0.5.7/gedcomx/PlaceDescription.py → gedcom_x-0.5.8/gedcomx/place_description.py +18 -16
- gedcom_x-0.5.7/gedcomx/PlaceReference.py → gedcom_x-0.5.8/gedcomx/place_reference.py +4 -4
- gedcom_x-0.5.7/gedcomx/Qualifier.py → gedcom_x-0.5.8/gedcomx/qualifier.py +1 -1
- gedcom_x-0.5.7/gedcomx/Relationship.py → gedcom_x-0.5.8/gedcomx/relationship.py +30 -12
- gedcom_x-0.5.7/gedcomx/Resource.py → gedcom_x-0.5.8/gedcomx/resource.py +2 -2
- gedcom_x-0.5.7/gedcomx/Serialization.py → gedcom_x-0.5.8/gedcomx/serialization.py +31 -32
- gedcom_x-0.5.7/gedcomx/SourceDescription.py → gedcom_x-0.5.8/gedcomx/source_description.py +16 -16
- gedcom_x-0.5.7/gedcomx/SourceReference.py → gedcom_x-0.5.8/gedcomx/source_reference.py +7 -7
- gedcom_x-0.5.7/gedcomx/Subject.py → gedcom_x-0.5.8/gedcomx/subject.py +26 -8
- gedcom_x-0.5.7/gedcomx/Translation.py → gedcom_x-0.5.8/gedcomx/translation.py +1 -1
- gedcom_x-0.5.7/gedcomx/URI.py → gedcom_x-0.5.8/gedcomx/uri.py +42 -26
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/pyproject.toml +2 -2
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/setup.py +1 -1
- gedcom_x-0.5.7/gedcom_x.egg-info/SOURCES.txt +0 -52
- gedcom_x-0.5.7/gedcomx/Group.py +0 -37
- gedcom_x-0.5.7/gedcomx/__init__.py +0 -49
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/README.md +0 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcom_x.egg-info/dependency_links.txt +0 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcom_x.egg-info/top_level.txt +0 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcomx/Extensions/__init__.py +0 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcomx/Extensions/rs10/__init__.py +0 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcomx/Logging.py +0 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/gedcomx/Zip.py +0 -0
- /gedcom_x-0.5.7/gedcomx/Exceptions.py → /gedcom_x-0.5.8/gedcomx/exceptions.py +0 -0
- /gedcom_x-0.5.7/gedcomx/ExtensibleEnum.py → /gedcom_x-0.5.8/gedcomx/extensible_enum.py +0 -0
- /gedcom_x-0.5.7/gedcomx/Gedcom.py → /gedcom_x-0.5.8/gedcomx/gedcom.py +0 -0
- /gedcom_x-0.5.7/gedcomx/LoggingHub.py → /gedcom_x-0.5.8/gedcomx/logging_hub.py +0 -0
- /gedcom_x-0.5.7/gedcomx/SourceCitation.py → /gedcom_x-0.5.8/gedcomx/source_citation.py +0 -0
- /gedcom_x-0.5.7/gedcomx/TextValue.py → /gedcom_x-0.5.8/gedcomx/textvalue.py +0 -0
- {gedcom_x-0.5.7 → gedcom_x-0.5.8}/setup.cfg +0 -0
@@ -0,0 +1,88 @@
|
|
1
|
+
README.md
|
2
|
+
pyproject.toml
|
3
|
+
setup.py
|
4
|
+
gedcom_x.egg-info/PKG-INFO
|
5
|
+
gedcom_x.egg-info/SOURCES.txt
|
6
|
+
gedcom_x.egg-info/dependency_links.txt
|
7
|
+
gedcom_x.egg-info/top_level.txt
|
8
|
+
gedcomx/Address.py
|
9
|
+
gedcomx/Agent.py
|
10
|
+
gedcomx/Attribution.py
|
11
|
+
gedcomx/Conclusion.py
|
12
|
+
gedcomx/Converter.py
|
13
|
+
gedcomx/Coverage.py
|
14
|
+
gedcomx/Date.py
|
15
|
+
gedcomx/Document.py
|
16
|
+
gedcomx/Event.py
|
17
|
+
gedcomx/Exceptions.py
|
18
|
+
gedcomx/Fact.py
|
19
|
+
gedcomx/Gedcom.py
|
20
|
+
gedcomx/Gedcom5x.py
|
21
|
+
gedcomx/GedcomX.py
|
22
|
+
gedcomx/Gender.py
|
23
|
+
gedcomx/Group.py
|
24
|
+
gedcomx/Identifier.py
|
25
|
+
gedcomx/Logging.py
|
26
|
+
gedcomx/Mutations.py
|
27
|
+
gedcomx/Name.py
|
28
|
+
gedcomx/Note.py
|
29
|
+
gedcomx/Person.py
|
30
|
+
gedcomx/Qualifier.py
|
31
|
+
gedcomx/Relationship.py
|
32
|
+
gedcomx/Resource.py
|
33
|
+
gedcomx/Serialization.py
|
34
|
+
gedcomx/Subject.py
|
35
|
+
gedcomx/TextValue.py
|
36
|
+
gedcomx/TopLevelTypeCollection.py
|
37
|
+
gedcomx/Translation.py
|
38
|
+
gedcomx/URI.py
|
39
|
+
gedcomx/Zip.py
|
40
|
+
gedcomx/__init__.py
|
41
|
+
gedcomx/address.py
|
42
|
+
gedcomx/agent.py
|
43
|
+
gedcomx/attribution.py
|
44
|
+
gedcomx/conclusion.py
|
45
|
+
gedcomx/converter.py
|
46
|
+
gedcomx/coverage.py
|
47
|
+
gedcomx/date.py
|
48
|
+
gedcomx/document.py
|
49
|
+
gedcomx/event.py
|
50
|
+
gedcomx/evidence_reference.py
|
51
|
+
gedcomx/exceptions.py
|
52
|
+
gedcomx/extensible_enum.py
|
53
|
+
gedcomx/fact.py
|
54
|
+
gedcomx/gedcom.py
|
55
|
+
gedcomx/gedcom5x.py
|
56
|
+
gedcomx/gedcomx.py
|
57
|
+
gedcomx/gender.py
|
58
|
+
gedcomx/group.py
|
59
|
+
gedcomx/identifier.py
|
60
|
+
gedcomx/logging_hub.py
|
61
|
+
gedcomx/mutations.py
|
62
|
+
gedcomx/name.py
|
63
|
+
gedcomx/note.py
|
64
|
+
gedcomx/online_account.py
|
65
|
+
gedcomx/person.py
|
66
|
+
gedcomx/place_description.py
|
67
|
+
gedcomx/place_reference.py
|
68
|
+
gedcomx/qualifier.py
|
69
|
+
gedcomx/relationship.py
|
70
|
+
gedcomx/resource.py
|
71
|
+
gedcomx/serialization.py
|
72
|
+
gedcomx/source_citation.py
|
73
|
+
gedcomx/source_description.py
|
74
|
+
gedcomx/source_reference.py
|
75
|
+
gedcomx/subject.py
|
76
|
+
gedcomx/textvalue.py
|
77
|
+
gedcomx/translation.py
|
78
|
+
gedcomx/uri.py
|
79
|
+
gedcomx/Extensions/__init__.py
|
80
|
+
gedcomx/Extensions/rs10/__init__.py
|
81
|
+
gedcomx/Extensions/rs10/rsLink.py
|
82
|
+
gedcomx/gedcom7/Exceptions.py
|
83
|
+
gedcomx/gedcom7/Gedcom7.py
|
84
|
+
gedcomx/gedcom7/GedcomStructure.py
|
85
|
+
gedcomx/gedcom7/Specification.py
|
86
|
+
gedcomx/gedcom7/__init__.py
|
87
|
+
gedcomx/gedcom7/g7interop.py
|
88
|
+
gedcomx/gedcom7/logger.py
|
@@ -12,8 +12,8 @@ except data types that are defined by the GEDCOM X Conceptual Model to explicitl
|
|
12
12
|
'''
|
13
13
|
|
14
14
|
from typing import List, Optional
|
15
|
-
from ...
|
16
|
-
from ...
|
15
|
+
from ...uri import URI
|
16
|
+
from ...exceptions import GedcomClassAttributeError
|
17
17
|
|
18
18
|
|
19
19
|
class rsLink():
|
@@ -70,7 +70,7 @@ class rsLink():
|
|
70
70
|
|
71
71
|
@property
|
72
72
|
def _as_dict_(self):
|
73
|
-
from ...
|
73
|
+
from ...serialization import Serialization
|
74
74
|
type_as_dict = {
|
75
75
|
"rel": self.rel._as_dict_ if self.rel else None,
|
76
76
|
"href": self.href._as_dict_ if self.href else None,
|
@@ -0,0 +1,50 @@
|
|
1
|
+
from .agent import Agent
|
2
|
+
from .address import Address
|
3
|
+
from .attribution import Attribution
|
4
|
+
from .conclusion import Conclusion
|
5
|
+
from .converter import GedcomConverter
|
6
|
+
from .coverage import Coverage
|
7
|
+
from .date import Date
|
8
|
+
from .document import Document
|
9
|
+
from .document import DocumentType
|
10
|
+
from .evidence_reference import EvidenceReference
|
11
|
+
from .extensible_enum import ExtensibleEnum
|
12
|
+
from .event import Event
|
13
|
+
from .event import EventType
|
14
|
+
from .event import EventRole
|
15
|
+
from .fact import Fact
|
16
|
+
from .fact import FactQualifier
|
17
|
+
from .fact import FactType
|
18
|
+
from .gedcom import Gedcom
|
19
|
+
from .gedcom5x import Gedcom5x, Gedcom5xRecord
|
20
|
+
from .gedcomx import GedcomX
|
21
|
+
from .gender import Gender, GenderType
|
22
|
+
from .group import Group, GroupRole
|
23
|
+
from .identifier import Identifier, IdentifierType, IdentifierList
|
24
|
+
from .Logging import get_logger
|
25
|
+
from .name import Name, NameForm, NamePart, NamePartType, NameType, NamePartQualifier
|
26
|
+
from .note import Note
|
27
|
+
from .online_account import OnlineAccount
|
28
|
+
from .person import Person, QuickPerson
|
29
|
+
from .place_description import PlaceDescription
|
30
|
+
from .place_reference import PlaceReference
|
31
|
+
from .qualifier import Qualifier
|
32
|
+
from .relationship import Relationship, RelationshipType
|
33
|
+
from .serialization import Serialization
|
34
|
+
from .source_citation import SourceCitation
|
35
|
+
from .source_description import SourceDescription
|
36
|
+
from .source_description import ResourceType
|
37
|
+
from .source_reference import SourceReference
|
38
|
+
from .subject import Subject
|
39
|
+
from .textvalue import TextValue
|
40
|
+
from .resource import Resource
|
41
|
+
from .uri import URI
|
42
|
+
|
43
|
+
|
44
|
+
from .Extensions.rs10.rsLink import rsLink
|
45
|
+
|
46
|
+
from .gedcom7.Gedcom7 import Gedcom7, GedcomStructure
|
47
|
+
from .translation import g7toXtable
|
48
|
+
|
49
|
+
|
50
|
+
|
@@ -113,7 +113,7 @@ class Address:
|
|
113
113
|
|
114
114
|
@property
|
115
115
|
def _as_dict_(self):
|
116
|
-
from .
|
116
|
+
from .serialization import Serialization
|
117
117
|
type_as_dict = {}
|
118
118
|
if self.city: type_as_dict["city"] = self.city
|
119
119
|
if self.country: type_as_dict["country"] = self.country
|
@@ -2,16 +2,31 @@ import base64
|
|
2
2
|
import uuid
|
3
3
|
|
4
4
|
from typing import List, Optional
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
"""
|
6
|
+
======================================================================
|
7
|
+
Project: Gedcom-X
|
8
|
+
File: agent.py
|
9
|
+
Author: David J. Cartwright
|
10
|
+
Purpose:
|
11
|
+
|
12
|
+
Created: 2025-08-25
|
13
|
+
Updated:
|
14
|
+
-
|
15
|
+
|
16
|
+
======================================================================
|
17
|
+
"""
|
18
|
+
|
19
|
+
"""
|
20
|
+
======================================================================
|
21
|
+
GEDCOM Module Type Imports
|
22
|
+
======================================================================
|
23
|
+
"""
|
24
|
+
from .address import Address
|
25
|
+
from .identifier import Identifier, IdentifierList
|
26
|
+
from .online_account import OnlineAccount
|
27
|
+
from .resource import Resource
|
28
|
+
from .textvalue import TextValue
|
29
|
+
from .uri import URI
|
15
30
|
|
16
31
|
|
17
32
|
class Agent:
|
@@ -83,7 +98,7 @@ class Agent:
|
|
83
98
|
self.phones = phones or []
|
84
99
|
self.addresses = addresses if addresses else []
|
85
100
|
self.person = person
|
86
|
-
self.
|
101
|
+
self.xnotes = []
|
87
102
|
self.attribution = attribution or None
|
88
103
|
self.uri = URI(fragment=self.id) if self.id else None
|
89
104
|
|
@@ -115,7 +130,7 @@ class Agent:
|
|
115
130
|
raise ValueError(f'name must be of type str or TextValue, recived {type(name_to_add)}')
|
116
131
|
|
117
132
|
def add_note(self, note_to_add):
|
118
|
-
from .
|
133
|
+
from .note import Note
|
119
134
|
if note_to_add and isinstance(note_to_add,Note):
|
120
135
|
self.xnotes.append(note_to_add)
|
121
136
|
else:
|
@@ -126,7 +141,7 @@ class Agent:
|
|
126
141
|
|
127
142
|
@property
|
128
143
|
def _as_dict_(self):
|
129
|
-
from .
|
144
|
+
from .serialization import Serialization
|
130
145
|
type_as_dict = {}
|
131
146
|
|
132
147
|
if self.id:
|
@@ -147,8 +162,8 @@ class Agent:
|
|
147
162
|
type_as_dict["phones"] = self.phones
|
148
163
|
if self.addresses:
|
149
164
|
type_as_dict["addresses"] = [address._as_dict_ for address in self.addresses if address]
|
150
|
-
if self.
|
151
|
-
type_as_dict["notes"] = [note._as_dict_() for note in self.
|
165
|
+
if self.xnotes:
|
166
|
+
type_as_dict["notes"] = [note._as_dict_() for note in self.xnotes if note]
|
152
167
|
return Serialization.serialize_dict(type_as_dict)
|
153
168
|
|
154
169
|
@classmethod
|
@@ -156,8 +171,9 @@ class Agent:
|
|
156
171
|
"""
|
157
172
|
Create a Person instance from a JSON-dict (already parsed).
|
158
173
|
"""
|
174
|
+
from .serialization import Serialization
|
159
175
|
type_as_dict = Serialization.get_class_fields('Agent')
|
160
|
-
return Serialization.deserialize(
|
176
|
+
return Serialization.deserialize(type_as_dict,Agent)
|
161
177
|
|
162
178
|
def __str__(self):
|
163
179
|
"""
|
@@ -22,8 +22,8 @@ GEDCOM Module Types
|
|
22
22
|
======================================================================
|
23
23
|
"""
|
24
24
|
|
25
|
-
from .
|
26
|
-
from .
|
25
|
+
from .agent import Agent
|
26
|
+
from .resource import Resource
|
27
27
|
#=====================================================================
|
28
28
|
|
29
29
|
|
@@ -86,6 +86,6 @@ class Attribution:
|
|
86
86
|
"""
|
87
87
|
Create a Person instance from a JSON-dict (already parsed).
|
88
88
|
"""
|
89
|
-
from .
|
89
|
+
from .serialization import Serialization
|
90
90
|
|
91
91
|
return Serialization.deserialize(data, Attribution)
|
@@ -3,17 +3,34 @@ import uuid
|
|
3
3
|
import warnings
|
4
4
|
|
5
5
|
from typing import List, Optional
|
6
|
+
"""
|
7
|
+
======================================================================
|
8
|
+
Project: Gedcom-X
|
9
|
+
File: conclusion.py
|
10
|
+
Author: David J. Cartwright
|
11
|
+
Purpose:
|
12
|
+
|
13
|
+
Created: 2025-08-25
|
14
|
+
Updated:
|
15
|
+
-
|
16
|
+
|
17
|
+
======================================================================
|
18
|
+
"""
|
19
|
+
|
20
|
+
"""
|
21
|
+
======================================================================
|
22
|
+
GEDCOM Module Type Imports
|
23
|
+
======================================================================
|
24
|
+
"""
|
25
|
+
from .attribution import Attribution
|
26
|
+
from .Extensions.rs10.rsLink import _rsLinkList, rsLink
|
27
|
+
from .note import Note
|
28
|
+
from .qualifier import Qualifier
|
29
|
+
from .resource import Resource, URI
|
30
|
+
from .source_reference import SourceReference
|
6
31
|
|
7
|
-
from .Attribution import Attribution
|
8
|
-
#from .Document import Document
|
9
|
-
from .Note import Note
|
10
|
-
from .Qualifier import Qualifier
|
11
32
|
|
12
|
-
from .SourceReference import SourceReference
|
13
|
-
from .Resource import Resource, URI
|
14
|
-
from .Extensions.rs10.rsLink import _rsLinkList, rsLink
|
15
33
|
|
16
|
-
from collections.abc import Sized
|
17
34
|
|
18
35
|
class ConfidenceLevel(Qualifier):
|
19
36
|
High = "http://gedcomx.org/High"
|
@@ -188,7 +205,7 @@ class Conclusion:
|
|
188
205
|
|
189
206
|
@property
|
190
207
|
def _as_dict_(self):
|
191
|
-
from .
|
208
|
+
from .serialization import Serialization
|
192
209
|
type_as_dict = {}
|
193
210
|
|
194
211
|
if self.id:
|
@@ -1,50 +1,65 @@
|
|
1
1
|
DEBUG = False
|
2
|
-
import
|
3
|
-
import json
|
2
|
+
import logging
|
4
3
|
import mimetypes
|
5
4
|
import re
|
6
|
-
import uuid
|
7
5
|
import xml.etree.ElementTree as ET
|
8
|
-
|
6
|
+
"""
|
7
|
+
======================================================================
|
8
|
+
Project: Gedcom-X
|
9
|
+
File: converter.py
|
10
|
+
Author: David J. Cartwright
|
11
|
+
Purpose: convert gedcom versions
|
12
|
+
|
13
|
+
Created: 2025-08-25
|
14
|
+
Updated:
|
15
|
+
- 2025-09-01: added docs and fixed imports for lowercase module names
|
16
|
+
|
17
|
+
======================================================================
|
18
|
+
"""
|
19
|
+
|
20
|
+
"""
|
21
|
+
======================================================================
|
22
|
+
GEDCOM Module Types
|
23
|
+
======================================================================
|
24
|
+
"""
|
9
25
|
from typing import List, Optional, Any
|
10
26
|
from xml.dom import minidom
|
11
|
-
from .
|
12
|
-
from .
|
13
|
-
from .
|
14
|
-
from .
|
15
|
-
from .
|
16
|
-
from .
|
17
|
-
from .
|
18
|
-
from .
|
19
|
-
from .
|
20
|
-
from .
|
21
|
-
from .
|
22
|
-
from .
|
23
|
-
from .
|
24
|
-
from .
|
25
|
-
from .
|
26
|
-
from .
|
27
|
-
from .
|
27
|
+
from .address import Address
|
28
|
+
from .agent import Agent
|
29
|
+
from .attribution import Attribution
|
30
|
+
from .conclusion import Conclusion
|
31
|
+
from .coverage import Coverage
|
32
|
+
from .date import Date, date_to_timestamp
|
33
|
+
from .document import Document
|
34
|
+
from .evidence_reference import EvidenceReference
|
35
|
+
from .exceptions import TagConversionError
|
36
|
+
from .event import Event, EventType, EventRole, EventRoleType
|
37
|
+
from .fact import Fact, FactType, FactQualifier
|
38
|
+
from .gedcom import Gedcom
|
39
|
+
from .gedcom5x import Gedcom5x, Gedcom5xRecord
|
40
|
+
from .gedcomx import GedcomX
|
41
|
+
from .gender import Gender, GenderType
|
42
|
+
from .group import Group
|
43
|
+
from .identifier import Identifier, IdentifierType, make_uid, IdentifierList
|
28
44
|
from .Logging import get_logger
|
29
|
-
from .
|
30
|
-
from .
|
31
|
-
from .
|
32
|
-
from .
|
33
|
-
from .
|
34
|
-
from .
|
35
|
-
from .
|
36
|
-
from .
|
37
|
-
from .
|
38
|
-
from .
|
39
|
-
from .
|
40
|
-
|
41
|
-
from .
|
42
|
-
from .
|
43
|
-
from .
|
45
|
+
from .logging_hub import hub, ChannelConfig
|
46
|
+
from .name import Name, NameType, NameForm, NamePart, NamePartType, NamePartQualifier
|
47
|
+
from .note import Note
|
48
|
+
from .online_account import OnlineAccount
|
49
|
+
from .person import Person
|
50
|
+
from .place_description import PlaceDescription
|
51
|
+
from .place_reference import PlaceReference
|
52
|
+
from .qualifier import Qualifier
|
53
|
+
from .relationship import Relationship, RelationshipType
|
54
|
+
from .resource import Resource
|
55
|
+
from .source_citation import SourceCitation
|
56
|
+
from .source_description import SourceDescription, ResourceType
|
57
|
+
from .source_reference import SourceReference, KnownSourceReference
|
58
|
+
# from .subject import Subject
|
59
|
+
from .textvalue import TextValue
|
60
|
+
#from .topleveltypecollection import TopLevelTypeCollection
|
61
|
+
from .uri import URI
|
44
62
|
|
45
|
-
|
46
|
-
import logging
|
47
|
-
from .LoggingHub import hub, ChannelConfig
|
48
63
|
log = logging.getLogger("gedcomx")
|
49
64
|
job_id = "gedcomx.convert.GEDCOM5x"
|
50
65
|
|
@@ -1,7 +1,25 @@
|
|
1
1
|
from typing import Optional
|
2
|
+
"""
|
3
|
+
======================================================================
|
4
|
+
Project: Gedcom-X
|
5
|
+
File: coverage.py
|
6
|
+
Author: David J. Cartwright
|
7
|
+
Purpose:
|
2
8
|
|
3
|
-
|
4
|
-
|
9
|
+
Created: 2025-08-25
|
10
|
+
Updated:
|
11
|
+
- 2025-08-31:
|
12
|
+
|
13
|
+
======================================================================
|
14
|
+
"""
|
15
|
+
|
16
|
+
"""
|
17
|
+
======================================================================
|
18
|
+
GEDCOM Module Types
|
19
|
+
======================================================================
|
20
|
+
"""
|
21
|
+
from .date import Date
|
22
|
+
from .place_reference import PlaceReference
|
5
23
|
|
6
24
|
|
7
25
|
class Coverage:
|
@@ -16,7 +34,7 @@ class Coverage:
|
|
16
34
|
|
17
35
|
@property
|
18
36
|
def _as_dict_(self):
|
19
|
-
from .
|
37
|
+
from .serialization import Serialization
|
20
38
|
type_as_dict = {}
|
21
39
|
if self.spatial:
|
22
40
|
type_as_dict['spatial'] = getattr(self.spatial, '_as_dict_', self.spatial)
|
@@ -29,8 +47,8 @@ class Coverage:
|
|
29
47
|
"""
|
30
48
|
Create a Coverage instance from a JSON-dict (already parsed).
|
31
49
|
"""
|
32
|
-
from .
|
33
|
-
from .
|
50
|
+
from .place_reference import PlaceReference
|
51
|
+
from .date import Date
|
34
52
|
|
35
53
|
spatial = PlaceReference._from_json_(data.get('spatial')) if data.get('spatial') else None
|
36
54
|
temporal = Date._from_json_(data.get('temporal')) if data.get('temporal') else None
|
@@ -1,12 +1,29 @@
|
|
1
1
|
from enum import Enum
|
2
2
|
from typing import Optional, List
|
3
|
+
"""
|
4
|
+
======================================================================
|
5
|
+
Project: Gedcom-X
|
6
|
+
File: document.py
|
7
|
+
Author: David J. Cartwright
|
8
|
+
Purpose:
|
3
9
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
10
|
+
Created: 2025-08-25
|
11
|
+
Updated:
|
12
|
+
- 2025-08-31:
|
13
|
+
|
14
|
+
======================================================================
|
15
|
+
"""
|
8
16
|
|
9
|
-
|
17
|
+
"""
|
18
|
+
======================================================================
|
19
|
+
GEDCOM Module Types
|
20
|
+
======================================================================
|
21
|
+
"""
|
22
|
+
from .attribution import Attribution
|
23
|
+
from .conclusion import Conclusion, ConfidenceLevel
|
24
|
+
from .note import Note
|
25
|
+
from .resource import Resource
|
26
|
+
from .source_reference import SourceReference
|
10
27
|
|
11
28
|
|
12
29
|
class DocumentType(Enum):
|
@@ -38,7 +55,7 @@ class Document(Conclusion):
|
|
38
55
|
sources: Optional[List[SourceReference]] = None,
|
39
56
|
analysis: Optional[Resource] = None,
|
40
57
|
notes: Optional[List[Note]] = None,
|
41
|
-
confidence: Optional[
|
58
|
+
confidence: Optional[ConfidenceLevel] = None, # ConfidenceLevel
|
42
59
|
attribution: Optional[Attribution] = None,
|
43
60
|
type: Optional[DocumentType] = None,
|
44
61
|
extracted: Optional[bool] = None, # Default to False
|
@@ -53,7 +70,7 @@ class Document(Conclusion):
|
|
53
70
|
|
54
71
|
@property
|
55
72
|
def _as_dict(self):
|
56
|
-
from .
|
73
|
+
from .serialization import Serialization
|
57
74
|
type_as_dict = super()._as_dict_
|
58
75
|
if self.type:
|
59
76
|
type_as_dict['type'] = self.type.value
|
@@ -70,5 +87,6 @@ class Document(Conclusion):
|
|
70
87
|
"""
|
71
88
|
Create a Person instance from a JSON-dict (already parsed).
|
72
89
|
"""
|
90
|
+
from .serialization import Serialization
|
73
91
|
type_as_dict = Serialization.get_class_fields('Document')
|
74
|
-
return Serialization.deserialize(
|
92
|
+
return Serialization.deserialize(type_as_dict,Document)
|
@@ -20,16 +20,16 @@ from typing import List, Optional
|
|
20
20
|
GEDCOM Module Type Imports
|
21
21
|
======================================================================
|
22
22
|
"""
|
23
|
-
from .
|
24
|
-
from .
|
25
|
-
from .
|
26
|
-
from .
|
27
|
-
from .
|
28
|
-
from .
|
29
|
-
from .
|
30
|
-
from .
|
31
|
-
from .
|
32
|
-
from .
|
23
|
+
from .attribution import Attribution
|
24
|
+
from .conclusion import ConfidenceLevel, Conclusion
|
25
|
+
from .date import Date
|
26
|
+
from .evidence_reference import EvidenceReference
|
27
|
+
from .identifier import IdentifierList
|
28
|
+
from .note import Note
|
29
|
+
from .place_reference import PlaceReference
|
30
|
+
from .resource import Resource
|
31
|
+
from .source_reference import SourceReference
|
32
|
+
from .subject import Subject
|
33
33
|
|
34
34
|
#=====================================================================
|
35
35
|
|
@@ -103,7 +103,7 @@ class EventRole(Conclusion):
|
|
103
103
|
|
104
104
|
@property
|
105
105
|
def _as_dict_(self):
|
106
|
-
from .
|
106
|
+
from .serialization import Serialization
|
107
107
|
type_as_dict = super()._as_dict_
|
108
108
|
if self.person:
|
109
109
|
type_as_dict['person'] = Resource(target=self.person)._as_dict_
|
@@ -268,7 +268,7 @@ class Event(Subject):
|
|
268
268
|
|
269
269
|
@property
|
270
270
|
def _as_dict_(self):
|
271
|
-
from .
|
271
|
+
from .serialization import Serialization
|
272
272
|
type_as_dict = super()._as_dict_
|
273
273
|
type_as_dict.update({
|
274
274
|
'type': self.type.value if self.type else None,
|
@@ -285,5 +285,5 @@ class Event(Subject):
|
|
285
285
|
Create a Person instance from a JSON-dict (already parsed).
|
286
286
|
"""
|
287
287
|
#type_as_dict = Serialization.get_class_fields('Event')
|
288
|
-
from .
|
288
|
+
from .serialization import Serialization
|
289
289
|
return Serialization.deserialize(data, Event)
|