Skip to content

Commit 276afb1

Browse files
authored
10 ant 1 (#17)
* #10 - Save point * #10 - Save point * #10 - Save point * #10 * #10
1 parent 4853af6 commit 276afb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1298
-256
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,11 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130-
.history
130+
.history
131+
132+
# VSCode
133+
.vscode/
134+
.history
135+
136+
# Output folder used by examples
137+
resources/output/

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog], [markdownlint],
66
and this project adheres to [Semantic Versioning].
77

8+
### Changed in 0.0.2
9+
10+
- Modify Python imports to use senzing and senzing_core
11+
12+
### Added to 0.0.1
13+
14+
- Couple of new examples
15+
16+
817
### Added to 0.0.1
918

1019
- Initial for V4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ When using a bare metal install, the initialization parameters used by the Senzi
8484
- Python one liner
8585

8686
- ```python
87-
python3 -c $'import configparser; ini_file_name = "<project_path>/etc/G2Module.ini";engine_config_json = {};cfgp = configparser.ConfigParser();cfgp.optionxform = str;cfgp.read(ini_file_name)\nfor section in cfgp.sections(): engine_config_json[section] = dict(cfgp.items(section))\nprint(engine_config_json)'
87+
python3 -c $'import configparser; ini_file_name = "<project_path>/etc/G2Module.ini";settings = {};cfgp = configparser.ConfigParser();cfgp.optionxform = str;cfgp.read(ini_file_name)\nfor section in cfgp.sections(): settings[section] = dict(cfgp.items(section))\nprint(settings)'
8888
```
8989

9090
:pencil2: `<project_path>` in the above example should point to your project.

python/configuration/add_data_sources.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
import sys
55
from pathlib import Path
66

7-
from senzing_core import SzAbstractFactory, SzError
7+
from senzing import SzError
8+
from senzing_core import SzAbstractFactoryCore
89

9-
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1010
INSTANCE_NAME = Path(__file__).stem
11+
SETTINGS = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1112

1213

1314
try:
14-
sz_factory = SzAbstractFactory("add_records", ENGINE_CONFIG_JSON, verbose_logging=False)
15+
sz_factory = SzAbstractFactoryCore("add_records", SETTINGS, verbose_logging=False)
1516
sz_config = sz_factory.create_config()
1617
sz_configmanager = sz_factory.create_configmanager()
1718

python/deleting/delete_futures.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@
77
import sys
88
from pathlib import Path
99

10-
from senzing_core import (
11-
SzAbstractFactory,
12-
SzBadInputError,
13-
SzError,
14-
SzRetryableError,
15-
SzUnrecoverableError,
16-
)
10+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
11+
from senzing_core import SzAbstractFactoryCore
1712

18-
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1913
INPUT_FILE = Path("../../resources/data/del-500.jsonl").resolve()
2014
INSTANCE_NAME = Path(__file__).stem
15+
SETTINGS = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
2116

2217

2318
def mock_logger(level, error, error_record=None):
@@ -73,7 +68,7 @@ def futures_del(engine, input_file):
7368

7469

7570
try:
76-
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
71+
sz_factory = SzAbstractFactoryCore(INSTANCE_NAME, SETTINGS, verbose_logging=False)
7772
sz_engine = sz_factory.create_engine()
7873
futures_del(sz_engine, INPUT_FILE)
7974
except SzError as err:

python/deleting/delete_loop.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
import sys
66
from pathlib import Path
77

8-
from senzing_core import (
9-
SzAbstractFactory,
10-
SzBadInputError,
11-
SzError,
12-
SzRetryableError,
13-
SzUnrecoverableError,
14-
)
15-
16-
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
8+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
9+
from senzing_core import SzAbstractFactoryCore
10+
1711
INPUT_FILE = Path("../../resources/data/del-500.jsonl").resolve()
1812
INSTANCE_NAME = Path(__file__).stem
13+
SETTINGS = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1914

2015

2116
def mock_logger(level, error, error_record=None):
@@ -54,7 +49,7 @@ def del_records_from_file(engine, input_file):
5449

5550

5651
try:
57-
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
52+
sz_factory = SzAbstractFactoryCore(INSTANCE_NAME, SETTINGS, verbose_logging=False)
5853
sz_engine = sz_factory.create_engine()
5954
del_records_from_file(sz_engine, INPUT_FILE)
6055
except SzError as err:

python/deleting/delete_with_info_futures.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
import sys
88
from pathlib import Path
99

10-
from senzing_core import (
11-
SzAbstractFactory,
10+
from senzing import (
1211
SzBadInputError,
1312
SzEngineFlags,
1413
SzError,
1514
SzRetryableError,
1615
SzUnrecoverableError,
1716
)
17+
from senzing_core import SzAbstractFactoryCore
1818

19-
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
2019
INPUT_FILE = Path("../../resources/data/del-500.jsonl").resolve()
2120
INSTANCE_NAME = Path(__file__).stem
2221
OUTPUT_FILE = Path("../../resources/output/delete_file_with_info.jsonl").resolve()
22+
SETTINGS = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
2323

2424

2525
def mock_logger(level, error, error_record=None):
@@ -79,7 +79,7 @@ def futures_del(engine, input_file, output_file):
7979

8080

8181
try:
82-
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
82+
sz_factory = SzAbstractFactoryCore(INSTANCE_NAME, SETTINGS, verbose_logging=False)
8383
sz_engine = sz_factory.create_engine()
8484
futures_del(sz_engine, INPUT_FILE, OUTPUT_FILE)
8585
except SzError as err:

python/information/check_datastore_performance.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
import os
44
from pathlib import Path
55

6-
from senzing_core import SzAbstractFactory, SzError
6+
from senzing import SzError
7+
from senzing_core import SzAbstractFactoryCore
78

8-
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
9+
SETTINGS = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem
1011
SECONDS_TO_RUN = 3
1112

1213
try:
13-
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
14+
sz_factory = SzAbstractFactoryCore(INSTANCE_NAME, SETTINGS, verbose_logging=False)
1415
sz_diagnostic = sz_factory.create_diagnostic()
1516
print(sz_diagnostic.check_datastore_performance(SECONDS_TO_RUN))
1617
except SzError as err:

python/information/get_datastore_info.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
import os
44
from pathlib import Path
55

6-
from senzing_core import SzAbstractFactory, SzError
6+
from senzing import SzError
7+
from senzing_core import SzAbstractFactoryCore
78

8-
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
9+
SETTINGS = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem
1011

1112
try:
12-
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
13+
sz_factory = SzAbstractFactoryCore(INSTANCE_NAME, SETTINGS, verbose_logging=False)
1314
sz_diagnostic = sz_factory.create_diagnostic()
1415
print(sz_diagnostic.get_datastore_info())
1516
except SzError as err:

python/information/get_license.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
import os
44
from pathlib import Path
55

6-
from senzing_core import SzAbstractFactory, SzError
6+
from senzing import SzError
7+
from senzing_core import SzAbstractFactoryCore
78

8-
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
9+
SETTINGS = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem
1011

1112
try:
12-
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
13+
sz_factory = SzAbstractFactoryCore(INSTANCE_NAME, SETTINGS, verbose_logging=False)
1314
sz_product = sz_factory.create_product()
1415
print(sz_product.get_license())
1516
except SzError as err:

0 commit comments

Comments
 (0)