diff --git a/rootfs/notebooks/img/upload-icon.png b/rootfs/notebooks/img/upload-icon.png new file mode 100644 index 0000000..7d4f512 Binary files /dev/null and b/rootfs/notebooks/img/upload-icon.png differ diff --git a/src/senzing_quickstart/hello_world.py b/src/senzing_quickstart/hello_world.py index 2cf944e..e2e9f1f 100644 --- a/src/senzing_quickstart/hello_world.py +++ b/src/senzing_quickstart/hello_world.py @@ -2,9 +2,9 @@ # coding: utf-8 # # Senzing Hello World -# +# # The following is a quick test of connectivity to Senzing using Python over gRPC. -# +# # Import python packages. @@ -16,7 +16,6 @@ import grpc from senzing_grpc import SzAbstractFactory - # Create an abstract factory for accessing Senzing via gRPC. # In[ ]: @@ -41,4 +40,3 @@ print(json.dumps(json.loads(sz_product.get_version()), indent=2)) - diff --git a/src/senzing_quickstart/load_truthsets.py b/src/senzing_quickstart/load_truthsets.py index b1994a1..1372c54 100644 --- a/src/senzing_quickstart/load_truthsets.py +++ b/src/senzing_quickstart/load_truthsets.py @@ -2,9 +2,9 @@ # coding: utf-8 # # Load Senzing truth-sets -# +# # These instructions load the [Senzing truth-sets] into the Senzing engine. -# +# # [Senzing truth-sets]: https://github.com/Senzing/truth-sets # ## Prepare Python enviroment @@ -21,7 +21,6 @@ import requests from senzing_grpc import SzAbstractFactory, SzEngineFlags, SzError - # Set environment specific variables. # In[ ]: @@ -69,7 +68,6 @@ datasources.append(datasource) print(f"Found the following DATA_SOURCE values in the data: {datasources}") - # ## Update Senzing configuration @@ -105,7 +103,7 @@ old_config_id = sz_configmanager.get_default_config_id() old_json_config = sz_configmanager.get_config(old_config_id) -config_handle = sz_config.import_config(old_json_config) +config_handle = sz_config.import_config(old_json_config) # Add DataSources to Senzing configuration. @@ -126,10 +124,8 @@ new_json_config = sz_config.export_config(config_handle) -new_config_id = sz_configmanager.add_config( - new_json_config, "Add TruthSet datasources" -) -sz_configmanager.replace_default_config_id(old_config_id, new_config_id) +new_config_id = sz_configmanager.add_config(new_json_config, "Add TruthSet datasources") +sz_configmanager.replace_default_config_id(old_config_id, new_config_id) # With the change in Senzing configuration, Senzing objects need to be updated. @@ -152,7 +148,7 @@ filepath = home_path + filename with open(filepath, "r") as file: for line in file: - try: + try: line_as_dict = json.loads(line) info = sz_engine.add_record( line_as_dict.get("DATA_SOURCE"), @@ -162,7 +158,7 @@ ) print(info) except SzError as err: - print(err) + print(err) # ## View results @@ -187,4 +183,3 @@ } search_result = sz_engine.search_by_attributes(json.dumps(search_query)) print(json.dumps(json.loads(search_result), indent=2)) - diff --git a/src/senzing_quickstart/method_help.py b/src/senzing_quickstart/method_help.py index d146153..1209ec8 100644 --- a/src/senzing_quickstart/method_help.py +++ b/src/senzing_quickstart/method_help.py @@ -11,7 +11,6 @@ import grpc from senzing_grpc import SzAbstractFactory - # Create an abstract factory for accessing Senzing via gRPC. # In[ ]: @@ -44,4 +43,3 @@ print(sz_engine.help("get_entity_by_record_id")) - diff --git a/testdata/example-data-for-senzing.json b/testdata/example-data-for-senzing.json new file mode 100644 index 0000000..502f81c --- /dev/null +++ b/testdata/example-data-for-senzing.json @@ -0,0 +1,8 @@ +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "157616467", "DRIVERS_LICENSE_NUMBER": "00", "DATE_OF_BIRTH": "20/12/1965", "ADDR_POSTAL_CODE": "47201", "ADDR_CITY": "Columbus", "SSN_NUMBER": "883-24-5259", "NAME_FIRST": "CYNTHIA", "NAME_LAST": "SHORTS", "GENDER": "F", "DSRC_ACTION": "A", "ADDR_LINE1": "696 15th ST"} +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "115212881", "SOCIAL_HANDLE": "thyroidss", "DATE_OF_BIRTH": "20/11/1960", "ADDR_STATE": "AR", "SSN_NUMBER": "434-59-7109", "NAME_FIRST": "KEVIN", "PASSPORT_NUMBER": "154CE0YTD", "GENDER": "M", "DSRC_ACTION": "A", "ADDR_CITY": "Lewisville", "DRIVERS_LICENSE_STATE": "DE", "PHONE_NUMBER": "501-357-3875", "NAME_LAST": "HZIRT", "ADDR_LINE1": "330 5th ST"} +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "645217904", "ADDR_STATE": "Minnesota", "ADDR_POSTAL_CODE": "55804", "SSN_NUMBER": "113-56-6093", "NAME_FIRST": "LINDA", "GENDER": "F", "CC_ACCOUNT_NUMBER": "6442498315525524", "DSRC_ACTION": "A", "ADDR_CITY": "Duluth", "DRIVERS_LICENSE_NUMBER": "S90976292", "DRIVERS_LICENSE_STATE": "HI", "PHONE_NUMBER": "952-757-7688", "NAME_LAST": "BUCHANAN", "ADDR_LINE1": "486 41st AVE"} +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "212359276", "DATE_OF_BIRTH": "23/2/1968", "ADDR_STATE": "ID", "ADDR_POSTAL_CODE": "83709", "SSN_NUMBER": "441-76-2625", "NAME_FIRST": "ROLANDA", "PASSPORT_NUMBER": "CFP1XM4Q", "GENDER": "N/A", "CC_ACCOUNT_NUMBER": "50186266717162531", "DSRC_ACTION": "A", "DRIVERS_LICENSE_NUMBER": "X8865625161887", "DRIVERS_LICENSE_STATE": "IW", "ADDR_CITY": "Boise", "NAME_LAST": "JOHNSON", "ADDR_LINE1": "142 AuYto DR"} +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "526429955", "SSN_NUMBER": "388-69-4882", "NAME_FIRST": "JOHNNIE", "PASSPORT_NUMBER": "CN5QGN8HY8", "GENDER": "M", "CC_ACCOUNT_NUMBER": "541119397002419249", "DSRC_ACTION": "A", "DRIVERS_LICENSE_NUMBER": "943105509", "DRIVERS_LICENSE_STATE": "IV", "PHONE_NUMBER": "355-9553", "NAME_LAST": "H", "ADDR_LINE1": "69 Cayuga CT"} +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "604947448", "ADDR_CITY": "Port Jefferson Station", "DRIVERS_LICENSE_NUMBER": "50951659", "ADDR_STATE": "NY", "ADDR_POSTAL_CODE": "11776", "PHONE_NUMBER": "268-8561", "NAME_FIRST": "ALBERT", "NAME_LAST": "GALLAHER", "GENDER": "M", "DSRC_ACTION": "A", "ADDR_LINE1": "22 BroadShurst ST"} +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "513789670", "SOCIAL_HANDLE": "tainsz", "ADDR_STATE": "OK", "ADDR_POSTAL_CODE": "34133", "SSN_NUMBER": "758-42-2397", "NAME_FIRST": "JAFMES", "GENDER": "M", "DSRC_ACTION": "A", "ADDR_CITY": "TAlsa", "DRIVERS_LICENSE_STATE": "NY", "PHONE_NUMBER": "580-558-8123", "NAME_LAST": "HENDERSON", "ADDR_LINE1": "6738 112thEast AVE"} +{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "212442489", "SOCIAL_HANDLE": "debrides7", "ADDR_STATE": "CO", "ADDR_POSTAL_CODE": "80501", "NAME_FIRST": "S", "GENDER": "M", "CC_ACCOUNT_NUMBER": "676396021499009121", "DSRC_ACTION": "A", "DRIVERS_LICENSE_STATE": "NE", "ADDR_CITY": "Longmont", "NAME_LAST": "JONES", "ADDR_LINE1": "948 10th AVE"}