Skip to content

Commit 4969042

Browse files
committed
#10 - Save point
1 parent 4853af6 commit 4969042

30 files changed

+1072
-111
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ 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 imports to use senzing and senzing_core
11+
812
### Added to 0.0.1
913

1014
- Initial for V4

python/configuration/add_data_sources.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
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 SzAbstractFactory
89

910
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1011
INSTANCE_NAME = Path(__file__).stem

python/deleting/delete_futures.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
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 SzAbstractFactory
1712

1813
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1914
INPUT_FILE = Path("../../resources/data/del-500.jsonl").resolve()

python/deleting/delete_loop.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
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-
)
8+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
9+
from senzing_core import SzAbstractFactory
1510

1611
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1712
INPUT_FILE = Path("../../resources/data/del-500.jsonl").resolve()

python/deleting/delete_with_info_futures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
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 SzAbstractFactory
1818

1919
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
2020
INPUT_FILE = Path("../../resources/data/del-500.jsonl").resolve()

python/information/check_datastore_performance.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
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 SzAbstractFactory
78

89
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem

python/information/get_datastore_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
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 SzAbstractFactory
78

89
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem

python/information/get_license.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
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 SzAbstractFactory
78

89
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem

python/information/get_stats.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@
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 SzAbstractFactory
1712

1813
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
19-
INPUT_FILE = Path("../../resources/data/load-500.json").resolve()
14+
INPUT_FILE = Path("../../resources/data/load-500.jsonl").resolve()
2015
INSTANCE_NAME = Path(__file__).stem
2116

2217

python/information/get_version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
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 SzAbstractFactory
78

89
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem

python/initialization/engine_priming.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
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 SzAbstractFactory
78

89
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem

python/initialization/factory_and_engines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
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 SzAbstractFactory
78

89
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
910
INSTANCE_NAME = Path(__file__).stem

python/initialization/purge_repository.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
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 SzAbstractFactory
89

910
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1011
INSTANCE_NAME = Path(__file__).stem
@@ -17,15 +18,15 @@
1718
1819
*****************************************************************************************
1920
20-
Are you sure you want to continue and purge the Senzing datastore? (y/n) """
21+
Are you sure you want to continue and purge the Senzing datastore? Type YESPURGESENZING to purge: """
2122

22-
if input(PURGE_MSG) not in ["y", "Y", "yes", "YES"]:
23+
if input(PURGE_MSG) != "YESPURGESENZING":
2324
sys.exit()
2425

2526
try:
2627
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
2728
sz_diagnostic = sz_factory.create_diagnostic()
2829
sz_diagnostic.purge_repository()
29-
print("\nSenzing repository purged")
30+
print("\nSenzing datastore purged")
3031
except SzError as err:
3132
print(f"\n{err.__class__.__name__} - {err}")

python/loading/add_futures.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
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 SzAbstractFactory
1712

1813
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1914
INPUT_FILE = Path("../../resources/data/load-500.jsonl").resolve()

python/loading/add_queue.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
from multiprocessing import Process, Queue
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 SzAbstractFactory
1712

1813
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1914
INPUT_FILE = Path("../../resources/data/load-500.jsonl").resolve()

python/loading/add_records.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import os
55
from pathlib import Path
66

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

910
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1011
INSTANCE_NAME = Path(__file__).stem

python/loading/add_records_loop.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
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-
)
8+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
9+
from senzing_core import SzAbstractFactory
1510

1611
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1712
INPUT_FILE = Path("../../resources/data/load-500.jsonl").resolve()

python/loading/add_truthset_loop.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
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-
)
8+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
9+
from senzing_core import SzAbstractFactory
1510

1611
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1712
INPUT_FILES = [

python/loading/add_with_info_futures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
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 SzAbstractFactory
1818

1919
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
2020
INPUT_FILE = Path("../../resources/data/load-500-with-errors.jsonl").resolve()

python/redo/add_with_redo.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
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-
)
8+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
9+
from senzing_core import SzAbstractFactory
1510

1611
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1712
INPUT_FILE = Path("../../resources/data/load-500.jsonl").resolve()

python/redo/redo_continuous.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
55
import time
66
from pathlib import Path
77

8-
from senzing_core import (
9-
SzAbstractFactory,
10-
SzBadInputError,
11-
SzError,
12-
SzRetryableError,
13-
SzUnrecoverableError,
14-
)
8+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
9+
from senzing_core import SzAbstractFactory
1510

1611
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1712
INSTANCE_NAME = Path(__file__).stem

python/redo/redo_continuous_futures.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66
import time
77
from pathlib import Path
88

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

1712
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1813
INSTANCE_NAME = Path(__file__).stem

python/redo/redo_with_info_continuous.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
#! /usr/bin/env python3
22

33
import os
4+
import signal
45
import sys
56
import time
67
from pathlib import Path
78

8-
from senzing_core import (
9-
SzAbstractFactory,
9+
from senzing import (
1010
SzBadInputError,
1111
SzEngineFlags,
1212
SzError,
1313
SzRetryableError,
1414
SzUnrecoverableError,
1515
)
16+
from senzing_core import SzAbstractFactory
1617

1718
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1819
OUTPUT_FILE = Path("../../resources/output/redo_with_info_continuous.jsonl").resolve()
1920
INSTANCE_NAME = Path(__file__).stem
2021

2122

23+
def signal_handler(signum, frame):
24+
print(f"\nWith info responses written to {OUTPUT_FILE}")
25+
sys.exit()
26+
27+
2228
def mock_logger(level, error, error_record=None):
2329
print(f"\n{level}: {error.__class__.__name__} - {error}", file=sys.stderr)
2430
if error_record:
@@ -60,6 +66,8 @@ def process_redo(engine, output_file):
6066
raise err
6167

6268

69+
signal.signal(signal.SIGINT, signal_handler)
70+
6371
try:
6472
sz_factory = SzAbstractFactory(INSTANCE_NAME, ENGINE_CONFIG_JSON, verbose_logging=False)
6573
sz_engine = sz_factory.create_engine()

python/searching/search_futures.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
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 SzAbstractFactory
1712

1813
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1914
INPUT_FILE = Path("../../resources/data/search-50.jsonl").resolve()

python/searching/search_records.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
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-
)
8+
from senzing import SzBadInputError, SzError, SzRetryableError, SzUnrecoverableError
9+
from senzing_core import SzAbstractFactory
1510

1611
ENGINE_CONFIG_JSON = os.getenv("SENZING_ENGINE_CONFIGURATION_JSON", "{}")
1712
INSTANCE_NAME = Path(__file__).stem

0 commit comments

Comments
 (0)