rara-tools 0.6.12__py3-none-any.whl → 0.6.13__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.
Potentially problematic release.
This version of rara-tools might be problematic. Click here for more details.
- rara_tools/parsers/marc_records/organization_record.py +20 -10
- {rara_tools-0.6.12.dist-info → rara_tools-0.6.13.dist-info}/METADATA +1 -1
- {rara_tools-0.6.12.dist-info → rara_tools-0.6.13.dist-info}/RECORD +6 -6
- {rara_tools-0.6.12.dist-info → rara_tools-0.6.13.dist-info}/WHEEL +0 -0
- {rara_tools-0.6.12.dist-info → rara_tools-0.6.13.dist-info}/licenses/LICENSE.md +0 -0
- {rara_tools-0.6.12.dist-info → rara_tools-0.6.13.dist-info}/top_level.txt +0 -0
|
@@ -6,13 +6,8 @@ import regex as re
|
|
|
6
6
|
import json
|
|
7
7
|
|
|
8
8
|
# TODO: indikaatorid ind1 väljadel 100 ja 400?
|
|
9
|
-
"""
|
|
10
|
-
|c asutuse konverentsi toimumise koht (MK)
|
|
11
9
|
|
|
12
|
-
|d asutuse konverentsi toimumise aeg (K)
|
|
13
10
|
|
|
14
|
-
|n asutuse konverentsi järjenumber (K)
|
|
15
|
-
"""
|
|
16
11
|
class OrganizationRecord(BaseRecord):
|
|
17
12
|
""" Generates a simplified organization JSON record
|
|
18
13
|
from a pymarc MARC record.
|
|
@@ -45,6 +40,7 @@ class OrganizationRecord(BaseRecord):
|
|
|
45
40
|
self.__name_specification: str = ""
|
|
46
41
|
self.__dates: str = ""
|
|
47
42
|
self.__location: str = ""
|
|
43
|
+
self.__numeration: str = ""
|
|
48
44
|
self.__name_variations: List[str] = []
|
|
49
45
|
self.__source: str = ""
|
|
50
46
|
self.__description: str = ""
|
|
@@ -61,7 +57,10 @@ class OrganizationRecord(BaseRecord):
|
|
|
61
57
|
|
|
62
58
|
|
|
63
59
|
def _clean_value(self, value: str) -> str:
|
|
64
|
-
|
|
60
|
+
try:
|
|
61
|
+
cleaned_value = value.strip("., ")
|
|
62
|
+
except Exception as e:
|
|
63
|
+
cleaned_value = ""
|
|
65
64
|
return cleaned_value
|
|
66
65
|
|
|
67
66
|
def _merge_and_clean(self, value: dict, keys: List[str]) -> str:
|
|
@@ -103,10 +102,10 @@ class OrganizationRecord(BaseRecord):
|
|
|
103
102
|
if not self.__dates:
|
|
104
103
|
values = self.get_values(
|
|
105
104
|
marc_ids=self.__name_field_id,
|
|
106
|
-
subfield_id=
|
|
105
|
+
subfield_id="d"
|
|
107
106
|
)
|
|
108
107
|
if values:
|
|
109
|
-
self.__dates = self.
|
|
108
|
+
self.__dates = self._clean_value(values[0])
|
|
110
109
|
return self.__dates
|
|
111
110
|
|
|
112
111
|
@property
|
|
@@ -114,12 +113,23 @@ class OrganizationRecord(BaseRecord):
|
|
|
114
113
|
if not self.__location:
|
|
115
114
|
values = self.get_values(
|
|
116
115
|
marc_ids=self.__name_field_id,
|
|
117
|
-
subfield_id=
|
|
116
|
+
subfield_id="c"
|
|
118
117
|
)
|
|
119
118
|
if values:
|
|
120
|
-
self.__location = self.
|
|
119
|
+
self.__location = self._clean_value(values[0])
|
|
121
120
|
return self.__location
|
|
122
121
|
|
|
122
|
+
@property
|
|
123
|
+
def numeration(self) -> str:
|
|
124
|
+
if not self.__numeration:
|
|
125
|
+
values = self.get_values(
|
|
126
|
+
marc_ids=self.__name_field_id,
|
|
127
|
+
subfield_id="n"
|
|
128
|
+
)
|
|
129
|
+
if values:
|
|
130
|
+
self.__numeration = self._clean_value(values[0])
|
|
131
|
+
return self.__numeration
|
|
132
|
+
|
|
123
133
|
@property
|
|
124
134
|
def acronyms(self) -> List[str]:
|
|
125
135
|
if not self.__acronyms:
|
|
@@ -28,14 +28,14 @@ rara_tools/parsers/marc_parsers/person_parser.py,sha256=iMycHSlgfvgB0axE_rneB5sI
|
|
|
28
28
|
rara_tools/parsers/marc_parsers/title_parser.py,sha256=uZiYb_aZWzv_xLEBSZmFt2vN6UIauNSFRCkNG_ZKL10,1570
|
|
29
29
|
rara_tools/parsers/marc_records/base_record.py,sha256=yllX2ArjBm9PfUnH6dk3__Rb2LQuEGCYqZGVKBzqSl0,4673
|
|
30
30
|
rara_tools/parsers/marc_records/ems_record.py,sha256=B2YZLEeDd-GmmYqxhczbMsSEB7-x6ZLjB8OeDnzOxww,9376
|
|
31
|
-
rara_tools/parsers/marc_records/organization_record.py,sha256=
|
|
31
|
+
rara_tools/parsers/marc_records/organization_record.py,sha256=WFmmMBiZUhaIMh-j06ChH37JLT7yFG7ZDc_0keqjIYo,10355
|
|
32
32
|
rara_tools/parsers/marc_records/person_record.py,sha256=AtGESwFmN5YvrBES0BsfTgOZbroB4l0SuFRznumfmJA,7867
|
|
33
33
|
rara_tools/parsers/marc_records/title_record.py,sha256=XrtJ4gj7wzSaGxNaPtPuawmqqkXsVX5HAAKfXTSo4mA,6855
|
|
34
34
|
rara_tools/parsers/tools/entity_normalizers.py,sha256=VyCy_NowCLpOsL0luQ55IW-Qi-J5oBH0Ofzr7HRFBhM,8949
|
|
35
35
|
rara_tools/parsers/tools/marc_converter.py,sha256=LgSHe-7n7aiDrw2bnsB53r3fXTRFjZXTwBYfTpL0pfs,415
|
|
36
36
|
rara_tools/parsers/tools/russian_transliterator.py,sha256=5ZU66iTqAhr7pmfVqXPAI_cidF43VqqmuN4d7H4_JuA,9770
|
|
37
|
-
rara_tools-0.6.
|
|
38
|
-
rara_tools-0.6.
|
|
39
|
-
rara_tools-0.6.
|
|
40
|
-
rara_tools-0.6.
|
|
41
|
-
rara_tools-0.6.
|
|
37
|
+
rara_tools-0.6.13.dist-info/licenses/LICENSE.md,sha256=hkZVnIZll7e_KNEQzeY94Y9tlzVL8iVZBTMBvDykksU,35142
|
|
38
|
+
rara_tools-0.6.13.dist-info/METADATA,sha256=P_y0fL650yYO1aN0Db2d_2pq93g99ytU8_pNq6kl0iY,4080
|
|
39
|
+
rara_tools-0.6.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
40
|
+
rara_tools-0.6.13.dist-info/top_level.txt,sha256=JwfB5b8BAtW5OFKRln2AQ_WElTRyIBM4nO0FKN1cupY,11
|
|
41
|
+
rara_tools-0.6.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|