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.
Files changed (54) hide show
  1. {gedcom_x-0.5.7.dist-info → gedcom_x-0.5.8.dist-info}/METADATA +1 -1
  2. gedcom_x-0.5.8.dist-info/RECORD +56 -0
  3. gedcomx/Extensions/rs10/rsLink.py +3 -3
  4. gedcomx/TopLevelTypeCollection.py +1 -1
  5. gedcomx/__init__.py +43 -42
  6. gedcomx/{Address.py → address.py} +1 -1
  7. gedcomx/{Agent.py → agent.py} +32 -16
  8. gedcomx/{Attribution.py → attribution.py} +3 -3
  9. gedcomx/{Conclusion.py → conclusion.py} +26 -9
  10. gedcomx/{Converter.py → converter.py} +54 -39
  11. gedcomx/{Coverage.py → coverage.py} +23 -5
  12. gedcomx/{Date.py → date.py} +1 -1
  13. gedcomx/{Document.py → document.py} +26 -8
  14. gedcomx/{Event.py → event.py} +13 -13
  15. gedcomx/{EvidenceReference.py → evidence_reference.py} +2 -2
  16. gedcomx/{Fact.py → fact.py} +31 -23
  17. gedcomx/{Gedcom5x.py → gedcom5x.py} +1 -1
  18. gedcomx/gedcom7/Exceptions.py +9 -0
  19. gedcomx/gedcom7/Gedcom7.py +160 -0
  20. gedcomx/gedcom7/GedcomStructure.py +94 -0
  21. gedcomx/gedcom7/Specification.py +347 -0
  22. gedcomx/gedcom7/__init__.py +26 -0
  23. gedcomx/gedcom7/g7interop.py +205 -0
  24. gedcomx/gedcom7/logger.py +19 -0
  25. gedcomx/{GedcomX.py → gedcomx.py} +14 -13
  26. gedcomx/{Gender.py → gender.py} +25 -11
  27. gedcomx/group.py +63 -0
  28. gedcomx/{Identifier.py → identifier.py} +4 -4
  29. gedcomx/{Mutations.py → mutations.py} +49 -25
  30. gedcomx/{Name.py → name.py} +15 -15
  31. gedcomx/{Note.py → note.py} +2 -2
  32. gedcomx/{OnlineAccount.py → online_account.py} +1 -1
  33. gedcomx/{Person.py → person.py} +18 -16
  34. gedcomx/{PlaceDescription.py → place_description.py} +18 -16
  35. gedcomx/{PlaceReference.py → place_reference.py} +4 -4
  36. gedcomx/{Qualifier.py → qualifier.py} +1 -1
  37. gedcomx/{Relationship.py → relationship.py} +30 -12
  38. gedcomx/{Resource.py → resource.py} +2 -2
  39. gedcomx/{Serialization.py → serialization.py} +31 -32
  40. gedcomx/{SourceDescription.py → source_description.py} +16 -16
  41. gedcomx/{SourceReference.py → source_reference.py} +7 -7
  42. gedcomx/{Subject.py → subject.py} +26 -8
  43. gedcomx/{Translation.py → translation.py} +1 -1
  44. gedcomx/{URI.py → uri.py} +42 -26
  45. gedcom_x-0.5.7.dist-info/RECORD +0 -49
  46. gedcomx/Group.py +0 -37
  47. {gedcom_x-0.5.7.dist-info → gedcom_x-0.5.8.dist-info}/WHEEL +0 -0
  48. {gedcom_x-0.5.7.dist-info → gedcom_x-0.5.8.dist-info}/top_level.txt +0 -0
  49. /gedcomx/{Exceptions.py → exceptions.py} +0 -0
  50. /gedcomx/{ExtensibleEnum.py → extensible_enum.py} +0 -0
  51. /gedcomx/{Gedcom.py → gedcom.py} +0 -0
  52. /gedcomx/{LoggingHub.py → logging_hub.py} +0 -0
  53. /gedcomx/{SourceCitation.py → source_citation.py} +0 -0
  54. /gedcomx/{TextValue.py → textvalue.py} +0 -0
@@ -0,0 +1,347 @@
1
+ import json
2
+ from typing import Dict, Any
3
+ import os
4
+
5
+ def load_spec(file_path: str) -> Dict[str, Any]:
6
+ """
7
+ Load the JSON spec file into a Python dict.
8
+
9
+ :param file_path: Path to your spec.json
10
+ :return: A dict mapping each URI to its structure-definition dict.
11
+ """
12
+ with open(file_path, "r", encoding="utf-8") as f:
13
+ return json.load(f)
14
+
15
+ SPEC_PATH = os.path.join(os.path.dirname(__file__), "spec.json")
16
+ structure_specs = load_spec(SPEC_PATH)
17
+
18
+ def get_substructures(key: str) -> Dict[str, Any]:
19
+ """
20
+ Return the 'substructures' dict for the given key.
21
+ """
22
+ struct = structure_specs.get(key)
23
+ if struct is None:
24
+ return {}
25
+ raise KeyError(f"No entry for key {key!r} in spec.json")
26
+ return struct.get("substructures", {})
27
+
28
+ def get_label(key: str) -> Dict[str, Any]:
29
+ """
30
+ Return the label for the given key.
31
+ """
32
+ struct = structure_specs.get(key)
33
+ if struct is None:
34
+ raise KeyError(f"No entry for key {key!r} in spec.json")
35
+ return 'None'
36
+
37
+ return struct.get("label", 'No Label')
38
+
39
+ def match_uri(tag: str,parent):
40
+ uri = None
41
+ if tag.startswith("_"):
42
+ uri = structure_specs.get(tag)
43
+ elif parent:
44
+ valid_substrutures = get_substructures(parent.uri)
45
+ uri = valid_substrutures.get(tag)
46
+ elif 'https://gedcom.io/terms/v7/record-' + tag in structure_specs.keys():
47
+ uri = 'https://gedcom.io/terms/v7/record-' + tag
48
+ elif 'https://gedcom.io/terms/v7/' + tag in structure_specs.keys():
49
+ uri = 'https://gedcom.io/terms/v7/' + tag
50
+ if uri == None:
51
+ raise ValueError(f'Could not get uri for tag: {tag}, parent: {parent}')
52
+ return uri
53
+
54
+ '''
55
+ MIT License
56
+
57
+ Copyright (c) 2022 David Straub
58
+
59
+ Permission is hereby granted, free of charge, to any person obtaining a copy
60
+ of this software and associated documentation files (the "Software"), to deal
61
+ in the Software without restriction, including without limitation the rights
62
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
63
+ copies of the Software, and to permit persons to whom the Software is
64
+ furnished to do so, subject to the following conditions:
65
+
66
+ The above copyright notice and this permission notice shall be included in all
67
+ copies or substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75
+ SOFTWARE.
76
+ '''
77
+ # TODO: https://github.com/DavidMStraub
78
+
79
+ # GEDCOM 7 regex patterns thanks@DavidMStraub
80
+
81
+ # --- Common primitives ---
82
+ d = '\\ ' # GEDCOM delimiter (escaped space)
83
+ integer = '[0-9]+' # One or more digits
84
+ nonzero = '[1-9]' # Digits 1–9
85
+
86
+ # --- Duration units ---
87
+ years = f'{integer}y'
88
+ months = f'{integer}m'
89
+ weeks = f'{integer}w'
90
+ days = f'{integer}d'
91
+
92
+ # --- Age format ---
93
+ agebound = '[<>]' # Optional boundary indicator (less than, greater than)
94
+ ageduration = (
95
+ f'((?P<years>{years})({d}(?P<months1>{months}))?({d}(?P<weeks1>{weeks}))?'
96
+ f'({d}(?P<days1>{days}))?|(?P<months2>{months})({d}(?P<weeks2>{weeks}))?'
97
+ f'({d}(?P<days2>{days}))?|(?P<weeks3>{weeks})({d}(?P<days3>{days}))?|'
98
+ f'(?P<days4>{days}))'
99
+ )
100
+ age = f'((?P<agebound>{agebound}){d})?{ageduration}'
101
+
102
+ # --- Tags and Enums ---
103
+ underscore = '_'
104
+ ucletter = '[A-Z]'
105
+ tagchar = f'({ucletter}|[0-9]|{underscore})'
106
+ exttag = f'{underscore}({tagchar})+'
107
+ stdtag = f'{ucletter}({tagchar})*'
108
+ tag = f'({stdtag}|{exttag})'
109
+ enum = tag
110
+
111
+ # --- Dates ---
112
+ daterestrict = 'FROM|TO|BET|AND|BEF|AFT|ABT|CAL|EST'
113
+ calendar = f'(?!{daterestrict})(GREGORIAN|JULIAN|FRENCH_R|HEBREW|{exttag})'
114
+ day = integer
115
+ month = f'(?!{daterestrict})({stdtag}|{exttag})'
116
+ year = integer
117
+ epoch = f'(?!{daterestrict})(BCE|{exttag})'
118
+
119
+ date = f'({calendar}{d})?(({day}{d})?{month}{d})?{year}({d}{epoch})?'
120
+
121
+ # --- Date variants with captures ---
122
+ date_capture = (
123
+ f'((?P<calendar>{calendar}){d})?(((?P<day>{day}){d})?'
124
+ f'(?P<month>{month}){d})?(?P<year>{year})({d}(?P<epoch>{epoch}))?'
125
+ )
126
+
127
+ dateapprox = f'(?P<qualifier>ABT|CAL|EST){d}(?P<dateapprox>{date})'
128
+ dateexact = f'(?P<day>{day}){d}(?P<month>{month}){d}(?P<year>{year})'
129
+ dateperiod = f'((TO{d}(?P<todate1>{date}))?|FROM{d}(?P<fromdate>{date})({d}TO{d}(?P<todate2>{date}))?)'
130
+ daterange = f'(BET{d}(?P<between>{date}){d}AND{d}(?P<and>{date})|AFT{d}(?P<after>{date})|BEF{d}(?P<before>{date}))'
131
+ datevalue = f'({date}|{dateperiod}|{daterange}|{dateapprox})?'
132
+
133
+ # --- Media types ---
134
+ mt_char = "[ -!#-'*-+\\--.0-9A-Z^-~]"
135
+ mt_token = f'({mt_char})+'
136
+ mt_type = mt_token
137
+ mt_subtype = mt_token
138
+ mt_attribute = mt_token
139
+ mt_qtext = '[\t-\n -!#-\\[\\]-~]'
140
+ mt_qpair = '\\\\[\t-~]'
141
+ mt_qstring = f'"({mt_qtext}|{mt_qpair})*"'
142
+ mt_value = f'({mt_token}|{mt_qstring})'
143
+ mt_parameter = f'{mt_attribute}={mt_value}'
144
+ mediatype = f'{mt_type}/{mt_subtype}(;{mt_parameter})*'
145
+
146
+ # --- Line structure (GEDCOM record lines) ---
147
+ atsign = '@'
148
+ xref = f'{atsign}({tagchar})+{atsign}'
149
+ voidptr = '@VOID@'
150
+ pointer = f'(?P<pointer>{voidptr}|{xref})'
151
+ nonat = '[\t -?A-\\U0010ffff]'
152
+ noneol = '[\t -\\U0010ffff]'
153
+ linestr = f'(?P<linestr>({nonat}|{atsign}{atsign})({noneol})*)'
154
+ lineval = f'({pointer}|{linestr})'
155
+
156
+ level = f'(?P<level>0|{nonzero}[0-9]*)'
157
+ eol = '(\\\r(\\\n)?|\\\n)'
158
+ line = f'{level}{d}((?P<xref>{xref}){d})?(?P<tag>{tag})({d}{lineval})?{eol}'
159
+
160
+ # --- List formats ---
161
+ nocommasp = '[\t-\\x1d!-+\\--\\U0010ffff]'
162
+ nocomma = '[\t-+\\--\\U0010ffff]'
163
+ listitem = f'({nocommasp}|{nocommasp}({nocomma})*{nocommasp})?'
164
+ listdelim = f'({d})*,({d})*'
165
+ list = f'{listitem}({listdelim}{listitem})*'
166
+ list_enum = f'{enum}({listdelim}{enum})*'
167
+ list_text = list
168
+
169
+ # --- Names ---
170
+ namechar = '[ -.0-\\U0010ffff]'
171
+ namestr = f'({namechar})+'
172
+ personalname = f'({namestr}|({namestr})?/(?P<surname>{namestr})?/({namestr})?)'
173
+
174
+ # --- Time format ---
175
+ fraction = '[0-9]+'
176
+ second = '[012345][0-9]'
177
+ minute = '[012345][0-9]'
178
+ hour = '([0-9]|[01][0-9]|2[0123])'
179
+ time = f'(?P<hour>{hour}):(?P<minute>{minute})(:(?P<second>{second})(\\.(?P<fraction>{fraction}))?)?(?P<tz>Z)?'
180
+
181
+ # --- Text and special ---
182
+ anychar = '[\t-\\U0010ffff]'
183
+ text = f'({anychar})*'
184
+ special = text
185
+
186
+ # --- Boolean ---
187
+ boolean = 'Y'
188
+
189
+ # --- Banned Unicode Ranges ---
190
+ '''
191
+ banned = %x00-08 / %x0B-0C / %x0E-1F ; C0 other than LF CR and Tab
192
+ / %x7F ; DEL
193
+ / %x80-9F ; C1
194
+ / %xD800-DFFF ; Surrogates
195
+ / %xFFFE-FFFF ; invalid
196
+ ; All other rules assume the absence of any banned characters
197
+ '''
198
+ banned = (
199
+ '[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f\\x7f\\x80-\\x9f\\ud800-\\udfff'
200
+ '\\ufffe-\\uffff]'
201
+ )
202
+
203
+
204
+
205
+
206
+ # TAGS
207
+ CONT = "CONT"
208
+ HEAD = "HEAD"
209
+ ABBR = "ABBR"
210
+ ADDR = "ADDR"
211
+ ADOP = "ADOP"
212
+ ADR1 = "ADR1"
213
+ ADR2 = "ADR2"
214
+ ADR3 = "ADR3"
215
+ AGE = "AGE"
216
+ AGNC = "AGNC"
217
+ ALIA = "ALIA"
218
+ ANCI = "ANCI"
219
+ ANUL = "ANUL"
220
+ ASSO = "ASSO"
221
+ AUTH = "AUTH"
222
+ BAPL = "BAPL"
223
+ BAPM = "BAPM"
224
+ BARM = "BARM"
225
+ BASM = "BASM"
226
+ BIRT = "BIRT"
227
+ BLES = "BLES"
228
+ BURI = "BURI"
229
+ CALN = "CALN"
230
+ CAST = "CAST"
231
+ CAUS = "CAUS"
232
+ CENS = "CENS"
233
+ CHAN = "CHAN"
234
+ CHIL = "CHIL"
235
+ CHR = "CHR"
236
+ CHRA = "CHRA"
237
+ CITY = "CITY"
238
+ CONF = "CONF"
239
+ CONL = "CONL"
240
+ COPR = "COPR"
241
+ CORP = "CORP"
242
+ CREA = "CREA"
243
+ CREM = "CREM"
244
+ CROP = "CROP"
245
+ CTRY = "CTRY"
246
+ DATA = "DATA"
247
+ DATE = "DATE"
248
+ DEAT = "DEAT"
249
+ DESI = "DESI"
250
+ DEST = "DEST"
251
+ DIV = "DIV"
252
+ DIVF = "DIVF"
253
+ DSCR = "DSCR"
254
+ EDUC = "EDUC"
255
+ EMAIL = "EMAIL"
256
+ EMIG = "EMIG"
257
+ ENDL = "ENDL"
258
+ ENGA = "ENGA"
259
+ EVEN = "EVEN"
260
+ EXID = "EXID"
261
+ FACT = "FACT"
262
+ FAM = "FAM"
263
+ FAMC = "FAMC"
264
+ FAMS = "FAMS"
265
+ FAX = "FAX"
266
+ FCOM = "FCOM"
267
+ FILE = "FILE"
268
+ FORM = "FORM"
269
+ GEDC = "GEDC"
270
+ GIVN = "GIVN"
271
+ GRAD = "GRAD"
272
+ HEIGHT = "HEIGHT"
273
+ HUSB = "HUSB"
274
+ IDNO = "IDNO"
275
+ IMMI = "IMMI"
276
+ INDI = "INDI"
277
+ INIL = "INIL"
278
+ LANG = "LANG"
279
+ LATI = "LATI"
280
+ LEFT = "LEFT"
281
+ LONG = "LONG"
282
+ MAP = "MAP"
283
+ MARB = "MARB"
284
+ MARC = "MARC"
285
+ MARL = "MARL"
286
+ MARR = "MARR"
287
+ MARS = "MARS"
288
+ MEDI = "MEDI"
289
+ MIME = "MIME"
290
+ NAME = "NAME"
291
+ NATI = "NATI"
292
+ NATU = "NATU"
293
+ NCHI = "NCHI"
294
+ NICK = "NICK"
295
+ NMR = "NMR"
296
+ NO = "NO"
297
+ NOTE = "NOTE"
298
+ NPFX = "NPFX"
299
+ NSFX = "NSFX"
300
+ OBJE = "OBJE"
301
+ OCCU = "OCCU"
302
+ ORDN = "ORDN"
303
+ PAGE = "PAGE"
304
+ PEDI = "PEDI"
305
+ PHON = "PHON"
306
+ PHRASE = "PHRASE"
307
+ PLAC = "PLAC"
308
+ POST = "POST"
309
+ PROB = "PROB"
310
+ PROP = "PROP"
311
+ PUBL = "PUBL"
312
+ QUAY = "QUAY"
313
+ REFN = "REFN"
314
+ RELI = "RELI"
315
+ REPO = "REPO"
316
+ RESI = "RESI"
317
+ RESN = "RESN"
318
+ RETI = "RETI"
319
+ ROLE = "ROLE"
320
+ SCHMA = "SCHMA"
321
+ SDATE = "SDATE"
322
+ SEX = "SEX"
323
+ SLGC = "SLGC"
324
+ SLGS = "SLGS"
325
+ SNOTE = "SNOTE"
326
+ SOUR = "SOUR"
327
+ SPFX = "SPFX"
328
+ SSN = "SSN"
329
+ STAE = "STAE"
330
+ STAT = "STAT"
331
+ SUBM = "SUBM"
332
+ SURN = "SURN"
333
+ TAG = "TAG"
334
+ TEMP = "TEMP"
335
+ TEXT = "TEXT"
336
+ TIME = "TIME"
337
+ TITL = "TITL"
338
+ TOP = "TOP"
339
+ TRAN = "TRAN"
340
+ TRLR = "TRLR"
341
+ TYPE = "TYPE"
342
+ UID = "UID"
343
+ VERS = "VERS"
344
+ WIDTH = "WIDTH"
345
+ WIFE = "WIFE"
346
+ WILL = "WILL"
347
+ WWW = "WWW"
@@ -0,0 +1,26 @@
1
+
2
+
3
+ """
4
+ ======================================================================
5
+ Project: Gedcom-X
6
+ File: __init__.py
7
+ Author: David J. Cartwright
8
+ Purpose:
9
+
10
+ Created: 2025-08-25
11
+ Updated:
12
+ - 2025-09-01 added __all__ = ["Gedcom7"]
13
+
14
+ ======================================================================
15
+ """
16
+
17
+ """
18
+ ======================================================================
19
+ GEDCOM Module Types
20
+ ======================================================================
21
+ """
22
+ from .GedcomStructure import GedcomStructure
23
+ from .logger import get_logger
24
+ from .Specification import structure_specs
25
+ from .Gedcom7 import Gedcom7
26
+ __all__ = ["Gedcom7"]
@@ -0,0 +1,205 @@
1
+ from .. import *
2
+
3
+ g7toX = {
4
+ "ABBR": "https://gedcom.io/terms/v7/ABBR",
5
+ "ADDR": "https://gedcom.io/terms/v7/ADDR",
6
+ "ADOP": "https://gedcom.io/terms/v7/ADOP",
7
+ "ADOP-FAMC": "https://gedcom.io/terms/v7/ADOP-FAMC",
8
+ "ADR1": "https://gedcom.io/terms/v7/ADR1",
9
+ "ADR2": "https://gedcom.io/terms/v7/ADR2",
10
+ "ADR3": "https://gedcom.io/terms/v7/ADR3",
11
+ "AGE": "https://gedcom.io/terms/v7/AGE",
12
+ "AGNC": "https://gedcom.io/terms/v7/AGNC",
13
+ "ALIA": "https://gedcom.io/terms/v7/ALIA",
14
+ "ANCI": "https://gedcom.io/terms/v7/ANCI",
15
+ "ANUL": "https://gedcom.io/terms/v7/ANUL",
16
+ "ASSO": "https://gedcom.io/terms/v7/ASSO",
17
+ "AUTH": "https://gedcom.io/terms/v7/AUTH",
18
+ "BAPL": "https://gedcom.io/terms/v7/BAPL",
19
+ "BAPM": "https://gedcom.io/terms/v7/BAPM",
20
+ "BARM": "https://gedcom.io/terms/v7/BARM",
21
+ "BASM": "https://gedcom.io/terms/v7/BASM",
22
+ "BIRT": "https://gedcom.io/terms/v7/BIRT",
23
+ "BLES": "https://gedcom.io/terms/v7/BLES",
24
+ "BURI": "https://gedcom.io/terms/v7/BURI",
25
+ "CALN": "https://gedcom.io/terms/v7/CALN",
26
+ "CAST": "https://gedcom.io/terms/v7/CAST",
27
+ "CAUS": "https://gedcom.io/terms/v7/CAUS",
28
+ "CENS": "https://gedcom.io/terms/v7/CENS",
29
+ "CHAN": "https://gedcom.io/terms/v7/CHAN",
30
+ "CHIL": "https://gedcom.io/terms/v7/CHIL",
31
+ "CHR": "https://gedcom.io/terms/v7/CHR",
32
+ "CHRA": "https://gedcom.io/terms/v7/CHRA",
33
+ "CITY": "https://gedcom.io/terms/v7/CITY",
34
+ "CONF": "https://gedcom.io/terms/v7/CONF",
35
+ "CONL": "https://gedcom.io/terms/v7/CONL",
36
+ "CONT": "https://gedcom.io/terms/v7/CONT",
37
+ "COPR": "https://gedcom.io/terms/v7/COPR",
38
+ "CORP": "https://gedcom.io/terms/v7/CORP",
39
+ "CREA": "https://gedcom.io/terms/v7/CREA",
40
+ "CREM": "https://gedcom.io/terms/v7/CREM",
41
+ "CROP": "https://gedcom.io/terms/v7/CROP",
42
+ "CTRY": "https://gedcom.io/terms/v7/CTRY",
43
+ "DATA": "https://gedcom.io/terms/v7/DATA",
44
+ "DATA-EVEN": "https://gedcom.io/terms/v7/DATA-EVEN",
45
+ "DATA-EVEN-DATE": "https://gedcom.io/terms/v7/DATA-EVEN-DATE",
46
+ "DATE": "https://gedcom.io/terms/v7/DATE",
47
+ "DATE-exact": "https://gedcom.io/terms/v7/DATE-exact",
48
+ "DEAT": "https://gedcom.io/terms/v7/DEAT",
49
+ "DESI": "https://gedcom.io/terms/v7/DESI",
50
+ "DEST": "https://gedcom.io/terms/v7/DEST",
51
+ "DIV": "https://gedcom.io/terms/v7/DIV",
52
+ "DIVF": "https://gedcom.io/terms/v7/DIVF",
53
+ "DSCR": "https://gedcom.io/terms/v7/DSCR",
54
+ "EDUC": "https://gedcom.io/terms/v7/EDUC",
55
+ "EMAIL": "https://gedcom.io/terms/v7/EMAIL",
56
+ "EMIG": "https://gedcom.io/terms/v7/EMIG",
57
+ "ENDL": "https://gedcom.io/terms/v7/ENDL",
58
+ "ENGA": "https://gedcom.io/terms/v7/ENGA",
59
+ "EVEN": "https://gedcom.io/terms/v7/EVEN",
60
+ "EXID": "https://gedcom.io/terms/v7/EXID",
61
+ "EXID-TYPE": "https://gedcom.io/terms/v7/EXID-TYPE",
62
+ "FACT": "https://gedcom.io/terms/v7/FACT",
63
+ "FAM": "https://gedcom.io/terms/v7/FAM",
64
+ "FAM-CENS": "https://gedcom.io/terms/v7/FAM-CENS",
65
+ "FAM-EVEN": "https://gedcom.io/terms/v7/FAM-EVEN",
66
+ "FAM-FACT": "https://gedcom.io/terms/v7/FAM-FACT",
67
+ "FAM-HUSB": "https://gedcom.io/terms/v7/FAM-HUSB",
68
+ "FAM-NCHI": "https://gedcom.io/terms/v7/FAM-NCHI",
69
+ "FAM-RESI": "https://gedcom.io/terms/v7/FAM-RESI",
70
+ "FAM-WIFE": "https://gedcom.io/terms/v7/FAM-WIFE",
71
+ "FAMC": "https://gedcom.io/terms/v7/FAMC",
72
+ "FAMC-ADOP": "https://gedcom.io/terms/v7/FAMC-ADOP",
73
+ "FAMC-STAT": "https://gedcom.io/terms/v7/FAMC-STAT",
74
+ "FAMS": "https://gedcom.io/terms/v7/FAMS",
75
+ "FAX": "https://gedcom.io/terms/v7/FAX",
76
+ "FCOM": "https://gedcom.io/terms/v7/FCOM",
77
+ "FILE": "https://gedcom.io/terms/v7/FILE",
78
+ "FILE-TRAN": "https://gedcom.io/terms/v7/FILE-TRAN",
79
+ "FORM": "https://gedcom.io/terms/v7/FORM",
80
+ "GEDC": "https://gedcom.io/terms/v7/GEDC",
81
+ "GEDC-VERS": "https://gedcom.io/terms/v7/GEDC-VERS",
82
+ "GIVN": "https://gedcom.io/terms/v7/GIVN",
83
+ "GRAD": "https://gedcom.io/terms/v7/GRAD",
84
+ "HEAD": "https://gedcom.io/terms/v7/HEAD",
85
+ "HEAD-DATE": "https://gedcom.io/terms/v7/HEAD-DATE",
86
+ "HEAD-LANG": "https://gedcom.io/terms/v7/HEAD-LANG",
87
+ "HEAD-PLAC": "https://gedcom.io/terms/v7/HEAD-PLAC",
88
+ "HEAD-PLAC-FORM": "https://gedcom.io/terms/v7/HEAD-PLAC-FORM",
89
+ "HEAD-SOUR": "https://gedcom.io/terms/v7/HEAD-SOUR",
90
+ "HEAD-SOUR-DATA": "https://gedcom.io/terms/v7/HEAD-SOUR-DATA",
91
+ "HEIGHT": "https://gedcom.io/terms/v7/HEIGHT",
92
+ "HUSB": "https://gedcom.io/terms/v7/HUSB",
93
+ "IDNO": "https://gedcom.io/terms/v7/IDNO",
94
+ "IMMI": "https://gedcom.io/terms/v7/IMMI",
95
+ "INDI": "https://gedcom.io/terms/v7/INDI",
96
+ "INDI-CENS": "https://gedcom.io/terms/v7/INDI-CENS",
97
+ "INDI-EVEN": "https://gedcom.io/terms/v7/INDI-EVEN",
98
+ "INDI-FACT": "https://gedcom.io/terms/v7/INDI-FACT",
99
+ "INDI-FAMC": "https://gedcom.io/terms/v7/INDI-FAMC",
100
+ "INDI-NAME": "https://gedcom.io/terms/v7/INDI-NAME",
101
+ "INDI-NCHI": "https://gedcom.io/terms/v7/INDI-NCHI",
102
+ "INDI-RELI": "https://gedcom.io/terms/v7/INDI-RELI",
103
+ "INDI-RESI": "https://gedcom.io/terms/v7/INDI-RESI",
104
+ "INDI-TITL": "https://gedcom.io/terms/v7/INDI-TITL",
105
+ "INIL": "https://gedcom.io/terms/v7/INIL",
106
+ "LANG": "https://gedcom.io/terms/v7/LANG",
107
+ "LATI": "https://gedcom.io/terms/v7/LATI",
108
+ "LEFT": "https://gedcom.io/terms/v7/LEFT",
109
+ "LONG": "https://gedcom.io/terms/v7/LONG",
110
+ "MAP": "https://gedcom.io/terms/v7/MAP",
111
+ "MARB": "https://gedcom.io/terms/v7/MARB",
112
+ "MARC": "https://gedcom.io/terms/v7/MARC",
113
+ "MARL": "https://gedcom.io/terms/v7/MARL",
114
+ "MARR": "https://gedcom.io/terms/v7/MARR",
115
+ "MARS": "https://gedcom.io/terms/v7/MARS",
116
+ "MEDI": "https://gedcom.io/terms/v7/MEDI",
117
+ "MIME": "https://gedcom.io/terms/v7/MIME",
118
+ "NAME": "https://gedcom.io/terms/v7/NAME",
119
+ "NAME-TRAN": "https://gedcom.io/terms/v7/NAME-TRAN",
120
+ "NAME-TYPE": "https://gedcom.io/terms/v7/NAME-TYPE",
121
+ "NATI": "https://gedcom.io/terms/v7/NATI",
122
+ "NATU": "https://gedcom.io/terms/v7/NATU",
123
+ "NCHI": "https://gedcom.io/terms/v7/NCHI",
124
+ "NICK": "https://gedcom.io/terms/v7/NICK",
125
+ "NMR": "https://gedcom.io/terms/v7/NMR",
126
+ "NO": "https://gedcom.io/terms/v7/NO",
127
+ "NO-DATE": "https://gedcom.io/terms/v7/NO-DATE",
128
+ "NOTE": "https://gedcom.io/terms/v7/NOTE",
129
+ "NOTE-TRAN": "https://gedcom.io/terms/v7/NOTE-TRAN",
130
+ "NPFX": "https://gedcom.io/terms/v7/NPFX",
131
+ "NSFX": "https://gedcom.io/terms/v7/NSFX",
132
+ "OBJE": "https://gedcom.io/terms/v7/OBJE",
133
+ "OCCU": "https://gedcom.io/terms/v7/OCCU",
134
+ "ORDN": "https://gedcom.io/terms/v7/ORDN",
135
+ "PAGE": "https://gedcom.io/terms/v7/PAGE",
136
+ "PEDI": "https://gedcom.io/terms/v7/PEDI",
137
+ "PHON": "https://gedcom.io/terms/v7/PHON",
138
+ "PHRASE": "https://gedcom.io/terms/v7/PHRASE",
139
+ "PLAC": "https://gedcom.io/terms/v7/PLAC",
140
+ "PLAC-FORM": "https://gedcom.io/terms/v7/PLAC-FORM",
141
+ "PLAC-TRAN": "https://gedcom.io/terms/v7/PLAC-TRAN",
142
+ "POST": "https://gedcom.io/terms/v7/POST",
143
+ "PROB": "https://gedcom.io/terms/v7/PROB",
144
+ "PROP": "https://gedcom.io/terms/v7/PROP",
145
+ "PUBL": "https://gedcom.io/terms/v7/PUBL",
146
+ "QUAY": "https://gedcom.io/terms/v7/QUAY",
147
+ "REFN": "https://gedcom.io/terms/v7/REFN",
148
+ "RELI": "https://gedcom.io/terms/v7/RELI",
149
+ "REPO": "https://gedcom.io/terms/v7/REPO",
150
+ "RESI": "https://gedcom.io/terms/v7/RESI",
151
+ "RESN": "https://gedcom.io/terms/v7/RESN",
152
+ "RETI": "https://gedcom.io/terms/v7/RETI",
153
+ "ROLE": "https://gedcom.io/terms/v7/ROLE",
154
+ "SCHMA": "https://gedcom.io/terms/v7/SCHMA",
155
+ "SDATE": "https://gedcom.io/terms/v7/SDATE",
156
+ "SEX": "https://gedcom.io/terms/v7/SEX",
157
+ "SLGC": "https://gedcom.io/terms/v7/SLGC",
158
+ "SLGS": "https://gedcom.io/terms/v7/SLGS",
159
+ "SNOTE": "https://gedcom.io/terms/v7/SNOTE",
160
+ "SOUR": "https://gedcom.io/terms/v7/SOUR",
161
+ "SOUR-DATA": "https://gedcom.io/terms/v7/SOUR-DATA",
162
+ "SOUR-EVEN": "https://gedcom.io/terms/v7/SOUR-EVEN",
163
+ "SPFX": "https://gedcom.io/terms/v7/SPFX",
164
+ "SSN": "https://gedcom.io/terms/v7/SSN",
165
+ "STAE": "https://gedcom.io/terms/v7/STAE",
166
+ "STAT": "https://gedcom.io/terms/v7/STAT",
167
+ "SUBM": "https://gedcom.io/terms/v7/SUBM",
168
+ "SUBM-LANG": "https://gedcom.io/terms/v7/SUBM-LANG",
169
+ "SURN": "https://gedcom.io/terms/v7/SURN",
170
+ "TAG": "https://gedcom.io/terms/v7/TAG",
171
+ "TEMP": "https://gedcom.io/terms/v7/TEMP",
172
+ "TEXT": "https://gedcom.io/terms/v7/TEXT",
173
+ "TIME": "https://gedcom.io/terms/v7/TIME",
174
+ "TITL": "https://gedcom.io/terms/v7/TITL",
175
+ "TOP": "https://gedcom.io/terms/v7/TOP",
176
+ "TRAN": "https://gedcom.io/terms/v7/TRAN",
177
+ "TRLR": "https://gedcom.io/terms/v7/TRLR",
178
+ "TYPE": "https://gedcom.io/terms/v7/TYPE",
179
+ "UID": "https://gedcom.io/terms/v7/UID",
180
+ "VERS": "https://gedcom.io/terms/v7/VERS",
181
+ "WIDTH": "https://gedcom.io/terms/v7/WIDTH",
182
+ "WIFE": "https://gedcom.io/terms/v7/WIFE",
183
+ "WILL": "https://gedcom.io/terms/v7/WILL",
184
+ "WWW": "https://gedcom.io/terms/v7/WWW",
185
+ "enumset-ADOP": "https://gedcom.io/terms/v7/enumset-ADOP",
186
+ "enumset-EVEN": "https://gedcom.io/terms/v7/enumset-EVEN",
187
+ "enumset-EVENATTR": "https://gedcom.io/terms/v7/enumset-EVENATTR",
188
+ "enumset-FAMC-STAT": "https://gedcom.io/terms/v7/enumset-FAMC-STAT",
189
+ "enumset-MEDI": "https://gedcom.io/terms/v7/enumset-MEDI",
190
+ "enumset-NAME-TYPE": "https://gedcom.io/terms/v7/enumset-NAME-TYPE",
191
+ "enumset-PEDI": "https://gedcom.io/terms/v7/enumset-PEDI",
192
+ "enumset-QUAY": "https://gedcom.io/terms/v7/enumset-QUAY",
193
+ "enumset-RESN": "https://gedcom.io/terms/v7/enumset-RESN",
194
+ "enumset-ROLE": "https://gedcom.io/terms/v7/enumset-ROLE",
195
+ "enumset-SEX": "https://gedcom.io/terms/v7/enumset-SEX",
196
+ "ord-STAT": "https://gedcom.io/terms/v7/ord-STAT",
197
+ "record-FAM": "https://gedcom.io/terms/v7/record-FAM",
198
+ "record-INDI": "https://gedcom.io/terms/v7/record-INDI",
199
+ "record-OBJE": "https://gedcom.io/terms/v7/record-OBJE",
200
+ "record-REPO": "https://gedcom.io/terms/v7/record-REPO",
201
+ "record-SNOTE": "https://gedcom.io/terms/v7/record-SNOTE",
202
+ "record-SOUR": "https://gedcom.io/terms/v7/record-SOUR",
203
+ "record-SUBM": "https://gedcom.io/terms/v7/record-SUBM"
204
+ }
205
+
@@ -0,0 +1,19 @@
1
+ import logging
2
+
3
+ def get_logger(name=None):
4
+ logger = logging.getLogger(name)
5
+ if not logger.handlers:
6
+ logger.setLevel(logging.DEBUG)
7
+
8
+ formatter = logging.Formatter('[%(asctime)s] %(levelname)s - %(name)s - %(message)s')
9
+
10
+ console_handler = logging.StreamHandler()
11
+ console_handler.setFormatter(formatter)
12
+ logger.addHandler(console_handler)
13
+
14
+ # Optional: file logging
15
+ file_handler = logging.FileHandler(f"{name}.log", encoding="utf-8")
16
+ file_handler.setFormatter(formatter)
17
+ logger.addHandler(file_handler)
18
+
19
+ return logger
@@ -26,19 +26,20 @@ from typing import Any, Dict, Optional
26
26
  GEDCOM Module Types
27
27
  ======================================================================
28
28
  """
29
- from .Agent import Agent
30
- from .Attribution import Attribution
31
- from .Document import Document
32
- from .Event import Event
33
- from .Group import Group
34
- from .Identifier import make_uid
29
+ from .agent import Agent
30
+ from .attribution import Attribution
31
+ from .document import Document
32
+ from .event import Event
33
+ from .group import Group
34
+ from .identifier import make_uid
35
35
  from .Logging import get_logger
36
- from .Person import Person
37
- from .PlaceDescription import PlaceDescription
38
- from .Relationship import Relationship, RelationshipType
39
- from .Resource import Resource, URI
40
- from .SourceDescription import ResourceType, SourceDescription
41
- from .TextValue import TextValue
36
+ from .person import Person
37
+ from .place_description import PlaceDescription
38
+ from .relationship import Relationship, RelationshipType
39
+ from .resource import Resource
40
+ from .source_description import ResourceType, SourceDescription
41
+ from .textvalue import TextValue
42
+ from .uri import URI
42
43
  #=====================================================================
43
44
 
44
45
 
@@ -468,7 +469,7 @@ class GedcomX:
468
469
 
469
470
  @staticmethod
470
471
  def from_json(data: dict):
471
- from .Serialization import Serialization
472
+ from .serialization import Serialization
472
473
  gx = GedcomX()
473
474
 
474
475
  source_descriptions = data.get('sourceDescriptions', [])