folio-migration-tools 1.9.0a3__tar.gz → 1.9.0a5__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.
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/PKG-INFO +1 -1
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/pyproject.toml +1 -1
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapper_base.py +9 -2
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/marc_file_processor.py +3 -3
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/rules_mapper_bibs.py +9 -17
- folio_migration_tools-1.9.0a3/src/folio_migration_tools/migration_tasks/bibs_transformer_simple.py +0 -198
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/LICENSE +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/README.md +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/__init__.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/__main__.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/circulation_helper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/colors.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/config_file_load.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/custom_dict.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/custom_exceptions.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/extradata_writer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/folder_structure.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/helper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/holdings_helper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/i18n_config.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/library_configuration.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/__init__.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/courses_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/holdings_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/item_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/manual_fee_fines_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/mapping_file_mapper_base.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/notes_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/order_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/organization_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/ref_data_mapping.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/mapping_file_transformation/user_mapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/__init__.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/conditions.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/holdings_statementsparser.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/hrid_handler.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/loc_language_codes.xml +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/marc_reader_wrapper.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/rules_mapper_authorities.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/rules_mapper_base.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/marc_rules_transformation/rules_mapper_holdings.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_report.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/__init__.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/authority_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/batch_poster.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/bibs_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/courses_migrator.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/holdings_csv_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/holdings_marc_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/items_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/loans_migrator.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/manual_fee_fines_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/migration_task_base.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/orders_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/organization_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/requests_migrator.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/reserves_migrator.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/migration_tasks/user_transformer.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/task_configuration.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/test_infrastructure/__init__.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/test_infrastructure/mocked_classes.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/transaction_migration/__init__.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/transaction_migration/legacy_loan.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/transaction_migration/legacy_request.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/transaction_migration/legacy_reserve.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/transaction_migration/transaction_result.py +0 -0
- {folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/translations/en.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "folio_migration_tools"
|
|
3
|
-
version = "1.9.
|
|
3
|
+
version = "1.9.0a5"
|
|
4
4
|
description = "A tool allowing you to migrate data from legacy ILS:s (Library systems) into FOLIO LSP"
|
|
5
5
|
authors = ["Theodor Tolstoy <github.teddes@tolstoy.se>", "Lisa Sjögren", "Brooks Travis", "Jeremy Nelson", "Clinton Bradford"]
|
|
6
6
|
license = "MIT"
|
|
@@ -24,6 +24,7 @@ from folio_migration_tools.mapping_file_transformation.ref_data_mapping import (
|
|
|
24
24
|
RefDataMapping,
|
|
25
25
|
)
|
|
26
26
|
from folio_migration_tools.migration_report import MigrationReport
|
|
27
|
+
from folio_migration_tools.task_configuration import AbstractTaskConfiguration
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
class MapperBase:
|
|
@@ -42,7 +43,7 @@ class MapperBase:
|
|
|
42
43
|
self.start_datetime = datetime.now(timezone.utc)
|
|
43
44
|
self.folio_client: FolioClient = folio_client
|
|
44
45
|
self.library_configuration: LibraryConfiguration = library_configuration
|
|
45
|
-
|
|
46
|
+
self.task_configuration: AbstractTaskConfiguration
|
|
46
47
|
self.mapped_folio_fields: dict = {}
|
|
47
48
|
self.migration_report: MigrationReport = MigrationReport()
|
|
48
49
|
self.num_criticalerrors = 0
|
|
@@ -267,7 +268,13 @@ class MapperBase:
|
|
|
267
268
|
sys.exit(1)
|
|
268
269
|
|
|
269
270
|
def get_id_map_tuple(self, legacy_id: str, folio_record: dict, object_type: FOLIONamespaces):
|
|
270
|
-
if
|
|
271
|
+
if all(
|
|
272
|
+
[
|
|
273
|
+
object_type == FOLIONamespaces.instances,
|
|
274
|
+
(not getattr(self.task_configuration, "data_import_marc", False)),
|
|
275
|
+
getattr(self.task_configuration, "create_source_records", True),
|
|
276
|
+
]
|
|
277
|
+
):
|
|
271
278
|
return (legacy_id, folio_record["id"], folio_record["hrid"])
|
|
272
279
|
return (legacy_id, folio_record["id"])
|
|
273
280
|
|
|
@@ -32,7 +32,7 @@ class MarcFileProcessor:
|
|
|
32
32
|
self.created_objects_file = created_objects_file
|
|
33
33
|
if mapper.task_configuration.create_source_records:
|
|
34
34
|
self.srs_records_file = open(self.folder_structure.srs_records_path, "w+")
|
|
35
|
-
if mapper.task_configuration
|
|
35
|
+
if getattr(mapper.task_configuration, "data_import_marc", False):
|
|
36
36
|
self.data_import_marc_file = open(self.folder_structure.data_import_marc_path, "wb+")
|
|
37
37
|
self.unique_001s: set = set()
|
|
38
38
|
self.failed_records_count: int = 0
|
|
@@ -87,7 +87,7 @@ class MarcFileProcessor:
|
|
|
87
87
|
legacy_ids,
|
|
88
88
|
self.object_type,
|
|
89
89
|
)
|
|
90
|
-
if self.mapper.task_configuration
|
|
90
|
+
if getattr(self.mapper.task_configuration, "data_import_marc", False):
|
|
91
91
|
self.save_marc_record(
|
|
92
92
|
marc_record,
|
|
93
93
|
folio_rec,
|
|
@@ -271,7 +271,7 @@ class MarcFileProcessor:
|
|
|
271
271
|
if not self.srs_records_file.seek(0):
|
|
272
272
|
os.remove(self.srs_records_file.name)
|
|
273
273
|
self.srs_records_file.close()
|
|
274
|
-
if self.mapper.task_configuration
|
|
274
|
+
if getattr(self.mapper.task_configuration, "data_import_marc", False):
|
|
275
275
|
self.data_import_marc_file.seek(0)
|
|
276
276
|
if not self.data_import_marc_file.read(1):
|
|
277
277
|
os.remove(self.data_import_marc_file.name)
|
|
@@ -59,7 +59,7 @@ class BibsRulesMapper(RulesMapperBase):
|
|
|
59
59
|
self.instance_relationship_types: dict = {}
|
|
60
60
|
self.other_mode_of_issuance_id = get_unspecified_mode_of_issuance(self.folio_client)
|
|
61
61
|
self.create_source_records = all(
|
|
62
|
-
[self.task_configuration.create_source_records, (not self.task_configuration
|
|
62
|
+
[self.task_configuration.create_source_records, (not getattr(self.task_configuration, "data_import_marc", False))]
|
|
63
63
|
)
|
|
64
64
|
self.data_import_marc = self.task_configuration.data_import_marc
|
|
65
65
|
self.start = time.time()
|
|
@@ -118,7 +118,7 @@ class BibsRulesMapper(RulesMapperBase):
|
|
|
118
118
|
bad_tags = set(self.task_configuration.tags_to_delete) # "907"
|
|
119
119
|
folio_instance = self.perform_initial_preparation(marc_record, legacy_ids)
|
|
120
120
|
if self.data_import_marc:
|
|
121
|
-
self.simple_bib_map(
|
|
121
|
+
self.simple_bib_map(folio_instance, marc_record, ignored_subsequent_fields, legacy_ids)
|
|
122
122
|
else:
|
|
123
123
|
for marc_field in marc_record:
|
|
124
124
|
self.report_marc_stats(marc_field, bad_tags, legacy_ids, ignored_subsequent_fields)
|
|
@@ -152,7 +152,13 @@ class BibsRulesMapper(RulesMapperBase):
|
|
|
152
152
|
legacy_ids (List[str]): _description_
|
|
153
153
|
file_def (FileDefinition): _description_
|
|
154
154
|
"""
|
|
155
|
-
|
|
155
|
+
try:
|
|
156
|
+
self.process_marc_field(folio_instnace, marc_record['245'], ignored_subsequent_fields, legacy_ids)
|
|
157
|
+
except KeyError:
|
|
158
|
+
raise TransformationRecordFailedError(
|
|
159
|
+
legacy_ids,
|
|
160
|
+
"No 245 field in MARC record"
|
|
161
|
+
)
|
|
156
162
|
|
|
157
163
|
def perform_additional_parsing(
|
|
158
164
|
self,
|
|
@@ -642,20 +648,6 @@ class BibsRulesMapper(RulesMapperBase):
|
|
|
642
648
|
) from e
|
|
643
649
|
|
|
644
650
|
|
|
645
|
-
class SimpleBibsRulesMapper(BibsRulesMapper):
|
|
646
|
-
def __init__(
|
|
647
|
-
self,
|
|
648
|
-
folio_client,
|
|
649
|
-
library_configuration: LibraryConfiguration,
|
|
650
|
-
task_configuration,
|
|
651
|
-
):
|
|
652
|
-
super().__init__(
|
|
653
|
-
folio_client,
|
|
654
|
-
library_configuration,
|
|
655
|
-
task_configuration,
|
|
656
|
-
)
|
|
657
|
-
|
|
658
|
-
|
|
659
651
|
def get_unspecified_mode_of_issuance(folio_client: FolioClient):
|
|
660
652
|
m_o_is = list(folio_client.modes_of_issuance)
|
|
661
653
|
if not any(m_o_is):
|
folio_migration_tools-1.9.0a3/src/folio_migration_tools/migration_tasks/bibs_transformer_simple.py
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from typing import Annotated, List
|
|
3
|
-
|
|
4
|
-
import i18n
|
|
5
|
-
from folio_uuid.folio_namespaces import FOLIONamespaces
|
|
6
|
-
from pydantic import Field
|
|
7
|
-
|
|
8
|
-
from folio_migration_tools.helper import Helper
|
|
9
|
-
from folio_migration_tools.library_configuration import (
|
|
10
|
-
FileDefinition,
|
|
11
|
-
HridHandling,
|
|
12
|
-
IlsFlavour,
|
|
13
|
-
LibraryConfiguration,
|
|
14
|
-
)
|
|
15
|
-
from folio_migration_tools.marc_rules_transformation.marc_file_processor import (
|
|
16
|
-
MarcFileProcessor,
|
|
17
|
-
)
|
|
18
|
-
from folio_migration_tools.marc_rules_transformation.rules_mapper_bibs import (
|
|
19
|
-
SimpleBibsRulesMapper,
|
|
20
|
-
)
|
|
21
|
-
from folio_migration_tools.migration_tasks.migration_task_base import MigrationTaskBase
|
|
22
|
-
from folio_migration_tools.task_configuration import AbstractTaskConfiguration
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class BibsTransformer(MigrationTaskBase):
|
|
26
|
-
class TaskConfiguration(AbstractTaskConfiguration):
|
|
27
|
-
name: Annotated[
|
|
28
|
-
str,
|
|
29
|
-
Field(
|
|
30
|
-
description=(
|
|
31
|
-
"Name of this migration task. The name is being used to call the specific "
|
|
32
|
-
"task, and to distinguish tasks of similar types"
|
|
33
|
-
)
|
|
34
|
-
),
|
|
35
|
-
]
|
|
36
|
-
migration_task_type: Annotated[
|
|
37
|
-
str,
|
|
38
|
-
Field(
|
|
39
|
-
title="Migration task type",
|
|
40
|
-
description=("The type of migration task you want to perform."),
|
|
41
|
-
),
|
|
42
|
-
]
|
|
43
|
-
files: Annotated[
|
|
44
|
-
List[FileDefinition],
|
|
45
|
-
Field(
|
|
46
|
-
title="Source files",
|
|
47
|
-
description=("List of MARC21 files with bibliographic records."),
|
|
48
|
-
),
|
|
49
|
-
]
|
|
50
|
-
ils_flavour: Annotated[
|
|
51
|
-
IlsFlavour,
|
|
52
|
-
Field(
|
|
53
|
-
title="ILS flavour", description="The type of ILS you are migrating records from."
|
|
54
|
-
),
|
|
55
|
-
]
|
|
56
|
-
custom_bib_id_field: Annotated[
|
|
57
|
-
str,
|
|
58
|
-
Field(
|
|
59
|
-
title="Custom BIB ID field",
|
|
60
|
-
description=(
|
|
61
|
-
'A string representing a MARC field with optional subfield indicated by a "$" '
|
|
62
|
-
'(eg. "991$a") from which to draw legacy Bib ID. Use this in combination '
|
|
63
|
-
'with `ilsFlavour: "custom"`. Defaults to "001", and is ignored for all other '
|
|
64
|
-
"ilsFlavours."
|
|
65
|
-
),
|
|
66
|
-
),
|
|
67
|
-
] = "001"
|
|
68
|
-
add_administrative_notes_with_legacy_ids: Annotated[
|
|
69
|
-
bool,
|
|
70
|
-
Field(
|
|
71
|
-
title="Add administrative notes with legacy IDs",
|
|
72
|
-
description=(
|
|
73
|
-
"If set to true, an Administrative note will be added to the records "
|
|
74
|
-
"containing the legacy ID. Use this in order to protect the values from "
|
|
75
|
-
"getting overwritten by overlays,"
|
|
76
|
-
),
|
|
77
|
-
),
|
|
78
|
-
] = True
|
|
79
|
-
tags_to_delete: Annotated[
|
|
80
|
-
List[str],
|
|
81
|
-
Field(
|
|
82
|
-
title="Tags to delete from MARC record",
|
|
83
|
-
description=(
|
|
84
|
-
"Tags in the incoming MARC authority that the process should remove "
|
|
85
|
-
"before adding them into FOLIO. These tags will be used in the "
|
|
86
|
-
"transformation before getting removed."
|
|
87
|
-
),
|
|
88
|
-
),
|
|
89
|
-
] = []
|
|
90
|
-
create_source_records: Annotated[
|
|
91
|
-
bool,
|
|
92
|
-
Field(
|
|
93
|
-
title="Create source records",
|
|
94
|
-
description=(
|
|
95
|
-
"Controls wheter or not to retain the MARC records in "
|
|
96
|
-
"Source Record Storage."
|
|
97
|
-
),
|
|
98
|
-
),
|
|
99
|
-
] = True
|
|
100
|
-
parse_cataloged_date: Annotated[
|
|
101
|
-
bool,
|
|
102
|
-
Field(
|
|
103
|
-
title="Parse cataloged date",
|
|
104
|
-
description=(
|
|
105
|
-
"Parse fields mapped to catalogedDate into a FOLIO accepted date string using "
|
|
106
|
-
"dateutil.parser. Verify results carefully when using"
|
|
107
|
-
),
|
|
108
|
-
),
|
|
109
|
-
] = False
|
|
110
|
-
hrid_handling: Annotated[
|
|
111
|
-
HridHandling,
|
|
112
|
-
Field(
|
|
113
|
-
title="HRID Handling",
|
|
114
|
-
description=(
|
|
115
|
-
"Setting to default will make FOLIO generate HRIDs and move the existing "
|
|
116
|
-
"001:s into a 035, concatenated with the 003. Choosing preserve001 means "
|
|
117
|
-
"the 001:s will remain in place, and that they will also become the HRIDs"
|
|
118
|
-
),
|
|
119
|
-
),
|
|
120
|
-
] = HridHandling.default
|
|
121
|
-
reset_hrid_settings: Annotated[
|
|
122
|
-
bool,
|
|
123
|
-
Field(
|
|
124
|
-
title="Reset HRID settings",
|
|
125
|
-
description=(
|
|
126
|
-
"Setting to true means the task will "
|
|
127
|
-
"reset the HRID counters for this particular record type"
|
|
128
|
-
),
|
|
129
|
-
),
|
|
130
|
-
] = False
|
|
131
|
-
update_hrid_settings: Annotated[
|
|
132
|
-
bool,
|
|
133
|
-
Field(
|
|
134
|
-
title="Update HRID settings",
|
|
135
|
-
description="At the end of the run, update FOLIO with the HRID settings",
|
|
136
|
-
),
|
|
137
|
-
] = True
|
|
138
|
-
deactivate035_from001: Annotated[
|
|
139
|
-
bool,
|
|
140
|
-
Field(
|
|
141
|
-
title="Create 035 from 001 and 003",
|
|
142
|
-
description=(
|
|
143
|
-
"This deactivates the FOLIO default functionality of moving the previous 001 "
|
|
144
|
-
"into a 035, prefixed with the value from 003"
|
|
145
|
-
),
|
|
146
|
-
),
|
|
147
|
-
] = False
|
|
148
|
-
|
|
149
|
-
@staticmethod
|
|
150
|
-
def get_object_type() -> FOLIONamespaces:
|
|
151
|
-
return FOLIONamespaces.instances
|
|
152
|
-
|
|
153
|
-
def __init__(
|
|
154
|
-
self,
|
|
155
|
-
task_config: TaskConfiguration,
|
|
156
|
-
library_config: LibraryConfiguration,
|
|
157
|
-
folio_client,
|
|
158
|
-
use_logging: bool = True,
|
|
159
|
-
):
|
|
160
|
-
super().__init__(library_config, task_config, folio_client, use_logging)
|
|
161
|
-
self.processor: MarcFileProcessor
|
|
162
|
-
self.check_source_files(
|
|
163
|
-
self.folder_structure.legacy_records_folder, self.task_configuration.files
|
|
164
|
-
)
|
|
165
|
-
self.mapper = SimpleBibsRulesMapper(self.folio_client, library_config, self.task_configuration)
|
|
166
|
-
self.bib_ids: set = set()
|
|
167
|
-
if (
|
|
168
|
-
self.task_configuration.reset_hrid_settings
|
|
169
|
-
and self.task_configuration.update_hrid_settings
|
|
170
|
-
):
|
|
171
|
-
self.mapper.hrid_handler.reset_instance_hrid_counter()
|
|
172
|
-
logging.info("Init done")
|
|
173
|
-
|
|
174
|
-
def do_work(self):
|
|
175
|
-
self.do_work_marc_transformer()
|
|
176
|
-
|
|
177
|
-
def wrap_up(self):
|
|
178
|
-
logging.info("Done. Transformer wrapping up...")
|
|
179
|
-
self.extradata_writer.flush()
|
|
180
|
-
self.processor.wrap_up()
|
|
181
|
-
with open(self.folder_structure.migration_reports_file, "w+") as report_file:
|
|
182
|
-
self.mapper.migration_report.write_migration_report(
|
|
183
|
-
i18n.t("Bibliographic records transformation report"),
|
|
184
|
-
report_file,
|
|
185
|
-
self.start_datetime,
|
|
186
|
-
)
|
|
187
|
-
Helper.print_mapping_report(
|
|
188
|
-
report_file,
|
|
189
|
-
self.mapper.parsed_records,
|
|
190
|
-
self.mapper.mapped_folio_fields,
|
|
191
|
-
self.mapper.mapped_legacy_fields,
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
logging.info(
|
|
195
|
-
"Done. Transformation report written to %s",
|
|
196
|
-
self.folder_structure.migration_reports_file.name,
|
|
197
|
-
)
|
|
198
|
-
self.clean_out_empty_logs()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/colors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{folio_migration_tools-1.9.0a3 → folio_migration_tools-1.9.0a5}/src/folio_migration_tools/helper.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
|
|
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
|