folio-migration-tools 1.9.0a3__py3-none-any.whl → 1.9.0a4__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.
@@ -642,20 +642,6 @@ class BibsRulesMapper(RulesMapperBase):
642
642
  ) from e
643
643
 
644
644
 
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
645
  def get_unspecified_mode_of_issuance(folio_client: FolioClient):
660
646
  m_o_is = list(folio_client.modes_of_issuance)
661
647
  if not any(m_o_is):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: folio_migration_tools
3
- Version: 1.9.0a3
3
+ Version: 1.9.0a4
4
4
  Summary: A tool allowing you to migrate data from legacy ILS:s (Library systems) into FOLIO LSP
5
5
  Home-page: https://github.com/FOLIO-FSE/folio_migration_tools
6
6
  License: MIT
@@ -32,14 +32,13 @@ folio_migration_tools/marc_rules_transformation/marc_file_processor.py,sha256=vP
32
32
  folio_migration_tools/marc_rules_transformation/marc_reader_wrapper.py,sha256=9ATjYMRAjy0QcXtmNZaHVhHLJ5hE1WUgOcF6KMJjbgo,5309
33
33
  folio_migration_tools/marc_rules_transformation/rules_mapper_authorities.py,sha256=GFw8j9UtCxnUdLShmPzJa1MpCK8a0NkQIN5C3jyouRs,9604
34
34
  folio_migration_tools/marc_rules_transformation/rules_mapper_base.py,sha256=WWSJgYvF9LeY8vh-BtQi7Fm3J-cowUJKWa0Wk2Ge7fc,39358
35
- folio_migration_tools/marc_rules_transformation/rules_mapper_bibs.py,sha256=TpR_APcNzrzftSWr22eWf45GZnJgI44ESQDr7ZnRs5k,28874
35
+ folio_migration_tools/marc_rules_transformation/rules_mapper_bibs.py,sha256=ys27z3PGF0I4RQfTXYB-YMgs-2nyNS3L70mkXEFnwLY,28555
36
36
  folio_migration_tools/marc_rules_transformation/rules_mapper_holdings.py,sha256=EBxf9Qh5Y0eDOmqYssWfaizxafiXSYDFzWmCuPtdG-8,18226
37
37
  folio_migration_tools/migration_report.py,sha256=BkRspM1hwTBnWeqsHamf7yVEofzLj560Q-9G--O00hw,4258
38
38
  folio_migration_tools/migration_tasks/__init__.py,sha256=ZkbY_yGyB84Ke8OMlYUzyyBj4cxxNrhMTwQlu_GbdDs,211
39
39
  folio_migration_tools/migration_tasks/authority_transformer.py,sha256=AoXg9s-GLO3yEEDCrQV7hc4YVXxwxsdxDdpj1zhHydE,4251
40
40
  folio_migration_tools/migration_tasks/batch_poster.py,sha256=iaWhvxdYli0kgsXLHGmFFBMeVXGpAv9eDg02BagyQ2U,29732
41
41
  folio_migration_tools/migration_tasks/bibs_transformer.py,sha256=XzlPo-0uuugJA4SM80xOlOj5nDK6OMDXFnAYg80hOBc,7791
42
- folio_migration_tools/migration_tasks/bibs_transformer_simple.py,sha256=goXG08zP9JUwt6Gd2FcslA3gBJpezUUP3k2zB67a4xM,7266
43
42
  folio_migration_tools/migration_tasks/courses_migrator.py,sha256=dQerp97P3r7wmxK3Ovg6AriO6K_nTr6vA8RKj_XBEt4,5728
44
43
  folio_migration_tools/migration_tasks/holdings_csv_transformer.py,sha256=Hwr4YjgNIQpi2N-x8eq-mmRpXAyxYylQjpYubm03-ec,19668
45
44
  folio_migration_tools/migration_tasks/holdings_marc_transformer.py,sha256=yN0a8YVNx2P6NswxSylTca0MmNk1shze3PyKXv9JJIw,9547
@@ -61,7 +60,7 @@ folio_migration_tools/transaction_migration/legacy_request.py,sha256=1ulyFzPQw_I
61
60
  folio_migration_tools/transaction_migration/legacy_reserve.py,sha256=rZVtiMBYnt6aI0WxAwPN8fML_MKEUSUYsadCKPTeB4E,1839
62
61
  folio_migration_tools/transaction_migration/transaction_result.py,sha256=cTdCN0BnlI9_ZJB2Z3Fdkl9gpymIi-9mGZsRFlQcmDk,656
63
62
  folio_migration_tools/translations/en.json,sha256=HOVpkb_T-SN_x0NpDp8gyvV1hMLCui3SsG7ByyIv0OU,38669
64
- folio_migration_tools-1.9.0a3.dist-info/LICENSE,sha256=PhIEkitVi3ejgq56tt6sWoJIG_zmv82cjjd_aYPPGdI,1072
65
- folio_migration_tools-1.9.0a3.dist-info/METADATA,sha256=kvLY1YL44A4bSOpnwAoBZ2a5srFhjenC9D1_4ODuCCk,7318
66
- folio_migration_tools-1.9.0a3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
67
- folio_migration_tools-1.9.0a3.dist-info/RECORD,,
63
+ folio_migration_tools-1.9.0a4.dist-info/LICENSE,sha256=PhIEkitVi3ejgq56tt6sWoJIG_zmv82cjjd_aYPPGdI,1072
64
+ folio_migration_tools-1.9.0a4.dist-info/METADATA,sha256=d0X2DDsYyC0_We_jm13ohilfXLQ_ujWVXejh5WThOis,7318
65
+ folio_migration_tools-1.9.0a4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
+ folio_migration_tools-1.9.0a4.dist-info/RECORD,,
@@ -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()