From f9ceca418ea29f93d7d3147fe07879f0555d1fdb Mon Sep 17 00:00:00 2001 From: Michael Dockter Date: Fri, 10 Jan 2025 14:09:41 -0500 Subject: [PATCH] #188 Migrate to "Grpc" suffix (#189) * #188 Migrate imports * #188 Migrate imports * #188 Migrate imports * #188 Update requirements * Force re-test * Force re-test * #1 Force re-test * #188 Force re-test * #188 Update version --- CHANGELOG.md | 6 ++ examples/misc/add_truthset_data.py | 12 +-- examples/misc/add_truthset_datasources.py | 7 +- examples/misc/individual_classes.py | 7 +- examples/szabstractfactory/create_config.py | 7 +- .../szabstractfactory/create_configmanager.py | 7 +- .../szabstractfactory/create_diagnostic.py | 7 +- examples/szabstractfactory/create_engine.py | 7 +- examples/szabstractfactory/create_product.py | 7 +- .../initialize_with_config_id.py | 7 +- .../initialize_with_debug.py | 7 +- examples/szabstractfactory/reinitialize.py | 7 +- examples/szconfig/add_data_source.py | 7 +- examples/szconfig/create_and_close.py | 7 +- .../szconfig/create_export_import_close.py | 7 +- examples/szconfig/delete_data_source.py | 7 +- examples/szconfig/export_config.py | 7 +- examples/szconfig/get_data_sources.py | 7 +- examples/szconfig/import_config.py | 7 +- examples/szconfig/szconfig_constructor.py | 7 +- examples/szconfigmanager/add_config.py | 7 +- examples/szconfigmanager/get_config.py | 7 +- examples/szconfigmanager/get_configs.py | 7 +- .../szconfigmanager/get_default_config_id.py | 7 +- .../replace_default_config_id.py | 7 +- .../szconfigmanager/set_default_config_id.py | 7 +- .../szconfigmanager_constructor.py | 7 +- .../check_datastore_performance.py | 7 +- examples/szdiagnostic/get_datastore_info.py | 7 +- examples/szdiagnostic/get_feature.py | 7 +- examples/szdiagnostic/purge_repository.py | 7 +- .../szdiagnostic/szdiagnostic_constructor.py | 7 +- examples/szengine/a_header_szengine.py | 6 +- examples/szengine/add_record.py | 12 +-- examples/szengine/count_redo_records.py | 7 +- examples/szengine/delete_record.py | 12 +-- examples/szengine/export_csv_fetch_close.py | 12 +-- examples/szengine/export_json_fetch_close.py | 12 +-- .../szengine/find_network_by_entity_id.py | 12 +-- .../szengine/find_network_by_record_id.py | 12 +-- examples/szengine/find_path_by_entity_id.py | 12 +-- examples/szengine/find_path_by_record_id.py | 12 +-- examples/szengine/get_active_config_id.py | 7 +- examples/szengine/get_entity_by_entity_id.py | 12 +-- examples/szengine/get_entity_by_record_id.py | 12 +-- examples/szengine/get_record.py | 12 +-- examples/szengine/get_redo_record.py | 7 +- examples/szengine/get_stats.py | 7 +- .../get_virtual_entity_by_record_id.py | 12 +-- examples/szengine/how_entity_by_entity_id.py | 12 +-- examples/szengine/preprocess_record.py | 12 +-- examples/szengine/prime_engine.py | 7 +- examples/szengine/process_redo_record.py | 12 +-- examples/szengine/reevaluate_entity.py | 12 +-- examples/szengine/reevaluate_record.py | 12 +-- examples/szengine/search_by_attributes.py | 12 +-- examples/szengine/szengine_constructor.py | 7 +- examples/szengine/why_entities.py | 12 +-- examples/szengine/why_record_in_entity.py | 12 +-- examples/szengine/why_records.py | 12 +-- examples/szproduct/get_license.py | 7 +- examples/szproduct/get_version.py | 7 +- examples/szproduct/szproduct_constructor.py | 7 +- requirements.txt | 2 +- setup.cfg | 2 +- src/senzing_grpc/__init__.py | 79 +++---------------- src/senzing_grpc/szabstractfactory.py | 30 ++++--- src/senzing_grpc/szconfig.py | 6 +- src/senzing_grpc/szconfigmanager.py | 6 +- src/senzing_grpc/szdiagnostic.py | 6 +- src/senzing_grpc/szengine.py | 6 +- src/senzing_grpc/szhelpers.py | 2 +- src/senzing_grpc/szproduct.py | 6 +- tests/szabstractfactory_test.py | 14 ++-- tests/szconfig_test.py | 9 ++- tests/szconfigmanager_test.py | 15 ++-- tests/szdiagnostic_test.py | 11 +-- tests/szengine_test.py | 29 +++---- tests/szproduct_test.py | 9 ++- 79 files changed, 348 insertions(+), 433 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86099ec..e70d6e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning]. ## [Unreleased] +## [0.4.0] - 2025-01-10 + +### Changed in 0.4.0 + +- Rename class names. Example: from `SzAbstractFactory` to `SzAbstractFactoryGrpc` + ## [0.3.8] - 2024-12-04 ### Added in 0.3.8 diff --git a/examples/misc/add_truthset_data.py b/examples/misc/add_truthset_data.py index a095f6e..6d4c0e6 100644 --- a/examples/misc/add_truthset_data.py +++ b/examples/misc/add_truthset_data.py @@ -1,25 +1,21 @@ #! /usr/bin/env python3 import grpc +from senzing import SZ_WITHOUT_INFO, SzError from senzing_truthset import ( TRUTHSET_CUSTOMER_RECORDS, TRUTHSET_REFERENCE_RECORDS, TRUTHSET_WATCHLIST_RECORDS, ) -from senzing_grpc import ( - SZ_WITHOUT_INFO, - SzAbstractFactory, - SzAbstractFactoryParameters, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() record_sets = [ TRUTHSET_CUSTOMER_RECORDS, diff --git a/examples/misc/add_truthset_datasources.py b/examples/misc/add_truthset_datasources.py index 2c38427..77e5a06 100644 --- a/examples/misc/add_truthset_datasources.py +++ b/examples/misc/add_truthset_datasources.py @@ -1,16 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError from senzing_truthset import TRUTHSET_DATASOURCES -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() sz_configmanager = sz_abstract_factory.create_configmanager() sz_diagnostic = sz_abstract_factory.create_diagnostic() diff --git a/examples/misc/individual_classes.py b/examples/misc/individual_classes.py index 763a242..8e2978b 100644 --- a/examples/misc/individual_classes.py +++ b/examples/misc/individual_classes.py @@ -2,6 +2,7 @@ import grpc from senzing import ( + SzAbstractFactory, SzConfig, SzConfigManager, SzDiagnostic, @@ -10,9 +11,9 @@ SzProduct, ) -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } @@ -48,7 +49,7 @@ def try_sz_product(sz_product_local: SzProduct) -> None: try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() sz_configmanager = sz_abstract_factory.create_configmanager() sz_diagnostic = sz_abstract_factory.create_diagnostic() diff --git a/examples/szabstractfactory/create_config.py b/examples/szabstractfactory/create_config.py index 07a6b46..9a0b64b 100755 --- a/examples/szabstractfactory/create_config.py +++ b/examples/szabstractfactory/create_config.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szabstractfactory/create_configmanager.py b/examples/szabstractfactory/create_configmanager.py index ba8d80d..3f4596f 100755 --- a/examples/szabstractfactory/create_configmanager.py +++ b/examples/szabstractfactory/create_configmanager.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_configmanager = sz_abstract_factory.create_configmanager() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szabstractfactory/create_diagnostic.py b/examples/szabstractfactory/create_diagnostic.py index 0ee79d8..c4a4057 100755 --- a/examples/szabstractfactory/create_diagnostic.py +++ b/examples/szabstractfactory/create_diagnostic.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_diagnostic = sz_abstract_factory.create_diagnostic() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szabstractfactory/create_engine.py b/examples/szabstractfactory/create_engine.py index bc7c36e..6d3ece8 100755 --- a/examples/szabstractfactory/create_engine.py +++ b/examples/szabstractfactory/create_engine.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szabstractfactory/create_product.py b/examples/szabstractfactory/create_product.py index 0e56ce4..f240fa2 100755 --- a/examples/szabstractfactory/create_product.py +++ b/examples/szabstractfactory/create_product.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_product = sz_abstract_factory.create_product() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szabstractfactory/initialize_with_config_id.py b/examples/szabstractfactory/initialize_with_config_id.py index 72b9683..4b6aba7 100644 --- a/examples/szabstractfactory/initialize_with_config_id.py +++ b/examples/szabstractfactory/initialize_with_config_id.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_configmanager = sz_abstract_factory.create_configmanager() config_id = sz_configmanager.get_default_config_id() sz_abstract_factory.reinitialize(config_id) diff --git a/examples/szabstractfactory/initialize_with_debug.py b/examples/szabstractfactory/initialize_with_debug.py index 31f431f..ac4f2af 100644 --- a/examples/szabstractfactory/initialize_with_debug.py +++ b/examples/szabstractfactory/initialize_with_debug.py @@ -1,14 +1,15 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szabstractfactory/reinitialize.py b/examples/szabstractfactory/reinitialize.py index f30d5e9..5104d10 100644 --- a/examples/szabstractfactory/reinitialize.py +++ b/examples/szabstractfactory/reinitialize.py @@ -1,16 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: # Using get_active_config_id for demonstrations purposes. - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() config_id = sz_engine.get_active_config_id() sz_abstract_factory.reinitialize(config_id) diff --git a/examples/szconfig/add_data_source.py b/examples/szconfig/add_data_source.py index 8e91a9a..e21830b 100755 --- a/examples/szconfig/add_data_source.py +++ b/examples/szconfig/add_data_source.py @@ -1,16 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "NAME_OF_DATASOURCE" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() config_handle = sz_config.create_config() RESULT = sz_config.add_data_source(config_handle, DATA_SOURCE_CODE) diff --git a/examples/szconfig/create_and_close.py b/examples/szconfig/create_and_close.py index e1c5245..8058c2a 100755 --- a/examples/szconfig/create_and_close.py +++ b/examples/szconfig/create_and_close.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() config_handle = sz_config.create_config() diff --git a/examples/szconfig/create_export_import_close.py b/examples/szconfig/create_export_import_close.py index c0a205c..5163053 100755 --- a/examples/szconfig/create_export_import_close.py +++ b/examples/szconfig/create_export_import_close.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() config_handle_1 = sz_config.create_config() # Create first in-memory. CONFIG_DEFINITION = sz_config.export_config(config_handle_1) # Save in-memory to string. diff --git a/examples/szconfig/delete_data_source.py b/examples/szconfig/delete_data_source.py index a9e8224..56e154f 100755 --- a/examples/szconfig/delete_data_source.py +++ b/examples/szconfig/delete_data_source.py @@ -1,16 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "TEST" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() config_handle = sz_config.create_config() sz_config.delete_data_source(config_handle, DATA_SOURCE_CODE) diff --git a/examples/szconfig/export_config.py b/examples/szconfig/export_config.py index 3a09fd3..9677346 100755 --- a/examples/szconfig/export_config.py +++ b/examples/szconfig/export_config.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() config_handle = sz_config.create_config() # Create first in-memory. CONFIG_DEFINITION = sz_config.export_config(config_handle) # Save in-memory to string. diff --git a/examples/szconfig/get_data_sources.py b/examples/szconfig/get_data_sources.py index d443f32..fd59c05 100755 --- a/examples/szconfig/get_data_sources.py +++ b/examples/szconfig/get_data_sources.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() config_handle = sz_config.create_config() RESULT = sz_config.get_data_sources(config_handle) diff --git a/examples/szconfig/import_config.py b/examples/szconfig/import_config.py index 5d09941..f217a93 100755 --- a/examples/szconfig/import_config.py +++ b/examples/szconfig/import_config.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() sz_configmanager = sz_abstract_factory.create_configmanager() config_id = sz_configmanager.get_default_config_id() diff --git a/examples/szconfig/szconfig_constructor.py b/examples/szconfig/szconfig_constructor.py index 07a6b46..9a0b64b 100755 --- a/examples/szconfig/szconfig_constructor.py +++ b/examples/szconfig/szconfig_constructor.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szconfigmanager/add_config.py b/examples/szconfigmanager/add_config.py index c641024..184d968 100755 --- a/examples/szconfigmanager/add_config.py +++ b/examples/szconfigmanager/add_config.py @@ -1,16 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc CONFIG_COMMENT = "Just an empty example" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() sz_configmanager = sz_abstract_factory.create_configmanager() config_handle = sz_config.create_config() diff --git a/examples/szconfigmanager/get_config.py b/examples/szconfigmanager/get_config.py index ec24345..1a66770 100755 --- a/examples/szconfigmanager/get_config.py +++ b/examples/szconfigmanager/get_config.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_configmanager = sz_abstract_factory.create_configmanager() config_id = sz_configmanager.get_default_config_id() CONFIG_DEFINITION = sz_configmanager.get_config(config_id) diff --git a/examples/szconfigmanager/get_configs.py b/examples/szconfigmanager/get_configs.py index f118aa5..1257c76 100755 --- a/examples/szconfigmanager/get_configs.py +++ b/examples/szconfigmanager/get_configs.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_configmanager = sz_abstract_factory.create_configmanager() CONFIG_LIST = sz_configmanager.get_configs() print(f"\nFile {__file__}:\n{CONFIG_LIST}\n") diff --git a/examples/szconfigmanager/get_default_config_id.py b/examples/szconfigmanager/get_default_config_id.py index f1ebee2..1c3b09f 100755 --- a/examples/szconfigmanager/get_default_config_id.py +++ b/examples/szconfigmanager/get_default_config_id.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_configmanager = sz_abstract_factory.create_configmanager() CONFIG_ID = sz_configmanager.get_default_config_id() print(f"\nFile {__file__}:\n{CONFIG_ID}\n") diff --git a/examples/szconfigmanager/replace_default_config_id.py b/examples/szconfigmanager/replace_default_config_id.py index bbdc374..7c9f9c4 100755 --- a/examples/szconfigmanager/replace_default_config_id.py +++ b/examples/szconfigmanager/replace_default_config_id.py @@ -3,17 +3,18 @@ import time import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc CONFIG_COMMENT = "Just an example" DATA_SOURCE_CODE = f"REPLACE_DEFAULT_CONFIG_ID_{time.time()}" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() sz_configmanager = sz_abstract_factory.create_configmanager() current_default_config_id = sz_configmanager.get_default_config_id() diff --git a/examples/szconfigmanager/set_default_config_id.py b/examples/szconfigmanager/set_default_config_id.py index 929f2a4..e5eb29b 100755 --- a/examples/szconfigmanager/set_default_config_id.py +++ b/examples/szconfigmanager/set_default_config_id.py @@ -3,17 +3,18 @@ import time import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc CONFIG_COMMENT = "Just an example" DATA_SOURCE_CODE = f"REPLACE_DEFAULT_CONFIG_ID_{time.time()}" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_config = sz_abstract_factory.create_config() sz_configmanager = sz_abstract_factory.create_configmanager() old_config_id = sz_configmanager.get_default_config_id() diff --git a/examples/szconfigmanager/szconfigmanager_constructor.py b/examples/szconfigmanager/szconfigmanager_constructor.py index ba8d80d..3f4596f 100755 --- a/examples/szconfigmanager/szconfigmanager_constructor.py +++ b/examples/szconfigmanager/szconfigmanager_constructor.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_configmanager = sz_abstract_factory.create_configmanager() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szdiagnostic/check_datastore_performance.py b/examples/szdiagnostic/check_datastore_performance.py index 3ffcd4a..6f72d63 100755 --- a/examples/szdiagnostic/check_datastore_performance.py +++ b/examples/szdiagnostic/check_datastore_performance.py @@ -1,16 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } SECONDS_TO_RUN = 3 try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_diagnostic = sz_abstract_factory.create_diagnostic() RESULT = sz_diagnostic.check_datastore_performance(SECONDS_TO_RUN) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szdiagnostic/get_datastore_info.py b/examples/szdiagnostic/get_datastore_info.py index 38357ee..f5e2cc4 100755 --- a/examples/szdiagnostic/get_datastore_info.py +++ b/examples/szdiagnostic/get_datastore_info.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_diagnostic = sz_abstract_factory.create_diagnostic() RESULT = sz_diagnostic.get_datastore_info() print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szdiagnostic/get_feature.py b/examples/szdiagnostic/get_feature.py index f27160c..20bf46e 100644 --- a/examples/szdiagnostic/get_feature.py +++ b/examples/szdiagnostic/get_feature.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_diagnostic = sz_abstract_factory.create_diagnostic() RESULT = sz_diagnostic.get_feature(1) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szdiagnostic/purge_repository.py b/examples/szdiagnostic/purge_repository.py index fd08095..462a947 100644 --- a/examples/szdiagnostic/purge_repository.py +++ b/examples/szdiagnostic/purge_repository.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_diagnostic = sz_abstract_factory.create_diagnostic() # WARNING # WARNING - This will remove all loaded and entity resolved data from the Senzing repository, use with caution! diff --git a/examples/szdiagnostic/szdiagnostic_constructor.py b/examples/szdiagnostic/szdiagnostic_constructor.py index 0ee79d8..c4a4057 100755 --- a/examples/szdiagnostic/szdiagnostic_constructor.py +++ b/examples/szdiagnostic/szdiagnostic_constructor.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_diagnostic = sz_abstract_factory.create_diagnostic() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szengine/a_header_szengine.py b/examples/szengine/a_header_szengine.py index 5d960f6..c20d987 100644 --- a/examples/szengine/a_header_szengine.py +++ b/examples/szengine/a_header_szengine.py @@ -14,14 +14,14 @@ TRUTHSET_WATCHLIST_RECORDS, ) -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCES = { "CUSTOMERS": TRUTHSET_CUSTOMER_RECORDS, "REFERENCE": TRUTHSET_REFERENCE_RECORDS, "WATCHLIST": TRUTHSET_WATCHLIST_RECORDS, } -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } @@ -58,6 +58,6 @@ def add_records(sz_engine_local: SzEngine, record_id_list: List[Tuple[str, str]] print("\n---- szengine --------------------------------------------------------\n") -sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) +sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() add_records(sz_engine, TEST_RECORDS) diff --git a/examples/szengine/add_record.py b/examples/szengine/add_record.py index a5f3d74..e4c1773 100755 --- a/examples/szengine/add_record.py +++ b/examples/szengine/add_record.py @@ -2,16 +2,12 @@ import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "TEST" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WITH_INFO @@ -34,7 +30,7 @@ RECORD_ID = "1" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.add_record(DATA_SOURCE_CODE, RECORD_ID, RECORD_DEFINITION, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/count_redo_records.py b/examples/szengine/count_redo_records.py index b0b6e66..18843fa 100755 --- a/examples/szengine/count_redo_records.py +++ b/examples/szengine/count_redo_records.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.count_redo_records() print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/delete_record.py b/examples/szengine/delete_record.py index 0bb2a98..535db17 100755 --- a/examples/szengine/delete_record.py +++ b/examples/szengine/delete_record.py @@ -1,23 +1,19 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "TEST" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WITH_INFO RECORD_ID = "1" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.delete_record(DATA_SOURCE_CODE, RECORD_ID, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/export_csv_fetch_close.py b/examples/szengine/export_csv_fetch_close.py index 02b95ac..7cb25bc 100755 --- a/examples/szengine/export_csv_fetch_close.py +++ b/examples/szengine/export_csv_fetch_close.py @@ -1,24 +1,20 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc CSV_COLUMN_LIST = ( "RESOLVED_ENTITY_ID,RELATED_ENTITY_ID,RESOLVED_ENTITY_NAME,MATCH_LEVEL,MATCH_KEY,DATA_SOURCE,RECORD_ID" ) -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() export_handle = sz_engine.export_csv_entity_report(CSV_COLUMN_LIST, FLAGS) RESULT = "" diff --git a/examples/szengine/export_json_fetch_close.py b/examples/szengine/export_json_fetch_close.py index a8b05fc..1fae9d6 100755 --- a/examples/szengine/export_json_fetch_close.py +++ b/examples/szengine/export_json_fetch_close.py @@ -1,21 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() export_handle = sz_engine.export_json_entity_report(FLAGS) RESULT = "" diff --git a/examples/szengine/find_network_by_entity_id.py b/examples/szengine/find_network_by_entity_id.py index 0f135b3..474352f 100755 --- a/examples/szengine/find_network_by_entity_id.py +++ b/examples/szengine/find_network_by_entity_id.py @@ -1,17 +1,13 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc BUILD_OUT_DEGREES = 1 ENTITY_LIST = [1, 4] -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS @@ -19,7 +15,7 @@ MAX_ENTITIES = 10 try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.find_network_by_entity_id(ENTITY_LIST, MAX_DEGREES, BUILD_OUT_DEGREES, MAX_ENTITIES, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/find_network_by_record_id.py b/examples/szengine/find_network_by_record_id.py index 6ebb02d..8cd2312 100755 --- a/examples/szengine/find_network_by_record_id.py +++ b/examples/szengine/find_network_by_record_id.py @@ -1,16 +1,12 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc BUILD_OUT_DEGREES = 1 -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS @@ -19,7 +15,7 @@ RECORD_LIST = [("CUSTOMERS", "1001"), ("CUSTOMERS", "1009")] try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.find_network_by_record_id(RECORD_LIST, MAX_DEGREES, BUILD_OUT_DEGREES, MAX_ENTITIES, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/find_path_by_entity_id.py b/examples/szengine/find_path_by_entity_id.py index c2d357a..70b4d42 100755 --- a/examples/szengine/find_path_by_entity_id.py +++ b/examples/szengine/find_path_by_entity_id.py @@ -3,17 +3,13 @@ from typing import List import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc AVOID_ENTITY_IDS: List[int] = [] END_ENTITY_ID = 4 -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS @@ -22,7 +18,7 @@ START_ENTITY_ID = 1 try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.find_path_by_entity_id( START_ENTITY_ID, diff --git a/examples/szengine/find_path_by_record_id.py b/examples/szengine/find_path_by_record_id.py index 544ca7f..b43bc58 100755 --- a/examples/szengine/find_path_by_record_id.py +++ b/examples/szengine/find_path_by_record_id.py @@ -3,18 +3,14 @@ from typing import List, Tuple import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc AVOID_RECORD_KEYS: List[Tuple[str, str]] = [] END_DATA_SOURCE_CODE = "CUSTOMERS" END_RECORD_ID = "1009" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS @@ -24,7 +20,7 @@ START_RECORD_ID = "1001" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.find_path_by_record_id( START_DATA_SOURCE_CODE, diff --git a/examples/szengine/get_active_config_id.py b/examples/szengine/get_active_config_id.py index 546dce0..b5b41a4 100755 --- a/examples/szengine/get_active_config_id.py +++ b/examples/szengine/get_active_config_id.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.get_active_config_id() print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/get_entity_by_entity_id.py b/examples/szengine/get_entity_by_entity_id.py index 613e04d..f2c3739 100755 --- a/examples/szengine/get_entity_by_entity_id.py +++ b/examples/szengine/get_entity_by_entity_id.py @@ -1,22 +1,18 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc ENTITY_ID = 1 -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.get_entity_by_entity_id(ENTITY_ID, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/get_entity_by_record_id.py b/examples/szengine/get_entity_by_record_id.py index b431c01..70a04fb 100755 --- a/examples/szengine/get_entity_by_record_id.py +++ b/examples/szengine/get_entity_by_record_id.py @@ -1,23 +1,19 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "CUSTOMERS" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS RECORD_ID = "1001" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.get_entity_by_record_id(DATA_SOURCE_CODE, RECORD_ID, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/get_record.py b/examples/szengine/get_record.py index 3493fee..1d41022 100755 --- a/examples/szengine/get_record.py +++ b/examples/szengine/get_record.py @@ -1,23 +1,19 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "CUSTOMERS" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS RECORD_ID = "1001" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.get_record(DATA_SOURCE_CODE, RECORD_ID, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/get_redo_record.py b/examples/szengine/get_redo_record.py index 8d9de2c..f558a7e 100755 --- a/examples/szengine/get_redo_record.py +++ b/examples/szengine/get_redo_record.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.get_redo_record() print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/get_stats.py b/examples/szengine/get_stats.py index 8c555f9..0e9f6c4 100755 --- a/examples/szengine/get_stats.py +++ b/examples/szengine/get_stats.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.get_stats() print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/get_virtual_entity_by_record_id.py b/examples/szengine/get_virtual_entity_by_record_id.py index 6e73cc7..2a7f574 100755 --- a/examples/szengine/get_virtual_entity_by_record_id.py +++ b/examples/szengine/get_virtual_entity_by_record_id.py @@ -1,15 +1,11 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_VIRTUAL_ENTITY_DEFAULT_FLAGS @@ -19,7 +15,7 @@ ] try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.get_virtual_entity_by_record_id(RECORD_LIST, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/how_entity_by_entity_id.py b/examples/szengine/how_entity_by_entity_id.py index 7c5a7f1..89346fd 100755 --- a/examples/szengine/how_entity_by_entity_id.py +++ b/examples/szengine/how_entity_by_entity_id.py @@ -1,22 +1,18 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc ENTITY_ID = 1 -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.how_entity_by_entity_id(ENTITY_ID, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/preprocess_record.py b/examples/szengine/preprocess_record.py index 47d3dba..aa1c47d 100644 --- a/examples/szengine/preprocess_record.py +++ b/examples/szengine/preprocess_record.py @@ -1,15 +1,11 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS @@ -31,7 +27,7 @@ ) try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.preprocess_record(RECORD_DEFINITION, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/prime_engine.py b/examples/szengine/prime_engine.py index 042249e..7cc7698 100755 --- a/examples/szengine/prime_engine.py +++ b/examples/szengine/prime_engine.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() sz_engine.prime_engine() except SzError as err: diff --git a/examples/szengine/process_redo_record.py b/examples/szengine/process_redo_record.py index d62ebee..f74f6af 100755 --- a/examples/szengine/process_redo_record.py +++ b/examples/szengine/process_redo_record.py @@ -1,21 +1,17 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WITH_INFO try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() while sz_engine.count_redo_records() > 0: REDO_RECORD = sz_engine.get_redo_record() diff --git a/examples/szengine/reevaluate_entity.py b/examples/szengine/reevaluate_entity.py index 2968f22..efbb8cb 100755 --- a/examples/szengine/reevaluate_entity.py +++ b/examples/szengine/reevaluate_entity.py @@ -1,22 +1,18 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc ENTITY_ID = 1 -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WITH_INFO try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.reevaluate_entity(ENTITY_ID, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/reevaluate_record.py b/examples/szengine/reevaluate_record.py index a345dd6..3b78f8c 100644 --- a/examples/szengine/reevaluate_record.py +++ b/examples/szengine/reevaluate_record.py @@ -1,23 +1,19 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "CUSTOMERS" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WITH_INFO RECORD_ID = "1001" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.reevaluate_record(DATA_SOURCE_CODE, RECORD_ID, FLAGS) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/search_by_attributes.py b/examples/szengine/search_by_attributes.py index f1689a5..3eff384 100755 --- a/examples/szengine/search_by_attributes.py +++ b/examples/szengine/search_by_attributes.py @@ -3,23 +3,19 @@ import json import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc ATTRIBUTES = json.dumps({"NAME_FULL": "BOB SMITH", "EMAIL_ADDRESS": "bsmith@work.com"}) -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS SEARCH_PROFILE = "" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.search_by_attributes(ATTRIBUTES, FLAGS, SEARCH_PROFILE) print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szengine/szengine_constructor.py b/examples/szengine/szengine_constructor.py index bc7c36e..6d3ece8 100755 --- a/examples/szengine/szengine_constructor.py +++ b/examples/szengine/szengine_constructor.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/examples/szengine/why_entities.py b/examples/szengine/why_entities.py index aa1fbc5..433b3bb 100755 --- a/examples/szengine/why_entities.py +++ b/examples/szengine/why_entities.py @@ -1,23 +1,19 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc ENTITY_ID_1 = 1 ENTITY_ID_2 = 4 -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.why_entities( ENTITY_ID_1, diff --git a/examples/szengine/why_record_in_entity.py b/examples/szengine/why_record_in_entity.py index 313015a..f00b42c 100755 --- a/examples/szengine/why_record_in_entity.py +++ b/examples/szengine/why_record_in_entity.py @@ -1,23 +1,19 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE = "CUSTOMERS" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS RECORD_ID = "1001" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.why_record_in_entity( DATA_SOURCE_CODE, diff --git a/examples/szengine/why_records.py b/examples/szengine/why_records.py index e0da9bd..0236e2f 100755 --- a/examples/szengine/why_records.py +++ b/examples/szengine/why_records.py @@ -1,17 +1,13 @@ #! /usr/bin/env python3 import grpc +from senzing import SzEngineFlags, SzError -from senzing_grpc import ( - SzAbstractFactory, - SzAbstractFactoryParameters, - SzEngineFlags, - SzError, -) +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc DATA_SOURCE_CODE_1 = "CUSTOMERS" DATA_SOURCE_CODE_2 = "CUSTOMERS" -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } FLAGS = SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS @@ -19,7 +15,7 @@ RECORD_ID_2 = "1002" try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_engine = sz_abstract_factory.create_engine() RESULT = sz_engine.why_records( DATA_SOURCE_CODE_1, diff --git a/examples/szproduct/get_license.py b/examples/szproduct/get_license.py index 429e60b..33e544f 100755 --- a/examples/szproduct/get_license.py +++ b/examples/szproduct/get_license.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_product = sz_abstract_factory.create_product() RESULT = sz_product.get_license() print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szproduct/get_version.py b/examples/szproduct/get_version.py index b7b0953..e980b10 100755 --- a/examples/szproduct/get_version.py +++ b/examples/szproduct/get_version.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_product = sz_abstract_factory.create_product() RESULT = sz_product.get_version() print(f"\nFile {__file__}:\n{RESULT}\n") diff --git a/examples/szproduct/szproduct_constructor.py b/examples/szproduct/szproduct_constructor.py index 0e56ce4..f240fa2 100755 --- a/examples/szproduct/szproduct_constructor.py +++ b/examples/szproduct/szproduct_constructor.py @@ -1,15 +1,16 @@ #! /usr/bin/env python3 import grpc +from senzing import SzError -from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters, SzError +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } try: - sz_abstract_factory = SzAbstractFactory(**FACTORY_PARAMETERS) + sz_abstract_factory = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) sz_product = sz_abstract_factory.create_product() except SzError as err: print(f"\nFile {__file__}:\nError:\n{err}\n") diff --git a/requirements.txt b/requirements.txt index 7064987..dd997f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ grpcio==1.69.0 protobuf==5.29.3 -senzing==0.2.0 +senzing==0.2.1 diff --git a/setup.cfg b/setup.cfg index 560a96f..b2ea302 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = senzing_grpc -version = 0.3.8 +version = 0.4.0 author = senzing author_email = support@senzing.com description = Senzing Python SDK over gRPC diff --git a/src/senzing_grpc/__init__.py b/src/senzing_grpc/__init__.py index a04aa13..26b622a 100644 --- a/src/senzing_grpc/__init__.py +++ b/src/senzing_grpc/__init__.py @@ -1,69 +1,16 @@ -from senzing import ( - ENGINE_EXCEPTION_MAP, - SZ_INITIALIZE_WITH_DEFAULT_CONFIGURATION, - SZ_NO_ATTRIBUTES, - SZ_NO_AVOIDANCES, - SZ_NO_FLAGS, - SZ_NO_LOGGING, - SZ_NO_REQUIRED_DATASOURCES, - SZ_NO_SEARCH_PROFILE, - SZ_VERBOSE_LOGGING, - SZ_WITHOUT_INFO, - SzBadInputError, - SzConfigurationError, - SzDatabaseConnectionLostError, - SzDatabaseError, - SzEngineFlags, - SzError, - SzLicenseError, - SzNotFoundError, - SzNotInitializedError, - SzReplaceConflictError, - SzRetryableError, - SzRetryTimeoutExceededError, - SzUnhandledError, - SzUnknownDataSourceError, - SzUnrecoverableError, -) - -from .szabstractfactory import SzAbstractFactory, SzAbstractFactoryParameters -from .szconfig import SzConfig -from .szconfigmanager import SzConfigManager -from .szdiagnostic import SzDiagnostic -from .szengine import SzEngine -from .szproduct import SzProduct +from .szabstractfactory import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc +from .szconfig import SzConfigGrpc +from .szconfigmanager import SzConfigManagerGrpc +from .szdiagnostic import SzDiagnosticGrpc +from .szengine import SzEngineGrpc +from .szproduct import SzProductGrpc __all__ = [ - "ENGINE_EXCEPTION_MAP", - "SZ_INITIALIZE_WITH_DEFAULT_CONFIGURATION", - "SZ_NO_ATTRIBUTES", - "SZ_NO_AVOIDANCES", - "SZ_NO_FLAGS", - "SZ_NO_LOGGING", - "SZ_NO_REQUIRED_DATASOURCES", - "SZ_NO_SEARCH_PROFILE", - "SZ_VERBOSE_LOGGING", - "SZ_WITHOUT_INFO", - "SzAbstractFactory", - "SzAbstractFactoryParameters", - "SzBadInputError", - "SzConfig", - "SzConfigManager", - "SzConfigurationError", - "SzDatabaseConnectionLostError", - "SzDatabaseError", - "SzDiagnostic", - "SzEngine", - "SzEngineFlags", - "SzError", - "SzLicenseError", - "SzNotFoundError", - "SzNotInitializedError", - "SzProduct", - "SzReplaceConflictError", - "SzRetryableError", - "SzRetryTimeoutExceededError", - "SzUnhandledError", - "SzUnknownDataSourceError", - "SzUnrecoverableError", + "SzAbstractFactoryGrpc", + "SzAbstractFactoryParametersGrpc", + "SzConfigGrpc", + "SzConfigManagerGrpc", + "SzDiagnosticGrpc", + "SzEngineGrpc", + "SzProductGrpc", ] diff --git a/src/senzing_grpc/szabstractfactory.py b/src/senzing_grpc/szabstractfactory.py index 7b358ab..de40695 100644 --- a/src/senzing_grpc/szabstractfactory.py +++ b/src/senzing_grpc/szabstractfactory.py @@ -10,21 +10,27 @@ from typing import Any, Type, TypedDict, Union import grpc -from senzing import SzAbstractFactory as SzAbstractFactoryAbstract -from senzing import SzConfig, SzConfigManager, SzDiagnostic, SzEngine, SzProduct - -from .szconfig import SzConfig as SzConfigGrpc -from .szconfigmanager import SzConfigManager as SzConfigManagerGrpc -from .szdiagnostic import SzDiagnostic as SzDiagnosticGrpc -from .szengine import SzEngine as SzEngineGrpc -from .szproduct import SzProduct as SzProductGrpc +from senzing import ( + SzAbstractFactory, + SzConfig, + SzConfigManager, + SzDiagnostic, + SzEngine, + SzProduct, +) + +from .szconfig import SzConfigGrpc +from .szconfigmanager import SzConfigManagerGrpc +from .szdiagnostic import SzDiagnosticGrpc +from .szengine import SzEngineGrpc +from .szproduct import SzProductGrpc # Metadata -__all__ = ["SzAbstractFactory"] +__all__ = ["SzAbstractFactoryGrpc", "SzAbstractFactoryParametersGrpc"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ __date__ = "2023-11-27" -__updated__ = "2024-10-24" +__updated__ = "2025-01-10" # ----------------------------------------------------------------------------- @@ -32,7 +38,7 @@ # ----------------------------------------------------------------------------- -class SzAbstractFactoryParameters(TypedDict, total=False): +class SzAbstractFactoryParametersGrpc(TypedDict, total=False): """ SzAbstractFactoryParameters is used to create a dictionary that can be unpacked when creating an SzAbstractFactory. """ @@ -45,7 +51,7 @@ class SzAbstractFactoryParameters(TypedDict, total=False): # ----------------------------------------------------------------------------- -class SzAbstractFactory(SzAbstractFactoryAbstract): +class SzAbstractFactoryGrpc(SzAbstractFactory): """ SzAbstractFactory module is a factory pattern for accessing Senzing over gRPC. """ diff --git a/src/senzing_grpc/szconfig.py b/src/senzing_grpc/szconfig.py index 44a42c3..77f90d1 100644 --- a/src/senzing_grpc/szconfig.py +++ b/src/senzing_grpc/szconfig.py @@ -17,10 +17,10 @@ # Metadata -__all__ = ["SzConfig"] +__all__ = ["SzConfigGrpc"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ __date__ = "2023-11-27" -__updated__ = "2024-07-30" +__updated__ = "2025-01-10" SENZING_PRODUCT_ID = ( "5050" # See https://github.com/senzing-garage/knowledge-base/blob/main/lists/senzing-component-ids.md @@ -31,7 +31,7 @@ # ----------------------------------------------------------------------------- -class SzConfig(SzConfigAbstract): +class SzConfigGrpc(SzConfigAbstract): """ SzConfig module access library over gRPC. """ diff --git a/src/senzing_grpc/szconfigmanager.py b/src/senzing_grpc/szconfigmanager.py index b78b589..65ba4ee 100644 --- a/src/senzing_grpc/szconfigmanager.py +++ b/src/senzing_grpc/szconfigmanager.py @@ -19,10 +19,10 @@ # Metadata -__all__ = ["SzConfigManager"] +__all__ = ["SzConfigManagerGrpc"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ __date__ = "2023-11-27" -__updated__ = "2024-07-30" +__updated__ = "2025-01-10" SENZING_PRODUCT_ID = ( "5051" # See https://github.com/senzing-garage/knowledge-base/blob/main/lists/senzing-component-ids.md @@ -33,7 +33,7 @@ # ----------------------------------------------------------------------------- -class SzConfigManager(SzConfigManagerAbstract): +class SzConfigManagerGrpc(SzConfigManagerAbstract): """ SzConfigManager module access library over gRPC. """ diff --git a/src/senzing_grpc/szdiagnostic.py b/src/senzing_grpc/szdiagnostic.py index 0026dc3..4a5e608 100644 --- a/src/senzing_grpc/szdiagnostic.py +++ b/src/senzing_grpc/szdiagnostic.py @@ -17,10 +17,10 @@ # Metadata -__all__ = ["SzDiagnostic"] +__all__ = ["SzDiagnosticGrpc"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ __date__ = "2023-11-27" -__updated__ = "2024-07-30" +__updated__ = "2025-01-10" SENZING_PRODUCT_ID = ( "5052" # See https://github.com/senzing-garage/knowledge-base/blob/main/lists/senzing-component-ids.md @@ -31,7 +31,7 @@ # ----------------------------------------------------------------------------- -class SzDiagnostic(SzDiagnosticAbstract): +class SzDiagnosticGrpc(SzDiagnosticAbstract): """ SzDiagnostic module access library over gRPC. """ diff --git a/src/senzing_grpc/szengine.py b/src/senzing_grpc/szengine.py index b858a07..267cf8a 100644 --- a/src/senzing_grpc/szengine.py +++ b/src/senzing_grpc/szengine.py @@ -19,10 +19,10 @@ # Metadata -__all__ = ["SzEngine"] +__all__ = ["SzEngineGrpc"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ __date__ = "2023-11-27" -__updated__ = "2024-07-30" +__updated__ = "2025-01-10" SENZING_PRODUCT_ID = ( "5053" # See https://github.com/senzing-garage/knowledge-base/blob/main/lists/senzing-component-ids.md @@ -33,7 +33,7 @@ # ----------------------------------------------------------------------------- -class SzEngine(SzEngineAbstract): +class SzEngineGrpc(SzEngineAbstract): """ Sz engine module access library over gRPC. """ diff --git a/src/senzing_grpc/szhelpers.py b/src/senzing_grpc/szhelpers.py index 15515ce..614d7f1 100644 --- a/src/senzing_grpc/szhelpers.py +++ b/src/senzing_grpc/szhelpers.py @@ -13,7 +13,7 @@ __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ __date__ = "2023-11-27" -__updated__ = "2023-12-16" +__updated__ = "2025-01-10" # ----------------------------------------------------------------------------- # Helpers for working with parameters diff --git a/src/senzing_grpc/szproduct.py b/src/senzing_grpc/szproduct.py index a9a3ec8..21629f8 100644 --- a/src/senzing_grpc/szproduct.py +++ b/src/senzing_grpc/szproduct.py @@ -17,10 +17,10 @@ # Metadata -__all__ = ["SzProduct"] +__all__ = ["SzProductGrpc"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ __date__ = "2023-11-27" -__updated__ = "2024-07-30" +__updated__ = "2025-01-10" SENZING_PRODUCT_ID = ( "5056" # See https://github.com/senzing-garage/knowledge-base/blob/main/lists/senzing-component-ids.md @@ -31,7 +31,7 @@ # ----------------------------------------------------------------------------- -class SzProduct(SzProductAbstract): +class SzProductGrpc(SzProductAbstract): """ SzProduct module access library over gRPC. """ diff --git a/tests/szabstractfactory_test.py b/tests/szabstractfactory_test.py index 1e7108a..e52d75f 100755 --- a/tests/szabstractfactory_test.py +++ b/tests/szabstractfactory_test.py @@ -2,10 +2,8 @@ import grpc import pytest - -from senzing_grpc import ( +from senzing import ( SzAbstractFactory, - SzAbstractFactoryParameters, SzConfig, SzConfigManager, SzDiagnostic, @@ -13,7 +11,9 @@ SzProduct, ) -FACTORY_PARAMETERS: SzAbstractFactoryParameters = { +from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc + +FACTORY_PARAMETERS: SzAbstractFactoryParametersGrpc = { "grpc_channel": grpc.insecure_channel("localhost:8261"), } @@ -93,7 +93,7 @@ def test_constructor() -> None: """Test constructor.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - actual = SzAbstractFactory(grpc_channel=grpc_channel) + actual = SzAbstractFactoryGrpc(grpc_channel=grpc_channel) assert isinstance(actual, SzAbstractFactory) @@ -101,7 +101,7 @@ def test_context() -> None: """Test constructor.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - with SzAbstractFactory(grpc_channel=grpc_channel) as actual: + with SzAbstractFactoryGrpc(grpc_channel=grpc_channel) as actual: assert isinstance(actual, SzAbstractFactory) sz_config = actual.create_config() assert isinstance(sz_config, SzConfig) @@ -117,7 +117,7 @@ def sz_abstract_factory_fixture() -> SzAbstractFactory: """ Single sz_abstractfactory object to use for all tests. """ - result = SzAbstractFactory(**FACTORY_PARAMETERS) + result = SzAbstractFactoryGrpc(**FACTORY_PARAMETERS) return result diff --git a/tests/szconfig_test.py b/tests/szconfig_test.py index 23b44bc..86cab55 100755 --- a/tests/szconfig_test.py +++ b/tests/szconfig_test.py @@ -3,8 +3,9 @@ import grpc import pytest from pytest_schema import Optional, Or, schema +from senzing import SzBadInputError, SzConfig, SzConfigurationError -from senzing_grpc import SzBadInputError, SzConfig, SzConfigurationError +from senzing_grpc import SzConfigGrpc # ----------------------------------------------------------------------------- # Testcases @@ -181,7 +182,7 @@ def test_constructor() -> None: """Test constructor.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - actual = SzConfig(grpc_channel=grpc_channel) + actual = SzConfigGrpc(grpc_channel=grpc_channel) assert isinstance(actual, SzConfig) @@ -189,7 +190,7 @@ def test_context_managment() -> None: """Test the use of SzConfig in context.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - with SzConfig(grpc_channel=grpc_channel) as sz_config: + with SzConfigGrpc(grpc_channel=grpc_channel) as sz_config: config_handle = sz_config.create_config() actual = sz_config.get_data_sources(config_handle) sz_config.close_config(config_handle) @@ -211,7 +212,7 @@ def szconfig_fixture() -> SzConfig: grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzConfig(grpc_channel=grpc_channel) + result = SzConfigGrpc(grpc_channel=grpc_channel) return result diff --git a/tests/szconfigmanager_test.py b/tests/szconfigmanager_test.py index 653742e..aa514ad 100755 --- a/tests/szconfigmanager_test.py +++ b/tests/szconfigmanager_test.py @@ -3,14 +3,15 @@ import grpc import pytest from pytest_schema import Optional, Or, schema -from senzing_truthset import TRUTHSET_DATASOURCES - -from senzing_grpc import ( +from senzing import ( SzConfig, SzConfigManager, SzConfigurationError, SzReplaceConflictError, ) +from senzing_truthset import TRUTHSET_DATASOURCES + +from senzing_grpc import SzConfigGrpc, SzConfigManagerGrpc # ----------------------------------------------------------------------------- # Testcases @@ -216,7 +217,7 @@ def test_constructor() -> None: """Test constructor.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - actual = SzConfigManager(grpc_channel=grpc_channel) + actual = SzConfigManagerGrpc(grpc_channel=grpc_channel) assert isinstance(actual, SzConfigManager) @@ -224,7 +225,7 @@ def test_context_managment() -> None: """Test the use of SzConfigManagerTest in context.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - with SzConfigManager(grpc_channel=grpc_channel) as sz_configmanager: + with SzConfigManagerGrpc(grpc_channel=grpc_channel) as sz_configmanager: config_id = sz_configmanager.get_default_config_id() actual = sz_configmanager.get_config(config_id) actual_as_dict = json.loads(actual) @@ -244,7 +245,7 @@ def szconfig_fixture() -> SzConfig: grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzConfig(grpc_channel=grpc_channel) + result = SzConfigGrpc(grpc_channel=grpc_channel) return result @@ -255,7 +256,7 @@ def szconfigmanager_fixture() -> SzConfigManager: grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzConfigManager(grpc_channel=grpc_channel) + result = SzConfigManagerGrpc(grpc_channel=grpc_channel) return result diff --git a/tests/szdiagnostic_test.py b/tests/szdiagnostic_test.py index e8f5923..c42e417 100755 --- a/tests/szdiagnostic_test.py +++ b/tests/szdiagnostic_test.py @@ -3,8 +3,9 @@ import grpc import pytest from pytest_schema import schema +from senzing import SzDiagnostic, SzEngine, SzError -from senzing_grpc import SzDiagnostic, SzEngine, SzError +from senzing_grpc import SzDiagnosticGrpc, SzEngineGrpc # ----------------------------------------------------------------------------- # Testcases @@ -73,7 +74,7 @@ def test_constructor() -> None: """Test constructor.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - actual = SzDiagnostic(grpc_channel=grpc_channel) + actual = SzDiagnosticGrpc(grpc_channel=grpc_channel) assert isinstance(actual, SzDiagnostic) @@ -81,7 +82,7 @@ def test_context_managment() -> None: """Test the use of SzDiagnostic in context.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - with SzDiagnostic(grpc_channel=grpc_channel) as sz_diagnostic: + with SzDiagnosticGrpc(grpc_channel=grpc_channel) as sz_diagnostic: actual = sz_diagnostic.get_datastore_info() actual_json = json.loads(actual) assert schema(get_datastore_info_schema) == actual_json @@ -100,7 +101,7 @@ def szdiagnostic_fixture() -> SzDiagnostic: grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzDiagnostic(grpc_channel=grpc_channel) + result = SzDiagnosticGrpc(grpc_channel=grpc_channel) return result @@ -112,7 +113,7 @@ def szengine_fixture() -> SzEngine: grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzEngine(grpc_channel=grpc_channel) + result = SzEngineGrpc(grpc_channel=grpc_channel) return result diff --git a/tests/szengine_test.py b/tests/szengine_test.py index 9374c99..764e56a 100755 --- a/tests/szengine_test.py +++ b/tests/szengine_test.py @@ -6,14 +6,7 @@ import grpc import pytest from pytest_schema import Optional, Or, schema -from senzing_truthset import ( - TRUTHSET_CUSTOMER_RECORDS, - TRUTHSET_DATASOURCES, - TRUTHSET_REFERENCE_RECORDS, - TRUTHSET_WATCHLIST_RECORDS, -) - -from senzing_grpc import ( +from senzing import ( SZ_NO_FLAGS, SZ_WITHOUT_INFO, SzBadInputError, @@ -25,6 +18,14 @@ SzNotFoundError, SzUnknownDataSourceError, ) +from senzing_truthset import ( + TRUTHSET_CUSTOMER_RECORDS, + TRUTHSET_DATASOURCES, + TRUTHSET_REFERENCE_RECORDS, + TRUTHSET_WATCHLIST_RECORDS, +) + +from senzing_grpc import SzConfigGrpc, SzConfigManagerGrpc, SzEngineGrpc DATA_SOURCES = { "CUSTOMERS": TRUTHSET_CUSTOMER_RECORDS, @@ -69,7 +70,7 @@ def test_add_truthset_datasources( - sz_engine: SzEngine, + sz_engine: SzEngineGrpc, sz_configmanager: SzConfigManager, sz_config: SzConfig, ) -> None: @@ -1033,7 +1034,7 @@ def test_add_record_using_context_managment() -> None: """Test the use of SzEngine in context.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - with SzEngine(grpc_channel=grpc_channel) as sz_engine: + with SzEngineGrpc(grpc_channel=grpc_channel) as sz_engine: data_source_code = "TEST" record_id = "2" record_definition = "{}" @@ -1045,7 +1046,7 @@ def test_constructor() -> None: """Test constructor.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - actual = SzEngine(grpc_channel=grpc_channel) + actual = SzEngineGrpc(grpc_channel=grpc_channel) assert isinstance(actual, SzEngine) @@ -1191,7 +1192,7 @@ def szconfig_fixture() -> SzConfig: """ grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzConfig(grpc_channel=grpc_channel) + result = SzConfigGrpc(grpc_channel=grpc_channel) return result @@ -1202,7 +1203,7 @@ def szconfigmanager_fixture() -> SzConfigManager: """ grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzConfigManager(grpc_channel=grpc_channel) + result = SzConfigManagerGrpc(grpc_channel=grpc_channel) return result @@ -1214,7 +1215,7 @@ def szengine_fixture() -> SzEngine: grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzEngine(grpc_channel=grpc_channel) + result = SzEngineGrpc(grpc_channel=grpc_channel) return result diff --git a/tests/szproduct_test.py b/tests/szproduct_test.py index 955020e..4888d70 100755 --- a/tests/szproduct_test.py +++ b/tests/szproduct_test.py @@ -3,8 +3,9 @@ import grpc import pytest from pytest_schema import Regex, schema +from senzing import SzProduct -from senzing_grpc import SzProduct +from senzing_grpc import SzProductGrpc # ----------------------------------------------------------------------------- # Testcases @@ -36,7 +37,7 @@ def test_constructor() -> None: """Test constructor.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - actual = SzProduct(grpc_channel=grpc_channel) + actual = SzProductGrpc(grpc_channel=grpc_channel) assert isinstance(actual, SzProduct) @@ -44,7 +45,7 @@ def test_context_managment() -> None: """Test the use of SzProduct in context.""" grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - with SzProduct(grpc_channel=grpc_channel) as sz_product: + with SzProductGrpc(grpc_channel=grpc_channel) as sz_product: actual = sz_product.get_license() assert isinstance(actual, str) actual_as_dict = json.loads(actual) @@ -63,7 +64,7 @@ def szproduct_fixture() -> SzProduct: """ grpc_url = "localhost:8261" grpc_channel = grpc.insecure_channel(grpc_url) - result = SzProduct(grpc_channel=grpc_channel) + result = SzProductGrpc(grpc_channel=grpc_channel) return result