Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#172 Repository name change #173

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning].

## [Unreleased]

## [0.3.8] - 2024-12-04

### Added in 0.3.8

- `senzing` package dependency

### Deleted in 0.3.8

- `senzing-abstract` package dependency

## [0.3.7] - 2024-12-03

### Changed in 0.3.7
Expand Down
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ the recommendation is not to use it yet.
## Synopsis

The Senzing `sz-sdk-python-grpc` package provides a Python Software Development Kit
adhering to the abstract classes of [sz-sdk-python-abstract]
adhering to the abstract classes of [sz-sdk-python]
that communicates with a [Senzing gRPC server].

[![Python 3.11 Badge]][Python 3.11]
Expand All @@ -32,15 +32,15 @@ that communicates with a [Senzing gRPC server].
The Senzing `sz-sdk-python-grpc` packages enable Python programs to call Senzing library functions
across a network to a [Senzing gRPC server].

The `sz-sdk-python-grpc` package implements the following [sz-sdk-python-abstract] interfaces:
The `sz-sdk-python-grpc` package implements the following [sz-sdk-python] interfaces:

1. [SzConfigAbstract]
1. [SzConfigMgrAbstract]
1. [SzDiagnosticAbstract]
1. [SzEngineAbstract]
1. [SzProductAbstract]
1. [SzConfig]
1. [SzConfigMgr]
1. [SzDiagnostic]
1. [SzEngine]
1. [SzProduct]

Other implementations of the [sz-sdk-python-abstract] interface include:
Other implementations of the [sz-sdk-python] interface include:

- [sz-sdk-python] - for calling Senzing SDK APIs natively

Expand Down Expand Up @@ -102,7 +102,7 @@ More can be seen in [Examples].
1. [Examples]
1. Related artifacts:
1. [DockerHub]
1. [sz-sdk-python-abstract package reference]
1. [sz-sdk-python package reference]

[Coverage badge]: https://img.shields.io/badge/dynamic/json?color=brightgreen&label=coverage&query=%24.message&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsenzing-garage%2Fsz-sdk-python%2Fpython-coverage-comment-action-data%2Fendpoint.json
[Coverage]: https://htmlpreview.github.io/?https://github.com/senzing-garage/sz-sdk-python-grpc/blob/python-coverage-comment-action-data/htmlcov/index.html
Expand All @@ -123,11 +123,5 @@ More can be seen in [Examples].
[Senzing gRPC server]: https://github.com/senzing-garage/servegrpc
[Senzing Quick Start guides]: https://docs.senzing.com/quickstart/
[Senzing]: https://senzing.com/
[sz-sdk-python-abstract package reference]: https://hub.senzing.com/sz-sdk-python-abstract/
[sz-sdk-python-abstract]: https://github.com/senzing-garage/sz-sdk-python-abstract/tree/main/src/senzing_abstract
[sz-sdk-python]: https://github.com/senzing-garage/sz-sdk-python
[SzConfigAbstract]: https://github.com/senzing-garage/sz-sdk-python-abstract/blob/main/src/senzing_abstract/szconfig_abstract.py
[SzConfigMgrAbstract]: https://github.com/senzing-garage/sz-sdk-python-abstract/blob/main/src/senzing_abstract/szconfigmanager_abstract.py
[SzDiagnosticAbstract]: https://github.com/senzing-garage/sz-sdk-python-abstract/blob/main/src/senzing_abstract/szdiagnostic_abstract.py
[SzEngineAbstract]: https://github.com/senzing-garage/sz-sdk-python-abstract/blob/main/src/senzing_abstract/szengine_abstract.py
[SzProductAbstract]: https://github.com/senzing-garage/sz-sdk-python-abstract/blob/main/src/senzing_abstract/szproduct_abstract.py
[sz-sdk-python package reference]: https://hub.senzing.com/sz-sdk-python/
[sz-sdk-python]: https://github.com/senzing-garage/sz-sdk-python/tree/main/src/senzing
7 changes: 3 additions & 4 deletions examples/misc/individual_classes.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#! /usr/bin/env python3

import grpc

from senzing_grpc import (
SzAbstractFactory,
SzAbstractFactoryParameters,
from senzing import (
SzConfig,
SzConfigManager,
SzDiagnostic,
Expand All @@ -13,6 +10,8 @@
SzProduct,
)

from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters

FACTORY_PARAMETERS: SzAbstractFactoryParameters = {
"grpc_channel": grpc.insecure_channel("localhost:8261"),
}
Expand Down
8 changes: 2 additions & 6 deletions examples/szengine/a_header_szengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@
from typing import List, Tuple

import grpc
from senzing import SZ_WITHOUT_INFO, SzEngine
from senzing_truthset import (
TRUTHSET_CUSTOMER_RECORDS,
TRUTHSET_REFERENCE_RECORDS,
TRUTHSET_WATCHLIST_RECORDS,
)

from senzing_grpc import (
SZ_WITHOUT_INFO,
SzAbstractFactory,
SzAbstractFactoryParameters,
SzEngine,
)
from senzing_grpc import SzAbstractFactory, SzAbstractFactoryParameters

DATA_SOURCES = {
"CUSTOMERS": TRUTHSET_CUSTOMER_RECORDS,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
grpcio==1.68.1
protobuf==5.29.0
senzing-abstract==0.1.12
senzing==0.2.0
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = senzing_grpc
version = 0.3.7
version = 0.3.8
author = senzing
author_email = support@senzing.com
description = Senzing Python SDK over gRPC
Expand All @@ -23,7 +23,7 @@ python_requires = >=3.9
install_requires =
grpcio >= 1.68.1
protobuf >= 5.29.0
senzing-abstract >= 0.1.12
senzing >= 0.2.0,<1.0.0

[options.packages.find]
where = src
29 changes: 6 additions & 23 deletions src/senzing_grpc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from senzing_abstract import (
from senzing import (
ENGINE_EXCEPTION_MAP,
SZ_INITIALIZE_WITH_DEFAULT_CONFIGURATION,
SZ_NO_ATTRIBUTES,
Expand All @@ -10,25 +10,14 @@
SZ_VERBOSE_LOGGING,
SZ_WITHOUT_INFO,
SzBadInputError,
)
from senzing_abstract import SzConfigAbstract as SzConfig
from senzing_abstract import SzConfigManagerAbstract as SzConfigManager
from senzing_abstract import (
SzConfigurationError,
SzDatabaseConnectionLostError,
SzDatabaseError,
)
from senzing_abstract import SzDiagnosticAbstract as SzDiagnostic
from senzing_abstract import SzEngineAbstract as SzEngine
from senzing_abstract import (
SzEngineFlags,
SzError,
SzLicenseError,
SzNotFoundError,
SzNotInitializedError,
)
from senzing_abstract import SzProductAbstract as SzProduct
from senzing_abstract import (
SzReplaceConflictError,
SzRetryableError,
SzRetryTimeoutExceededError,
Expand All @@ -38,11 +27,11 @@
)

from .szabstractfactory import SzAbstractFactory, SzAbstractFactoryParameters
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 .szconfig import SzConfig
from .szconfigmanager import SzConfigManager
from .szdiagnostic import SzDiagnostic
from .szengine import SzEngine
from .szproduct import SzProduct

__all__ = [
"ENGINE_EXCEPTION_MAP",
Expand All @@ -51,7 +40,6 @@
"SZ_NO_AVOIDANCES",
"SZ_NO_FLAGS",
"SZ_NO_LOGGING",
"SZ_NO_LOGGING",
"SZ_NO_REQUIRED_DATASOURCES",
"SZ_NO_SEARCH_PROFILE",
"SZ_VERBOSE_LOGGING",
Expand All @@ -60,23 +48,18 @@
"SzAbstractFactoryParameters",
"SzBadInputError",
"SzConfig",
"SzConfigGrpc",
"SzConfigManager",
"SzConfigManagerGrpc",
"SzConfigurationError",
"SzDatabaseConnectionLostError",
"SzDatabaseError",
"SzDiagnostic",
"SzDiagnosticGrpc",
"SzEngine",
"SzEngineGrpc",
"SzEngineFlags",
"SzError",
"SzLicenseError",
"SzNotFoundError",
"SzNotInitializedError",
"SzProduct",
"SzProductGrpc",
"SzReplaceConflictError",
"SzRetryableError",
"SzRetryTimeoutExceededError",
Expand Down
48 changes: 21 additions & 27 deletions src/senzing_grpc/szabstractfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,18 @@
from typing import Any, Type, TypedDict, Union

import grpc
from senzing_abstract import (
SzAbstractFactoryAbstract,
SzConfigAbstract,
SzConfigManagerAbstract,
SzDiagnosticAbstract,
SzEngineAbstract,
SzProductAbstract,
)

from .szconfig import SzConfig
from .szconfigmanager import SzConfigManager
from .szdiagnostic import SzDiagnostic
from .szengine import SzEngine
from .szproduct import SzProduct
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

# Metadata

__all__ = ["SzAbstractFactoryAbstract"]
__all__ = ["SzAbstractFactory"]
__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/
__date__ = "2023-11-27"
__updated__ = "2024-10-24"
Expand Down Expand Up @@ -89,24 +83,24 @@ def __exit__(
# SzAbstractFactory methods
# -------------------------------------------------------------------------

def create_config(self) -> SzConfigAbstract:
return SzConfig(grpc_channel=self.channel)
def create_config(self) -> SzConfig:
return SzConfigGrpc(grpc_channel=self.channel)

def create_configmanager(self) -> SzConfigManagerAbstract:
return SzConfigManager(grpc_channel=self.channel)
def create_configmanager(self) -> SzConfigManager:
return SzConfigManagerGrpc(grpc_channel=self.channel)

def create_diagnostic(self) -> SzDiagnosticAbstract:
return SzDiagnostic(grpc_channel=self.channel)
def create_diagnostic(self) -> SzDiagnostic:
return SzDiagnosticGrpc(grpc_channel=self.channel)

def create_engine(self) -> SzEngineAbstract:
return SzEngine(grpc_channel=self.channel)
def create_engine(self) -> SzEngine:
return SzEngineGrpc(grpc_channel=self.channel)

def create_product(self) -> SzProductAbstract:
return SzProduct(grpc_channel=self.channel)
def create_product(self) -> SzProduct:
return SzProductGrpc(grpc_channel=self.channel)

def reinitialize(self, config_id: int) -> None:
sz_diagonstic = SzDiagnostic(grpc_channel=self.channel)
sz_diagonstic = SzDiagnosticGrpc(grpc_channel=self.channel)
sz_diagonstic._reinitialize(config_id=config_id) # pylint: disable=W0212

sz_engine = SzEngine(grpc_channel=self.channel)
sz_engine = SzEngineGrpc(grpc_channel=self.channel)
sz_engine._reinitialize(config_id=config_id) # pylint: disable=W0212
4 changes: 1 addition & 3 deletions src/senzing_grpc/szconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
from typing import Any, Dict, Type, Union

import grpc
from senzing_abstract import SzConfigAbstract
from senzing import SzConfig as SzConfigAbstract

from .pb2_grpc import szconfig_pb2, szconfig_pb2_grpc

# from .szabstract.szconfig_abstract import SzConfigAbstract
from .szhelpers import as_str, new_exception

# Metadata
Expand Down
2 changes: 1 addition & 1 deletion src/senzing_grpc/szconfigmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Any, Dict, Type, Union

import grpc
from senzing_abstract import SzConfigManagerAbstract
from senzing import SzConfigManager as SzConfigManagerAbstract

from .pb2_grpc import szconfigmanager_pb2, szconfigmanager_pb2_grpc

Expand Down
2 changes: 1 addition & 1 deletion src/senzing_grpc/szdiagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Any, Dict, Optional, Type, Union

import grpc
from senzing_abstract import SzDiagnosticAbstract
from senzing import SzDiagnostic as SzDiagnosticAbstract

from .pb2_grpc import szdiagnostic_pb2, szdiagnostic_pb2_grpc
from .szhelpers import new_exception
Expand Down
3 changes: 2 additions & 1 deletion src/senzing_grpc/szengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union

import grpc
from senzing_abstract import SzEngineAbstract, SzEngineFlags
from senzing import SzEngine as SzEngineAbstract
from senzing import SzEngineFlags

from .pb2_grpc import szengine_pb2, szengine_pb2_grpc
from .szhelpers import as_str, new_exception
Expand Down
2 changes: 1 addition & 1 deletion src/senzing_grpc/szhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import grpc
import grpc._channel
from senzing_abstract import ENGINE_EXCEPTION_MAP, SzError
from senzing import ENGINE_EXCEPTION_MAP, SzError

# Metadata

Expand Down
2 changes: 1 addition & 1 deletion src/senzing_grpc/szproduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Any, Dict, Type, Union

import grpc
from senzing_abstract import SzProductAbstract
from senzing import SzProduct as SzProductAbstract

from .pb2_grpc import szproduct_pb2, szproduct_pb2_grpc
from .szhelpers import new_exception
Expand Down
Loading
Loading