folio-data-import 0.5.0b3__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.
@@ -0,0 +1,31 @@
1
+ import importlib.metadata
2
+ import questionary
3
+
4
+
5
+ def get_folio_connection_parameters(
6
+ gateway_url: str | None, tenant_id: str | None, username: str | None, password: str | None
7
+ ) -> tuple[str, str, str, str]:
8
+ """
9
+ Prompt for missing FOLIO connection parameters using interactive input.
10
+
11
+ Parameters:
12
+ gateway_url (str): The FOLIO Gateway URL, or None to prompt for input.
13
+ tenant_id (str): The FOLIO Tenant ID, or None to prompt for input.
14
+ username (str): The FOLIO Username, or None to prompt for input.
15
+ password (str): The FOLIO password, or None to prompt for input.
16
+
17
+ Returns:
18
+ tuple: A tuple containing (gateway_url, tenant_id, username, password).
19
+ """
20
+ if not gateway_url:
21
+ gateway_url = questionary.text("Enter FOLIO Gateway URL:").ask()
22
+ if not tenant_id:
23
+ tenant_id = questionary.text("Enter FOLIO Tenant ID:").ask()
24
+ if not username:
25
+ username = questionary.text("Enter FOLIO Username:").ask()
26
+ if not password:
27
+ password = questionary.password("Enter FOLIO password:").ask()
28
+ return gateway_url, tenant_id, username, password
29
+
30
+
31
+ __version__ = importlib.metadata.version("folio-data-import")
@@ -0,0 +1,14 @@
1
+ import cyclopts
2
+
3
+ from folio_data_import import __version__
4
+
5
+ app = cyclopts.App(version=__version__, default_parameter=cyclopts.Parameter(negative=()))
6
+ app.register_install_completion_command()
7
+
8
+ # Using string-based import paths for commands as required by cyclopts to support dynamic loading.
9
+ app.command("folio_data_import.MARCDataImport:main", name="marc")
10
+ app.command("folio_data_import.UserImport:main", name="users")
11
+ app.command("folio_data_import.BatchPoster:main", name="batch-poster")
12
+
13
+ if __name__ == "__main__":
14
+ app()