folio-data-import 0.2.0__py3-none-any.whl → 0.2.1__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 folio-data-import might be problematic. Click here for more details.
- folio_data_import/MARCDataImport.py +11 -0
- folio_data_import/UserImport.py +15 -3
- folio_data_import/__main__.py +8 -2
- {folio_data_import-0.2.0.dist-info → folio_data_import-0.2.1.dist-info}/LICENSE +1 -1
- {folio_data_import-0.2.0.dist-info → folio_data_import-0.2.1.dist-info}/METADATA +6 -1
- folio_data_import-0.2.1.dist-info/RECORD +9 -0
- folio_data_import-0.2.0.dist-info/RECORD +0 -9
- {folio_data_import-0.2.0.dist-info → folio_data_import-0.2.1.dist-info}/WHEEL +0 -0
- {folio_data_import-0.2.0.dist-info → folio_data_import-0.2.1.dist-info}/entry_points.txt +0 -0
|
@@ -436,6 +436,12 @@ async def main() -> None:
|
|
|
436
436
|
parser = argparse.ArgumentParser()
|
|
437
437
|
parser.add_argument("--gateway_url", type=str, help="The FOLIO API Gateway URL")
|
|
438
438
|
parser.add_argument("--tenant_id", type=str, help="The FOLIO tenant ID")
|
|
439
|
+
parser.add_argument(
|
|
440
|
+
"--member_tenant_id",
|
|
441
|
+
type=str,
|
|
442
|
+
help="The FOLIO ECS member tenant ID (if applicable)",
|
|
443
|
+
default="",
|
|
444
|
+
)
|
|
439
445
|
parser.add_argument("--username", type=str, help="The FOLIO username")
|
|
440
446
|
parser.add_argument("--password", type=str, help="The FOLIO password", default="")
|
|
441
447
|
parser.add_argument(
|
|
@@ -480,6 +486,11 @@ async def main() -> None:
|
|
|
480
486
|
folio_client = folioclient.FolioClient(
|
|
481
487
|
args.gateway_url, args.tenant_id, args.username, args.password
|
|
482
488
|
)
|
|
489
|
+
|
|
490
|
+
# Set the member tenant id if provided to support FOLIO ECS multi-tenant environments
|
|
491
|
+
if args.member_tenant_id:
|
|
492
|
+
folio_client.okapi_headers["x-okapi-tenant"] = args.member_tenant_id
|
|
493
|
+
|
|
483
494
|
if not args.import_profile_name:
|
|
484
495
|
import_profiles = folio_client.folio_get(
|
|
485
496
|
"/data-import-profiles/jobProfiles",
|
folio_data_import/UserImport.py
CHANGED
|
@@ -243,11 +243,11 @@ class UserImporter: # noqa: R0902
|
|
|
243
243
|
mapped_departments.append(self.department_map[department])
|
|
244
244
|
except KeyError:
|
|
245
245
|
print(
|
|
246
|
-
f'Row {line_number}: Department "{department}" not found, '
|
|
246
|
+
f'Row {line_number}: Department "{department}" not found, ' # noqa: B907
|
|
247
247
|
f"excluding department from user"
|
|
248
248
|
)
|
|
249
249
|
await self.logfile.write(
|
|
250
|
-
f'Row {line_number}: Department "{department}" not found, '
|
|
250
|
+
f'Row {line_number}: Department "{department}" not found, ' # noqa: B907
|
|
251
251
|
f"excluding department from user\n"
|
|
252
252
|
)
|
|
253
253
|
user_obj["departments"] = mapped_departments
|
|
@@ -630,6 +630,11 @@ async def main() -> None:
|
|
|
630
630
|
"""
|
|
631
631
|
parser = argparse.ArgumentParser()
|
|
632
632
|
parser.add_argument("--tenant_id", help="The tenant id")
|
|
633
|
+
parser.add_argument(
|
|
634
|
+
"--member_tenant_id",
|
|
635
|
+
help="The FOLIO ECS member tenant id (if applicable)",
|
|
636
|
+
default="",
|
|
637
|
+
)
|
|
633
638
|
parser.add_argument("--library_name", help="The name of the library")
|
|
634
639
|
parser.add_argument("--username", help="The FOLIO username")
|
|
635
640
|
parser.add_argument("--okapi_url", help="The Okapi URL")
|
|
@@ -672,8 +677,15 @@ async def main() -> None:
|
|
|
672
677
|
args.username,
|
|
673
678
|
args.folio_password
|
|
674
679
|
or os.environ.get("FOLIO_PASS", "")
|
|
675
|
-
or getpass.getpass(
|
|
680
|
+
or getpass.getpass(
|
|
681
|
+
"Enter your FOLIO password: ",
|
|
682
|
+
),
|
|
676
683
|
)
|
|
684
|
+
|
|
685
|
+
# Set the member tenant id if provided to support FOLIO ECS multi-tenant environments
|
|
686
|
+
if args.member_tenant_id:
|
|
687
|
+
folio_client.okapi_headers["x-okapi-tenant"] = args.member_tenant_id
|
|
688
|
+
|
|
677
689
|
user_file_path = Path(args.user_file_path)
|
|
678
690
|
log_file_path = (
|
|
679
691
|
user_file_path.parent.parent
|
folio_data_import/__main__.py
CHANGED
|
@@ -45,7 +45,10 @@ async def main():
|
|
|
45
45
|
parser.add_argument(
|
|
46
46
|
"--consolidate",
|
|
47
47
|
action="store_true",
|
|
48
|
-
help=
|
|
48
|
+
help=(
|
|
49
|
+
"Consolidate records into a single job. "
|
|
50
|
+
"Default is to create a new job for each MARC file."
|
|
51
|
+
),
|
|
49
52
|
)
|
|
50
53
|
parser.add_argument(
|
|
51
54
|
"--no-progress",
|
|
@@ -96,7 +99,10 @@ async def main():
|
|
|
96
99
|
print("Error importing files: " + str(e))
|
|
97
100
|
raise
|
|
98
101
|
elif args.record_type.lower() == "users":
|
|
99
|
-
print(
|
|
102
|
+
print(
|
|
103
|
+
"User import not yet implemented. Run UserImport.py directly "
|
|
104
|
+
"or use folio-user-import CLI."
|
|
105
|
+
)
|
|
100
106
|
else:
|
|
101
107
|
print("Record type not supported. Supported types are: MARC21")
|
|
102
108
|
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: folio_data_import
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A python module to interact with the data importing capabilities of the open-source FOLIO ILS
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Brooks Travis
|
|
@@ -13,6 +13,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
15
|
Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
|
|
16
|
+
Requires-Dist: flake8-bandit (>=4.1.1,<5.0.0)
|
|
17
|
+
Requires-Dist: flake8-black (>=0.3.6,<0.4.0)
|
|
18
|
+
Requires-Dist: flake8-bugbear (>=24.8.19,<25.0.0)
|
|
19
|
+
Requires-Dist: flake8-docstrings (>=1.7.0,<2.0.0)
|
|
20
|
+
Requires-Dist: flake8-isort (>=6.1.1,<7.0.0)
|
|
16
21
|
Requires-Dist: folioclient (>=0.60.5,<0.61.0)
|
|
17
22
|
Requires-Dist: httpx (>=0.23.0,<0.24.0)
|
|
18
23
|
Requires-Dist: inquirer (>=3.4.0,<4.0.0)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
folio_data_import/MARCDataImport.py,sha256=IStQ--WpPtnoPunQLK-LBiWApA1n9PHdKeNaFWk01a0,19478
|
|
2
|
+
folio_data_import/UserImport.py,sha256=XmExJ7VKHsMYRIeoczEzv1F8gnQO6pym_rz1y2KlKn4,27784
|
|
3
|
+
folio_data_import/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
folio_data_import/__main__.py,sha256=kav_uUsnrIjGjVxQkk3exLKrc1mah9t2x3G6bGS-5I0,3710
|
|
5
|
+
folio_data_import-0.2.1.dist-info/LICENSE,sha256=qJX7wxMC7ky9Kq4v3zij8MjGEiC5wsB7pYeOhLj5TDk,1083
|
|
6
|
+
folio_data_import-0.2.1.dist-info/METADATA,sha256=Qh0yMC56C8gsfM7-54hVoUnRcYF-gDsRcPP-A_t2VkQ,2420
|
|
7
|
+
folio_data_import-0.2.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
8
|
+
folio_data_import-0.2.1.dist-info/entry_points.txt,sha256=498SxWVXeEMRNw3PUf-eoReZvKewmYwPBtZhIUPr_Jg,192
|
|
9
|
+
folio_data_import-0.2.1.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
folio_data_import/MARCDataImport.py,sha256=uTgK6jHckVMh3BJycD5uRUpPNjZuppqSjjIm6rPDpSw,19117
|
|
2
|
-
folio_data_import/UserImport.py,sha256=CXdGHJI6NHJuB6yBg9rLZG62NEha2aaK9YKJ6v-4cEw,27390
|
|
3
|
-
folio_data_import/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
folio_data_import/__main__.py,sha256=b-UeuwXjw89i8-ZPJr1ue5qK4bTHSgTAzB_iNjAv5Ls,3634
|
|
5
|
-
folio_data_import-0.2.0.dist-info/LICENSE,sha256=5kxqhOaS2dDgFtPiP_1f9ljqmu7d7FaUWtto6SjrVxE,1082
|
|
6
|
-
folio_data_import-0.2.0.dist-info/METADATA,sha256=pzBoIZrMz2zn8TqkISe-qvpSQVNpAOZXr_SiCI94rAM,2184
|
|
7
|
-
folio_data_import-0.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
8
|
-
folio_data_import-0.2.0.dist-info/entry_points.txt,sha256=498SxWVXeEMRNw3PUf-eoReZvKewmYwPBtZhIUPr_Jg,192
|
|
9
|
-
folio_data_import-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|