rara-tools 0.7.11__tar.gz → 0.7.12__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.
Potentially problematic release.
This version of rara-tools might be problematic. Click here for more details.
- {rara_tools-0.7.11/rara_tools.egg-info → rara_tools-0.7.12}/PKG-INFO +1 -1
- rara_tools-0.7.12/VERSION +1 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/normalizers/authorities.py +3 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/normalizers/base.py +25 -5
- {rara_tools-0.7.11 → rara_tools-0.7.12/rara_tools.egg-info}/PKG-INFO +1 -1
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_normalization.py +11 -0
- rara_tools-0.7.11/VERSION +0 -1
- {rara_tools-0.7.11 → rara_tools-0.7.12}/LICENSE.md +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/README.md +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/pyproject.toml +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/__init__.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/digitizer.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/general.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/language_evaluator.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/linker.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/meta_extractor.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/normalizers.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/parsers.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/constants/subject_indexer.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/converters.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/core_formatters/core_formatter.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/core_formatters/formatted_keyword.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/core_formatters/formatted_meta.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/core_formatters/formatted_object.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/decorators.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/digar_schema_converter.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/elastic.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/exceptions.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/normalizers/__init__.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/normalizers/bibs.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/normalizers/reader.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/normalizers/viaf.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_parsers/base_parser.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_parsers/ems_parser.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_parsers/location_parser.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_parsers/organization_parser.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_parsers/person_parser.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_parsers/title_parser.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_records/base_record.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_records/ems_record.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_records/organization_record.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_records/person_record.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_records/title_record.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/tools/entity_normalizers.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/tools/marc_converter.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/tools/russian_transliterator.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/s3.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/task_reporter.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/utils.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools.egg-info/SOURCES.txt +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools.egg-info/dependency_links.txt +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools.egg-info/requires.txt +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools.egg-info/top_level.txt +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/requirements.txt +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/setup.cfg +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_digar_schema_converter.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_elastic.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_elastic_vector_and_search_operations.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_entity_normalizers.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_formatters.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_marc_parsers.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_s3_exceptions.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_s3_file_operations.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_sierra_converters.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_task_reporter.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_utils.py +0 -0
- {rara_tools-0.7.11 → rara_tools-0.7.12}/tests/test_viaf_client.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.7.12
|
|
@@ -59,6 +59,9 @@ class AuthoritiesRecordNormalizer(RecordNormalizer):
|
|
|
59
59
|
record, "046", "f", formatted_birth_date)
|
|
60
60
|
death_date = self.get_subfield(
|
|
61
61
|
record, "046", "g", formatted_death_date)
|
|
62
|
+
|
|
63
|
+
if not birth_date and not death_date:
|
|
64
|
+
return
|
|
62
65
|
|
|
63
66
|
subfields_046 = [
|
|
64
67
|
Subfield("f", birth_date),
|
|
@@ -213,13 +213,33 @@ class RecordNormalizer:
|
|
|
213
213
|
)
|
|
214
214
|
|
|
215
215
|
def _add_fields_to_record(self, record: Record, fields: List[Field]) -> Record:
|
|
216
|
-
|
|
216
|
+
cleaned_fields = []
|
|
217
|
+
|
|
217
218
|
for field in fields:
|
|
218
|
-
field.subfields = [sub for sub in field.subfields if sub.value and sub.value not in ["0", 0]]
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
# Always assume control fields cleaned
|
|
221
|
+
if field.tag < "010" and field.tag.isdigit():
|
|
222
|
+
cleaned_fields.append(field)
|
|
223
|
+
continue
|
|
224
|
+
|
|
225
|
+
# filter out subfields that are empty or 0 (VIAF returns 0 for unknown dates)
|
|
226
|
+
field.subfields = [
|
|
227
|
+
sub for sub in field.subfields
|
|
228
|
+
if sub.value and sub.value not in ["0", 0]
|
|
229
|
+
]
|
|
230
|
+
|
|
231
|
+
# only keep the field if it still has subfields left
|
|
232
|
+
if field.subfields:
|
|
233
|
+
cleaned_fields.append(field)
|
|
234
|
+
|
|
235
|
+
if not cleaned_fields:
|
|
236
|
+
return record
|
|
237
|
+
|
|
238
|
+
self._handle_repeatable_fields(record, *cleaned_fields)
|
|
239
|
+
self._handle_editable_fields(record, *cleaned_fields)
|
|
240
|
+
self._handle_default_fields(record, *cleaned_fields)
|
|
241
|
+
|
|
242
|
+
return record
|
|
223
243
|
|
|
224
244
|
def _add_author(self, record: Record, viaf_record: VIAFRecord) -> Optional[Field]:
|
|
225
245
|
|
|
@@ -404,6 +404,17 @@ def test_add_birth_and_death_dates():
|
|
|
404
404
|
# empty indicators represented with \
|
|
405
405
|
assert field_046 == "=046 \\\\$f19700817"
|
|
406
406
|
|
|
407
|
+
# Case 3 - viaf record has no birth or death date
|
|
408
|
+
viaf_record = normalizer._get_viaf_record(
|
|
409
|
+
record,
|
|
410
|
+
entity="Eesti Interlingvistika Selts"
|
|
411
|
+
)
|
|
412
|
+
record = Record()
|
|
413
|
+
normalizer._add_birth_and_death_dates(record, viaf_record)
|
|
414
|
+
# should not add 046 field
|
|
415
|
+
fields_046 = record.get_fields("046")
|
|
416
|
+
assert len(fields_046) == 0
|
|
417
|
+
|
|
407
418
|
def test_add_nationality():
|
|
408
419
|
""" Test adding nationality from VIAF record to 043 field """
|
|
409
420
|
|
rara_tools-0.7.11/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.7.11
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_parsers/organization_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rara_tools-0.7.11 → rara_tools-0.7.12}/rara_tools/parsers/marc_records/organization_record.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|