gedcom-x 0.5.2__py3-none-any.whl → 0.5.6__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.6.dist-info/METADATA +144 -0
- gedcom_x-0.5.6.dist-info/RECORD +45 -0
- gedcomx/Address.py +2 -0
- gedcomx/Agent.py +9 -2
- gedcomx/Attribution.py +10 -46
- gedcomx/Conclusion.py +85 -21
- gedcomx/Coverage.py +10 -0
- gedcomx/Date.py +2 -7
- gedcomx/Document.py +27 -6
- gedcomx/Event.py +20 -1
- gedcomx/Exceptions.py +6 -0
- gedcomx/ExtensibleEnum.py +183 -0
- gedcomx/Fact.py +7 -8
- gedcomx/Gedcom.py +38 -404
- gedcomx/Gedcom5x.py +579 -0
- gedcomx/GedcomX.py +48 -26
- gedcomx/Gender.py +6 -40
- gedcomx/Identifier.py +151 -97
- gedcomx/LoggingHub.py +186 -0
- gedcomx/Mutations.py +228 -0
- gedcomx/Name.py +6 -0
- gedcomx/Person.py +49 -90
- gedcomx/PlaceDescription.py +23 -14
- gedcomx/PlaceReference.py +12 -15
- gedcomx/Relationship.py +23 -54
- gedcomx/Resource.py +17 -3
- gedcomx/Serialization.py +352 -31
- gedcomx/SourceDescription.py +6 -9
- gedcomx/SourceReference.py +20 -86
- gedcomx/Subject.py +4 -4
- gedcomx/Translation.py +219 -0
- gedcomx/URI.py +1 -0
- gedcomx/__init__.py +8 -1
- gedcom_x-0.5.2.dist-info/METADATA +0 -17
- gedcom_x-0.5.2.dist-info/RECORD +0 -42
- gedcomx/_Links.py +0 -37
- gedcomx/g7interop.py +0 -205
- {gedcom_x-0.5.2.dist-info → gedcom_x-0.5.6.dist-info}/WHEEL +0 -0
- {gedcom_x-0.5.2.dist-info → gedcom_x-0.5.6.dist-info}/top_level.txt +0 -0
gedcomx/SourceDescription.py
CHANGED
@@ -78,7 +78,7 @@ class SourceDescription:
|
|
78
78
|
notes: Optional[List[Note]] = None,
|
79
79
|
attribution: Optional[Attribution] = None,
|
80
80
|
rights: Optional[List[Resource]] = [],
|
81
|
-
coverage: Optional[Coverage] = None, # Coverage
|
81
|
+
coverage: Optional[List[Coverage]] = None, # Coverage
|
82
82
|
descriptions: Optional[List[TextValue]] = None,
|
83
83
|
identifiers: Optional[IdentifierList] = None,
|
84
84
|
created: Optional[Date] = None,
|
@@ -180,18 +180,15 @@ class SourceDescription:
|
|
180
180
|
|
181
181
|
@property
|
182
182
|
def _as_dict_(self) -> Dict[str, Any]:
|
183
|
-
|
184
|
-
|
185
|
-
|
186
183
|
type_as_dict = {
|
187
184
|
'id': self.id,
|
188
185
|
'about': self.about._as_dict_ if self.about else None,
|
189
186
|
'resourceType': self.resourceType.value if self.resourceType else None,
|
190
187
|
'citations': [c._as_dict_ for c in self.citations] or None,
|
191
188
|
'mediaType': self.mediaType,
|
192
|
-
'mediator':
|
193
|
-
'publisher':
|
194
|
-
'authors': [
|
189
|
+
'mediator': self.mediator._as_dict_ if self.mediator else None,
|
190
|
+
'publisher': self.publisher._as_dict_ if self.publisher else None,
|
191
|
+
'authors': self.authors and [a._as_dict_ for a in self.authors] or None,
|
195
192
|
'sources': [s._as_dict_ for s in self.sources] or None,
|
196
193
|
'analysis': self.analysis._as_dict_ if self.analysis else None,
|
197
194
|
'componentOf': self.componentOf._as_dict_ if self.componentOf else None,
|
@@ -199,13 +196,13 @@ class SourceDescription:
|
|
199
196
|
'notes': [n._as_dict_ for n in self.notes] or None,
|
200
197
|
'attribution': self.attribution._as_dict_ if self.attribution else None,
|
201
198
|
'rights': [r._as_dict_ for r in self.rights] or None,
|
202
|
-
'coverage':
|
199
|
+
'coverage': [c._as_dict_ for c in self.coverage] or None,
|
203
200
|
'descriptions': [d._as_dict_ for d in self.descriptions] or None,
|
204
201
|
'identifiers': self.identifiers._as_dict_ if self.identifiers else None,
|
205
202
|
'created': self.created if self.created else None,
|
206
203
|
'modified': self.modified if self.modified else None,
|
207
204
|
'published': self.published if self.published else None,
|
208
|
-
'repository':
|
205
|
+
'repository': self.repository._as_dict_ if self.repository else None,
|
209
206
|
'uri': self.uri.value
|
210
207
|
}
|
211
208
|
|
gedcomx/SourceReference.py
CHANGED
@@ -4,6 +4,7 @@ from .Attribution import Attribution
|
|
4
4
|
from .Qualifier import Qualifier
|
5
5
|
|
6
6
|
from .Resource import Resource
|
7
|
+
from .Serialization import Serialization
|
7
8
|
from .URI import URI
|
8
9
|
|
9
10
|
from collections.abc import Sized
|
@@ -53,34 +54,21 @@ class SourceReference:
|
|
53
54
|
qualifiers: Optional[List[Qualifier]] = None
|
54
55
|
) -> None:
|
55
56
|
|
56
|
-
#if not isinstance(description,URI): raise ValueError(f"description is of type {type(description)}")
|
57
|
-
'''from .SourceDescription import SourceDescription
|
58
|
-
self._description_object = None
|
59
|
-
if isinstance(description,URI):
|
60
|
-
#TODO See if Local, If not try to resolve,
|
61
|
-
self._description_object = description
|
62
|
-
|
63
|
-
elif isinstance(description,SourceDescription):
|
64
|
-
self._description_object = description
|
65
|
-
if hasattr(description,'_uri'):
|
66
|
-
self.description = description._uri
|
67
|
-
else:
|
68
|
-
assert False
|
69
|
-
self.description = Resource(object=description)
|
70
|
-
description._uri = self.description
|
71
|
-
description._object = description
|
72
|
-
else:
|
73
|
-
raise ValueError(f"'description' must be of type 'SourceDescription' or 'URI', type: {type(description)} was provided")'''
|
74
|
-
|
75
|
-
|
76
57
|
self.description = description
|
77
58
|
self.descriptionId = descriptionId
|
78
59
|
self.attribution = attribution
|
79
|
-
self.qualifiers = qualifiers
|
60
|
+
self.qualifiers = qualifiers if qualifiers and isinstance(qualifiers, list) else []
|
80
61
|
|
81
62
|
def add_qualifier(self, qualifier: Qualifier):
|
82
|
-
if isinstance(qualifier, Qualifier):
|
63
|
+
if isinstance(qualifier, (Qualifier,KnownSourceReference)):
|
64
|
+
if self.qualifiers:
|
65
|
+
#TODO Prevent Duplicates
|
66
|
+
for current_qualifier in self.qualifiers:
|
67
|
+
if qualifier == current_qualifier:
|
68
|
+
return
|
83
69
|
self.qualifiers.append(qualifier)
|
70
|
+
return
|
71
|
+
raise ValueError("The 'qualifier' must be type 'Qualifier' or 'KnownSourceReference', not " + str(type(qualifier)))
|
84
72
|
|
85
73
|
def append(self, text_to_add: str):
|
86
74
|
if text_to_add and isinstance(text_to_add, str):
|
@@ -93,82 +81,28 @@ class SourceReference:
|
|
93
81
|
|
94
82
|
@property
|
95
83
|
def _as_dict_(self):
|
96
|
-
|
97
|
-
def _serialize(value):
|
98
|
-
if isinstance(value, (str, int, float, bool, type(None))):
|
99
|
-
return value
|
100
|
-
elif isinstance(value, dict):
|
101
|
-
return {k: _serialize(v) for k, v in value.items()}
|
102
|
-
elif isinstance(value, (list, tuple, set)):
|
103
|
-
return [_serialize(v) for v in value]
|
104
|
-
elif hasattr(value, "_as_dict_"):
|
105
|
-
return value._as_dict_
|
106
|
-
else:
|
107
|
-
return str(value) # fallback for unknown objects
|
108
|
-
|
109
84
|
# Only add Relationship-specific fields
|
110
|
-
|
111
|
-
'description':self.description.
|
85
|
+
type_as_dict = {
|
86
|
+
'description':self.description._as_dict_ if self.description else None,
|
112
87
|
'descriptionId': self.descriptionId.replace("\n"," ").replace("\r"," ") if self.descriptionId else None,
|
113
88
|
'attribution': self.attribution._as_dict_ if self.attribution else None,
|
114
89
|
'qualifiers':[qualifier.value for qualifier in self.qualifiers ] if self.qualifiers else None
|
115
90
|
}
|
91
|
+
return Serialization.serialize_dict(type_as_dict)
|
116
92
|
|
117
|
-
|
118
|
-
for key, value in sourcereference_fields.items():
|
119
|
-
if value is not None:
|
120
|
-
sourcereference_fields[key] = _serialize(value)
|
121
|
-
|
122
|
-
return {
|
123
|
-
k: v
|
124
|
-
for k, v in sourcereference_fields.items()
|
125
|
-
if v is not None and not (isinstance(v, Sized) and len(v) == 0)
|
126
|
-
}
|
93
|
+
|
127
94
|
|
128
95
|
|
129
96
|
@classmethod
|
130
|
-
def _from_json_(cls, data: dict):
|
131
|
-
|
97
|
+
def _from_json_(cls, data: dict):
|
132
98
|
"""
|
133
|
-
Rehydrate a SourceReference from the dict
|
99
|
+
Rehydrate a SourceReference from the dict passed down from JSON deserialization.
|
100
|
+
NOTE: This does not resolve references to SourceDescription objects.
|
134
101
|
"""
|
135
|
-
from .
|
136
|
-
|
137
|
-
|
138
|
-
desc_json = data.get('description')
|
139
|
-
#if not desc_json:
|
140
|
-
# raise ValueError("SourceReference JSON missing 'description'")
|
141
|
-
#desc_obj = SourceDescription._from_json_(desc_json)
|
142
|
-
desc_obj = URI.from_url_(data.get('description')) #TODO <--- URI Reference
|
143
|
-
|
144
|
-
|
145
|
-
# 2) Simple fields
|
146
|
-
description_id = data.get('descriptionId')
|
147
|
-
|
148
|
-
# 3) Attribution (if present)
|
149
|
-
attrib = None
|
150
|
-
if data.get('attribution') is not None:
|
151
|
-
attrib = Attribution._from_json_(data['attribution'])
|
102
|
+
from .Serialization import Serialization
|
103
|
+
return Serialization.deserialize(data, SourceReference)
|
104
|
+
|
152
105
|
|
153
|
-
# 4) Qualifiers list
|
154
|
-
raw_quals = data.get('qualifiers', [])
|
155
|
-
qualifiers: List[Qualifier] = []
|
156
|
-
for q in raw_quals:
|
157
|
-
try:
|
158
|
-
# Try the known‐source enum first
|
159
|
-
qualifiers.append(KnownSourceReference(q))
|
160
|
-
except ValueError:
|
161
|
-
# Fallback to generic Qualifier
|
162
|
-
qualifiers.append(Qualifier(q))
|
163
|
-
|
164
|
-
# 5) Instantiate via your existing __init__
|
165
|
-
inst = cls(
|
166
|
-
description=desc_obj,
|
167
|
-
descriptionId=description_id,
|
168
|
-
attribution=attrib,
|
169
|
-
qualifiers=qualifiers
|
170
|
-
)
|
171
|
-
return inst
|
172
106
|
|
173
107
|
def __eq__(self, other):
|
174
108
|
if not isinstance(other, self.__class__):
|
gedcomx/Subject.py
CHANGED
@@ -9,7 +9,7 @@ from .Note import Note
|
|
9
9
|
from .Serialization import Serialization
|
10
10
|
from .SourceReference import SourceReference
|
11
11
|
from .Resource import Resource
|
12
|
-
from .
|
12
|
+
from .Extensions.rs10.rsLink import _rsLinkList
|
13
13
|
|
14
14
|
class Subject(Conclusion):
|
15
15
|
identifier = 'http://gedcomx.org/v1/Subject'
|
@@ -28,14 +28,14 @@ class Subject(Conclusion):
|
|
28
28
|
media: Optional[List[SourceReference]] = [],
|
29
29
|
identifiers: Optional[IdentifierList] = None,
|
30
30
|
uri: Optional[Resource] = None,
|
31
|
-
links: Optional[
|
31
|
+
links: Optional[_rsLinkList] = None) -> None:
|
32
32
|
super().__init__(id, lang, sources, analysis, notes, confidence, attribution,links=links)
|
33
33
|
self.extracted = extracted
|
34
34
|
self.evidence = evidence
|
35
35
|
self.media = media
|
36
|
-
self.identifiers = identifiers
|
36
|
+
self.identifiers = identifiers if identifiers else IdentifierList()
|
37
|
+
self.uri = uri
|
37
38
|
|
38
|
-
|
39
39
|
def add_identifier(self, identifier_to_add: Identifier):
|
40
40
|
if identifier_to_add and isinstance(identifier_to_add,Identifier):
|
41
41
|
for current_identifier in self.identifiers:
|
gedcomx/Translation.py
ADDED
@@ -0,0 +1,219 @@
|
|
1
|
+
from . import *
|
2
|
+
from .Mutations import GedcomXEventOrFact
|
3
|
+
|
4
|
+
'''
|
5
|
+
{'type': 'Object | Objects | Propertyof',
|
6
|
+
'Object': 'Class',
|
7
|
+
'Objects': ['Class',...],
|
8
|
+
'Propertyof': 'Class',
|
9
|
+
'Args': {'argname':'value|rTextValue|rIntValue|rFloatValue|rBoolValue|id|resource'},
|
10
|
+
'Assign': {'propertyname':'value|rTextValue|rIntValue|rFloatValue|rBoolValue|id|resource'},
|
11
|
+
'Selectoe':callable
|
12
|
+
}
|
13
|
+
|
14
|
+
'''
|
15
|
+
g7toXtable = {
|
16
|
+
"https://gedcom.io/terms/v7/ABBR": {},
|
17
|
+
"https://gedcom.io/terms/v7/ADDR": {'type':'Object','Object':Address, 'Args':{'value':'value'},'addmethod':'add_address'},
|
18
|
+
"https://gedcom.io/terms/v7/ADOP": {},
|
19
|
+
"https://gedcom.io/terms/v7/ADOP-FAMC": {},
|
20
|
+
"https://gedcom.io/terms/v7/ADR1": {'type':'Propertyof','propertyof':Address,'assign':{'street':'value'}},
|
21
|
+
"https://gedcom.io/terms/v7/ADR2": {'type':'Propertyof','propertyof':Address,'assign':{'street2':'value'}},
|
22
|
+
"https://gedcom.io/terms/v7/ADR3": {'type':'Propertyof','propertyof':Address,'assign':{'street3':'value'}},
|
23
|
+
"https://gedcom.io/terms/v7/AGE": {},
|
24
|
+
"https://gedcom.io/terms/v7/AGNC": {},
|
25
|
+
"https://gedcom.io/terms/v7/ALIA": {},
|
26
|
+
"https://gedcom.io/terms/v7/ANCI": {},
|
27
|
+
"https://gedcom.io/terms/v7/ANUL": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
28
|
+
"https://gedcom.io/terms/v7/ASSO": {},
|
29
|
+
"https://gedcom.io/terms/v7/AUTH": {},
|
30
|
+
"https://gedcom.io/terms/v7/BAPL": {},
|
31
|
+
"https://gedcom.io/terms/v7/BAPM": {},
|
32
|
+
"https://gedcom.io/terms/v7/BARM": {},
|
33
|
+
"https://gedcom.io/terms/v7/BASM": {},
|
34
|
+
"https://gedcom.io/terms/v7/BIRT": {},
|
35
|
+
"https://gedcom.io/terms/v7/BLES": {},
|
36
|
+
"https://gedcom.io/terms/v7/BURI": {},
|
37
|
+
"https://gedcom.io/terms/v7/CALN": {},
|
38
|
+
"https://gedcom.io/terms/v7/CAST": {},
|
39
|
+
"https://gedcom.io/terms/v7/CAUS": {},
|
40
|
+
"https://gedcom.io/terms/v7/CENS": {},
|
41
|
+
"https://gedcom.io/terms/v7/CHAN": {},
|
42
|
+
"https://gedcom.io/terms/v7/CHIL": {},
|
43
|
+
"https://gedcom.io/terms/v7/CHR": {},
|
44
|
+
"https://gedcom.io/terms/v7/CHRA": {},
|
45
|
+
"https://gedcom.io/terms/v7/CITY": {'type':'Propertyof','propertyof':Address,'assign':{'city':'value'}},
|
46
|
+
"https://gedcom.io/terms/v7/CONF": {},
|
47
|
+
"https://gedcom.io/terms/v7/CONL": {},
|
48
|
+
"https://gedcom.io/terms/v7/CONT": {},
|
49
|
+
"https://gedcom.io/terms/v7/COPR": {},
|
50
|
+
"https://gedcom.io/terms/v7/CORP": {},
|
51
|
+
"https://gedcom.io/terms/v7/CREA": {},
|
52
|
+
"https://gedcom.io/terms/v7/CREM": {},
|
53
|
+
"https://gedcom.io/terms/v7/CROP": {},
|
54
|
+
"https://gedcom.io/terms/v7/CTRY": {'type':'Propertyof','propertyof':Address,'assign':{'country':'value'}},
|
55
|
+
"https://gedcom.io/terms/v7/DATA": {},
|
56
|
+
"https://gedcom.io/terms/v7/DATA-EVEN": {},
|
57
|
+
"https://gedcom.io/terms/v7/DATA-EVEN-DATE": {},
|
58
|
+
"https://gedcom.io/terms/v7/DATE": {},
|
59
|
+
"https://gedcom.io/terms/v7/DATE-exact": {},
|
60
|
+
"https://gedcom.io/terms/v7/DEAT": {},
|
61
|
+
"https://gedcom.io/terms/v7/DESI": {},
|
62
|
+
"https://gedcom.io/terms/v7/DEST": {},
|
63
|
+
"https://gedcom.io/terms/v7/DIV": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
64
|
+
"https://gedcom.io/terms/v7/DIVF": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
65
|
+
"https://gedcom.io/terms/v7/DSCR": {},
|
66
|
+
"https://gedcom.io/terms/v7/EDUC": {},
|
67
|
+
"https://gedcom.io/terms/v7/EMAIL": {},
|
68
|
+
"https://gedcom.io/terms/v7/EMIG": {},
|
69
|
+
"https://gedcom.io/terms/v7/ENDL": {},
|
70
|
+
"https://gedcom.io/terms/v7/ENGA": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
71
|
+
"https://gedcom.io/terms/v7/EVEN": {},
|
72
|
+
"https://gedcom.io/terms/v7/EXID": {},
|
73
|
+
"https://gedcom.io/terms/v7/EXID-TYPE": {},
|
74
|
+
"https://gedcom.io/terms/v7/FACT": {},
|
75
|
+
"https://gedcom.io/terms/v7/FAM": {'type':'Object','Object':Relationship,'Args':{'id':'xref'},'stackentry':['lastrelationship','lastrelationshipdata']},
|
76
|
+
"https://gedcom.io/terms/v7/FAM-CENS": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
77
|
+
"https://gedcom.io/terms/v7/FAM-EVEN": {},
|
78
|
+
"https://gedcom.io/terms/v7/FAM-FACT": {},
|
79
|
+
"https://gedcom.io/terms/v7/FAM-HUSB": {'type':'Object','Object':Resource,'Args':{'Id':'xref'}},
|
80
|
+
"https://gedcom.io/terms/v7/FAM-NCHI": {},
|
81
|
+
"https://gedcom.io/terms/v7/FAM-RESI": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
82
|
+
"https://gedcom.io/terms/v7/FAM-WIFE": {'type':'Object','Object':Resource,'Args':{'Id':'xref'}},
|
83
|
+
"https://gedcom.io/terms/v7/FAMC": {},
|
84
|
+
"https://gedcom.io/terms/v7/FAMC-ADOP": {},
|
85
|
+
"https://gedcom.io/terms/v7/FAMC-STAT": {},
|
86
|
+
"https://gedcom.io/terms/v7/FAMS": {},
|
87
|
+
"https://gedcom.io/terms/v7/FAX": {},
|
88
|
+
"https://gedcom.io/terms/v7/FCOM": {},
|
89
|
+
"https://gedcom.io/terms/v7/FILE": {},
|
90
|
+
"https://gedcom.io/terms/v7/FILE-TRAN": {},
|
91
|
+
"https://gedcom.io/terms/v7/FORM": {},
|
92
|
+
"https://gedcom.io/terms/v7/GEDC": {},
|
93
|
+
"https://gedcom.io/terms/v7/GEDC-VERS": {},
|
94
|
+
"https://gedcom.io/terms/v7/GIVN": {},
|
95
|
+
"https://gedcom.io/terms/v7/GRAD": {},
|
96
|
+
"https://gedcom.io/terms/v7/HEAD": {},
|
97
|
+
"https://gedcom.io/terms/v7/HEAD-DATE": {},
|
98
|
+
"https://gedcom.io/terms/v7/HEAD-LANG": {},
|
99
|
+
"https://gedcom.io/terms/v7/HEAD-PLAC": {},
|
100
|
+
"https://gedcom.io/terms/v7/HEAD-PLAC-FORM": {},
|
101
|
+
"https://gedcom.io/terms/v7/HEAD-SOUR": {},
|
102
|
+
"https://gedcom.io/terms/v7/HEAD-SOUR-DATA": {},
|
103
|
+
"https://gedcom.io/terms/v7/HEIGHT": {},
|
104
|
+
"https://gedcom.io/terms/v7/HUSB": {},
|
105
|
+
"https://gedcom.io/terms/v7/IDNO": {},
|
106
|
+
"https://gedcom.io/terms/v7/IMMI": {},
|
107
|
+
"https://gedcom.io/terms/v7/INDI": {},
|
108
|
+
"https://gedcom.io/terms/v7/INDI-CENS": {},
|
109
|
+
"https://gedcom.io/terms/v7/INDI-EVEN": {},
|
110
|
+
"https://gedcom.io/terms/v7/INDI-FACT": {},
|
111
|
+
"https://gedcom.io/terms/v7/INDI-FAMC": {},
|
112
|
+
"https://gedcom.io/terms/v7/INDI-NAME": {},
|
113
|
+
"https://gedcom.io/terms/v7/INDI-NCHI": {},
|
114
|
+
"https://gedcom.io/terms/v7/INDI-RELI": {},
|
115
|
+
"https://gedcom.io/terms/v7/INDI-RESI": {},
|
116
|
+
"https://gedcom.io/terms/v7/INDI-TITL": {},
|
117
|
+
"https://gedcom.io/terms/v7/INIL": {},
|
118
|
+
"https://gedcom.io/terms/v7/LANG": {},
|
119
|
+
"https://gedcom.io/terms/v7/LATI": {},
|
120
|
+
"https://gedcom.io/terms/v7/LEFT": {},
|
121
|
+
"https://gedcom.io/terms/v7/LONG": {},
|
122
|
+
"https://gedcom.io/terms/v7/MAP": {},
|
123
|
+
"https://gedcom.io/terms/v7/MARB": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
124
|
+
"https://gedcom.io/terms/v7/MARC": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
125
|
+
"https://gedcom.io/terms/v7/MARL": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
126
|
+
"https://gedcom.io/terms/v7/MARR": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
127
|
+
"https://gedcom.io/terms/v7/MARS": {'type':'Mutation','Object':GedcomXEventOrFact,'Args':{'value':'value'},'propertyof':[Relationship],'method':'add_fact'},
|
128
|
+
"https://gedcom.io/terms/v7/MEDI": {},
|
129
|
+
"https://gedcom.io/terms/v7/MIME": {},
|
130
|
+
"https://gedcom.io/terms/v7/NAME": {},
|
131
|
+
"https://gedcom.io/terms/v7/NAME-TRAN": {},
|
132
|
+
"https://gedcom.io/terms/v7/NAME-TYPE": {},
|
133
|
+
"https://gedcom.io/terms/v7/NATI": {},
|
134
|
+
"https://gedcom.io/terms/v7/NATU": {},
|
135
|
+
"https://gedcom.io/terms/v7/NCHI": {},
|
136
|
+
"https://gedcom.io/terms/v7/NICK": {},
|
137
|
+
"https://gedcom.io/terms/v7/NMR": {},
|
138
|
+
"https://gedcom.io/terms/v7/NO": {},
|
139
|
+
"https://gedcom.io/terms/v7/NO-DATE": {},
|
140
|
+
"https://gedcom.io/terms/v7/NOTE": {},
|
141
|
+
"https://gedcom.io/terms/v7/NOTE-TRAN": {},
|
142
|
+
"https://gedcom.io/terms/v7/NPFX": {},
|
143
|
+
"https://gedcom.io/terms/v7/NSFX": {},
|
144
|
+
"https://gedcom.io/terms/v7/OBJE": {'type':'Object','Object':SourceReference,'Args':{'Id':'xref'}},
|
145
|
+
"https://gedcom.io/terms/v7/OCCU": {},
|
146
|
+
"https://gedcom.io/terms/v7/ORDN": {},
|
147
|
+
"https://gedcom.io/terms/v7/PAGE": {},
|
148
|
+
"https://gedcom.io/terms/v7/PEDI": {},
|
149
|
+
"https://gedcom.io/terms/v7/PHON": {},
|
150
|
+
"https://gedcom.io/terms/v7/PHRASE": {},
|
151
|
+
"https://gedcom.io/terms/v7/PLAC": {},
|
152
|
+
"https://gedcom.io/terms/v7/PLAC-FORM": {},
|
153
|
+
"https://gedcom.io/terms/v7/PLAC-TRAN": {},
|
154
|
+
"https://gedcom.io/terms/v7/POST": {},
|
155
|
+
"https://gedcom.io/terms/v7/PROB": {},
|
156
|
+
"https://gedcom.io/terms/v7/PROP": {},
|
157
|
+
"https://gedcom.io/terms/v7/PUBL": {},
|
158
|
+
"https://gedcom.io/terms/v7/QUAY": {},
|
159
|
+
"https://gedcom.io/terms/v7/REFN": {},
|
160
|
+
"https://gedcom.io/terms/v7/RELI": {},
|
161
|
+
"https://gedcom.io/terms/v7/REPO": {'type':'Object','Object':Resource,'Args':{'Id':'xref'}},
|
162
|
+
"https://gedcom.io/terms/v7/RESI": {},
|
163
|
+
"https://gedcom.io/terms/v7/RESN": {},
|
164
|
+
"https://gedcom.io/terms/v7/RETI": {},
|
165
|
+
"https://gedcom.io/terms/v7/ROLE": {},
|
166
|
+
"https://gedcom.io/terms/v7/SCHMA": {},
|
167
|
+
"https://gedcom.io/terms/v7/SDATE": {},
|
168
|
+
"https://gedcom.io/terms/v7/SEX": {},
|
169
|
+
"https://gedcom.io/terms/v7/SLGC": {},
|
170
|
+
"https://gedcom.io/terms/v7/SLGS": {},
|
171
|
+
"https://gedcom.io/terms/v7/SNOTE": {},
|
172
|
+
"https://gedcom.io/terms/v7/SOUR": {},
|
173
|
+
"https://gedcom.io/terms/v7/SOUR-DATA": {},
|
174
|
+
"https://gedcom.io/terms/v7/SOUR-EVEN": {},
|
175
|
+
"https://gedcom.io/terms/v7/SPFX": {},
|
176
|
+
"https://gedcom.io/terms/v7/SSN": {},
|
177
|
+
"https://gedcom.io/terms/v7/STAE": {'type':'Propertyof','propertyof':Address,'assign':{'stateOrProvince':'value'}},
|
178
|
+
"https://gedcom.io/terms/v7/STAT": {},
|
179
|
+
"https://gedcom.io/terms/v7/SUBM": {},
|
180
|
+
"https://gedcom.io/terms/v7/SUBM-LANG": {},
|
181
|
+
"https://gedcom.io/terms/v7/SURN": {'class':NamePart,
|
182
|
+
'args':{'type':NamePartType.Surname,'value':'rTextValue'}
|
183
|
+
},
|
184
|
+
"https://gedcom.io/terms/v7/TAG": {},
|
185
|
+
"https://gedcom.io/terms/v7/TEMP": {},
|
186
|
+
"https://gedcom.io/terms/v7/TEXT": {},
|
187
|
+
"https://gedcom.io/terms/v7/TIME": {},
|
188
|
+
"https://gedcom.io/terms/v7/TITL": {'type':'PropertyObject','Object':TextValue,'Args':{'value':'value'},'propertyof':[SourceDescription],'method':'add_title'},
|
189
|
+
"https://gedcom.io/terms/v7/TOP": {},
|
190
|
+
"https://gedcom.io/terms/v7/TRAN": {},
|
191
|
+
"https://gedcom.io/terms/v7/TRLR": {},
|
192
|
+
"https://gedcom.io/terms/v7/TYPE": {'type':'Object','Object':Note,'Args':{'text':'value'},'propertyof':[Fact],'method':'add_note'},
|
193
|
+
"https://gedcom.io/terms/v7/UID": {},
|
194
|
+
"https://gedcom.io/terms/v7/VERS": {},
|
195
|
+
"https://gedcom.io/terms/v7/WIDTH": {},
|
196
|
+
"https://gedcom.io/terms/v7/WIFE": {},
|
197
|
+
"https://gedcom.io/terms/v7/WILL": {},
|
198
|
+
"https://gedcom.io/terms/v7/WWW": {},
|
199
|
+
"https://gedcom.io/terms/v7/enumset-ADOP": {},
|
200
|
+
"https://gedcom.io/terms/v7/enumset-EVEN": {},
|
201
|
+
"https://gedcom.io/terms/v7/enumset-EVENATTR": {},
|
202
|
+
"https://gedcom.io/terms/v7/enumset-FAMC-STAT": {},
|
203
|
+
"https://gedcom.io/terms/v7/enumset-MEDI": {},
|
204
|
+
"https://gedcom.io/terms/v7/enumset-NAME-TYPE": {},
|
205
|
+
"https://gedcom.io/terms/v7/enumset-PEDI": {},
|
206
|
+
"https://gedcom.io/terms/v7/enumset-QUAY": {},
|
207
|
+
"https://gedcom.io/terms/v7/enumset-RESN": {},
|
208
|
+
"https://gedcom.io/terms/v7/enumset-ROLE": {},
|
209
|
+
"https://gedcom.io/terms/v7/enumset-SEX": {},
|
210
|
+
"https://gedcom.io/terms/v7/ord-STAT": {},
|
211
|
+
"https://gedcom.io/terms/v7/record-FAM": {'type':'TopLevelObject','Object':Relationship,'Args':{'id':'xref'}},
|
212
|
+
"https://gedcom.io/terms/v7/record-INDI": {'type':'TopLevelObject','Object':Person,'Args':{'id':'xref'}},
|
213
|
+
"https://gedcom.io/terms/v7/record-OBJE": {'type':'TopLevelObject','Object':SourceDescription, 'Args':{'id':'xref'}},
|
214
|
+
"https://gedcom.io/terms/v7/record-REPO": {'type':'TopLevelObject','Object':Agent,'Args':{'id':'xref'}},
|
215
|
+
"https://gedcom.io/terms/v7/record-SNOTE": {},
|
216
|
+
"https://gedcom.io/terms/v7/record-SOUR": {'type':'TopLevelObject','Object':SourceDescription,'Args':{'id':'xref'}},
|
217
|
+
"https://gedcom.io/terms/v7/record-SUBM": {'type':'Object','Object':Resource,'Args':{'Id':'xref'}},
|
218
|
+
}
|
219
|
+
|
gedcomx/URI.py
CHANGED
gedcomx/__init__.py
CHANGED
@@ -7,6 +7,7 @@ from .Date import Date
|
|
7
7
|
from .Document import Document
|
8
8
|
from .Document import DocumentType
|
9
9
|
from .EvidenceReference import EvidenceReference
|
10
|
+
from .ExtensibleEnum import ExtensibleEnum
|
10
11
|
from .Event import Event
|
11
12
|
from .Event import EventType
|
12
13
|
from .Event import EventRole
|
@@ -14,6 +15,7 @@ from .Fact import Fact
|
|
14
15
|
from .Fact import FactQualifier
|
15
16
|
from .Fact import FactType
|
16
17
|
from .Gedcom import Gedcom
|
18
|
+
from .Gedcom5x import Gedcom5x
|
17
19
|
from .GedcomX import GedcomX, Translater
|
18
20
|
from .Gender import Gender, GenderType
|
19
21
|
from .Group import Group, GroupRole
|
@@ -22,7 +24,7 @@ from .Logging import get_logger
|
|
22
24
|
from .Name import Name, NameForm, NamePart, NamePartType, NameType, NamePartQualifier
|
23
25
|
from .Note import Note
|
24
26
|
from .OnlineAccount import OnlineAccount
|
25
|
-
from .Person import Person
|
27
|
+
from .Person import Person, QuickPerson
|
26
28
|
from .PlaceDescription import PlaceDescription
|
27
29
|
from .PlaceReference import PlaceReference
|
28
30
|
from .Qualifier import Qualifier
|
@@ -37,5 +39,10 @@ from .TextValue import TextValue
|
|
37
39
|
from .Resource import Resource
|
38
40
|
from .URI import URI
|
39
41
|
|
42
|
+
from .Extensions.rs10.rsLink import rsLink
|
43
|
+
|
44
|
+
from .gedcom7 import Gedcom7, GedcomStructure
|
45
|
+
from .Translation import g7toXtable
|
46
|
+
|
40
47
|
|
41
48
|
|
@@ -1,17 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: gedcom-x
|
3
|
-
Version: 0.5.2
|
4
|
-
Summary: Python implimentation of gedcom-x standard
|
5
|
-
Author-email: "David J. Cartwright" <davidcartwright@hotmail.com>
|
6
|
-
License: MIT
|
7
|
-
Keywords: gedcom,gedcomx,ged
|
8
|
-
Classifier: Development Status :: 4 - Beta
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
10
|
-
Classifier: Environment :: Console
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
12
|
-
Classifier: Operating System :: OS Independent
|
13
|
-
Classifier: Topic :: Utilities
|
14
|
-
Classifier: Topic :: Software Development :: User Interfaces
|
15
|
-
Requires-Python: >=3.6
|
16
|
-
Description-Content-Type: text/markdown
|
17
|
-
Dynamic: requires-python
|
gedcom_x-0.5.2.dist-info/RECORD
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
gedcomx/Address.py,sha256=b_4X1w_FX6vPwpo4dVez7QlI5jn8w3dC0bWUlv_0IjM,4810
|
2
|
-
gedcomx/Agent.py,sha256=4o1Gi_l_QsEgLLZzvFZ4SNUvla0O01jzUBXPniNcQ1g,8304
|
3
|
-
gedcomx/Attribution.py,sha256=FVEjOiJorne1gxbL6CBwThC4CUfynVklpOsfVSO-pCg,3800
|
4
|
-
gedcomx/Conclusion.py,sha256=lpMGr_S-KdVAB5L0h9L1d0qZOMJZGeCy90YplB1F3i8,6490
|
5
|
-
gedcomx/Coverage.py,sha256=FuVsLDAhzS4HjNHKOHCjwQcvnxd4Uf_EeF3QcDEbems,912
|
6
|
-
gedcomx/Date.py,sha256=N6-gDOLLCT_3_5bhS_4REP25LzEnOJpE6hNlMaYqxMA,2216
|
7
|
-
gedcomx/Document.py,sha256=uSTEgtu1s8V_2IJaCxVS6A20Ho06FOUUZ7GWLeOmV8w,2231
|
8
|
-
gedcomx/Event.py,sha256=x2jpWu27WCaksvNAGzsJ499rsugcbJ1DVELc-rBnFXo,9563
|
9
|
-
gedcomx/EvidenceReference.py,sha256=WXZpmcKzwb3lYQmGVf-TY2IsbNG3fIInPY1khRjtOSg,348
|
10
|
-
gedcomx/Exceptions.py,sha256=fzYtJ8d9C3oN-NMl0VMBc3U6ED41yu23dN885-_9brI,383
|
11
|
-
gedcomx/Fact.py,sha256=emh3WsN-4mzSFXHt-3DffRLK9JPctG-PzRcrJkIcuao,24396
|
12
|
-
gedcomx/Gedcom.py,sha256=v7XM0x8VX77uPPe5T3vB8AIxDhV65evXXW_kvH_HtXo,14954
|
13
|
-
gedcomx/GedcomX.py,sha256=jaLLYA4J6k9jFOKfLeus0g0RWyKtmqycKkDrrp6iZLs,62456
|
14
|
-
gedcomx/Gender.py,sha256=SH7ZyjSQ2Vi9PEQKN0uTZrKOma79QO7a_dJ-2lpMp0c,3925
|
15
|
-
gedcomx/Group.py,sha256=VNI_cI_-YnJ9cHzwMmHD8qwDNMe89kEocPuQ67rwStA,1606
|
16
|
-
gedcomx/Identifier.py,sha256=PIk2NedDm9a3XHJiX_hHv17xYqVpR2OVEIrxPM7jV88,6617
|
17
|
-
gedcomx/Logging.py,sha256=vBDOjawVXc4tCge1laYjy6_2Ves-fnGzG0m6NnLZejE,624
|
18
|
-
gedcomx/Name.py,sha256=xQWdvtSjd6jr-OnG73oMqqz0zaCcy-R3ChJ5KYnNECc,12733
|
19
|
-
gedcomx/Note.py,sha256=cvV4-fCZ0oh2zXfzD-YYoIM_WTox-fk2_bfl3i4CoNc,2251
|
20
|
-
gedcomx/OnlineAccount.py,sha256=P24o98IXo_8XQoICYZPgALjdzS0q8t2l4DU3Od9KxyI,291
|
21
|
-
gedcomx/Person.py,sha256=IwCyxcbqdKxo0uN8O6R3FznES27ZSvM_kAIPcZwLoTg,9298
|
22
|
-
gedcomx/PlaceDescription.py,sha256=doU2sAMZQIpfTi-sKAeo_mCitUfOOgy_G5OrRJ8YjBk,2934
|
23
|
-
gedcomx/PlaceReference.py,sha256=ti7cFxKTd-1sTB5tGmPyTnYIxLZ7CF7_YCHbF9m-4K0,1137
|
24
|
-
gedcomx/Qualifier.py,sha256=mZ_GWT3gca8g9nWidlXIRTN5dEtf_rmnLHYl1jJkQYs,728
|
25
|
-
gedcomx/Relationship.py,sha256=2Ng6eNYHisusWUE-ufHfgGjU99dDBMx6ySRRsp3prnk,4959
|
26
|
-
gedcomx/Resource.py,sha256=iBymUXv1-2u6qVVKsS16NaU6I_pYFZpN9mDz2vVUzLY,1650
|
27
|
-
gedcomx/Serialization.py,sha256=wy-XRSM7Q9MyQ_dVP8gv8mwZ8a-bS7znSS-2DV6XOLU,2819
|
28
|
-
gedcomx/SourceCitation.py,sha256=aW-lEb7bT9QU49GiBjJppFMBvtisR6fhVVuXjr5y4vQ,742
|
29
|
-
gedcomx/SourceDescription.py,sha256=LBYp2s5WfH0jENYIog53OnnuzTPXwqjOy4CxsMT6Ud0,11883
|
30
|
-
gedcomx/SourceReference.py,sha256=rHq0aD8wkNFj1hlm2cwd-RQe1C5GosDLDwg6-8fl9VU,7571
|
31
|
-
gedcomx/Subject.py,sha256=1EqvKvudtZ8ky9QYFqQqAeaPzSsdWpAeeorvW05vxCM,3223
|
32
|
-
gedcomx/TextValue.py,sha256=6B0wMxL0nigFNzhXZDhbTONvFGbnM2t2NcDZiZuu4Zw,1112
|
33
|
-
gedcomx/TopLevelTypeCollection.py,sha256=nvTO6GwFwEZk9jX4fVqhy75ygsshomNb20tnlExKqyY,1495
|
34
|
-
gedcomx/URI.py,sha256=SSxp8QWdxgEmD4sOgfjBFWG3kqoDtWg0IHSTQXbfhU8,4230
|
35
|
-
gedcomx/Zip.py,sha256=lBxcv-Vip45884EHj56wZJJ5I36Q38UuHUidDxQBoS8,14
|
36
|
-
gedcomx/_Links.py,sha256=--7d7PA80EeKCLtDOGOMp8QjLB679qnmVmHHakucEoo,972
|
37
|
-
gedcomx/__init__.py,sha256=Bv5g_0UT2dHfzpD4k-AuVDfUgbJHqj5ee16ExFvQxXs,1439
|
38
|
-
gedcomx/g7interop.py,sha256=KO4EQrvoGBSEPzLkWtO7E8-oZHmzL-q-_QRLQjhUNo4,9944
|
39
|
-
gedcom_x-0.5.2.dist-info/METADATA,sha256=4GZGTw_sws2qevHyOPaFE6WuPmz8C-PWWNIXg42DCLY,633
|
40
|
-
gedcom_x-0.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
41
|
-
gedcom_x-0.5.2.dist-info/top_level.txt,sha256=smVBF4nxSU-mzCd6idtRYTbYjPICMMi8pTqewEmqF8Y,8
|
42
|
-
gedcom_x-0.5.2.dist-info/RECORD,,
|
gedcomx/_Links.py
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
from typing import List, Optional
|
2
|
-
|
3
|
-
class _Link():
|
4
|
-
def __init__(self,category: str, key_val_pairs: dict) -> None:
|
5
|
-
self._category = category
|
6
|
-
self._kvps: dict = key_val_pairs if key_val_pairs else {}
|
7
|
-
|
8
|
-
def _add_kvp(self, key, value):
|
9
|
-
pass
|
10
|
-
|
11
|
-
class _LinkList():
|
12
|
-
def __init__(self) -> None:
|
13
|
-
self.links = {}
|
14
|
-
|
15
|
-
def add(self,link: _Link):
|
16
|
-
if link and isinstance(link,_Link):
|
17
|
-
if link._category in self.links.keys():
|
18
|
-
self.links[link._category].append(link._kvps)
|
19
|
-
else:
|
20
|
-
self.links[link._category] = [link._kvps]
|
21
|
-
|
22
|
-
|
23
|
-
@classmethod
|
24
|
-
def _from_json_(cls,data: dict):
|
25
|
-
|
26
|
-
link_list = _LinkList()
|
27
|
-
for category in data.keys():
|
28
|
-
link_list.add(_Link(category,data[category]))
|
29
|
-
|
30
|
-
return link_list
|
31
|
-
|
32
|
-
@property
|
33
|
-
def _as_dict_(self) -> dict:
|
34
|
-
return self.links
|
35
|
-
|
36
|
-
|
37
|
-
|