{"id":49249294,"url":"https://github.com/senzing-garage/g2search","last_synced_at":"2026-04-24T23:35:32.576Z","repository":{"id":38332377,"uuid":"446912486","full_name":"senzing-garage/g2search","owner":"senzing-garage","description":"Reads formatted search records, calls Senzing, and outputs for analysis","archived":false,"fork":false,"pushed_at":"2026-02-13T20:40:49.000Z","size":269,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-14T00:34:04.350Z","etag":null,"topics":["g2-python","senzing-cleanup","senzing-g2-python","utility"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/senzing-garage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-11T17:10:56.000Z","updated_at":"2026-02-13T20:40:02.000Z","dependencies_parsed_at":"2023-11-27T22:24:43.321Z","dependency_job_id":"cbac623e-c191-42e2-9b6b-023f21cf2692","html_url":"https://github.com/senzing-garage/g2search","commit_stats":null,"previous_names":["senzing-garage/g2search"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/senzing-garage/g2search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senzing-garage%2Fg2search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senzing-garage%2Fg2search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senzing-garage%2Fg2search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senzing-garage%2Fg2search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/senzing-garage","download_url":"https://codeload.github.com/senzing-garage/g2search/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senzing-garage%2Fg2search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32245150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["g2-python","senzing-cleanup","senzing-g2-python","utility"],"created_at":"2026-04-24T23:35:31.873Z","updated_at":"2026-04-24T23:35:32.571Z","avatar_url":"https://github.com/senzing-garage.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# g2search\n\nIf you are beginning your journey with [Senzing],\nplease start with [Senzing Quick Start guides].\n\nYou are in the [Senzing Garage] where projects are \"tinkered\" on.\nAlthough this GitHub repository may help you understand an approach to using Senzing,\nit's not considered to be \"production ready\" and is not considered to be part of the Senzing product.\nHeck, it may not even be appropriate for your application of Senzing!\n\n## Overview\n\nThe [G2Search.py] utility reads a file of json formatted search records, calling the search API for each, and logs\nthe results to a csv file for analysis. It employs a configuration file to control the output.\n\nUsage:\n\n```console\npython3 G2Search.py --help\nusage: G2Search.py [-h] [-c CONFIG_FILE_NAME] [-i INPUT_FILE_NAME] [-o OUTPUT_FILE_ROOT] [-nt THREAD_COUNT] [-A] [-D]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONFIG_FILE_NAME, --config_file_name CONFIG_FILE_NAME\n                        Path and name of optional G2Module.ini file to use.\n  -i INPUT_FILE_NAME, --input_file_name INPUT_FILE_NAME\n                        the name of a json input file\n  -o OUTPUT_FILE_ROOT, --output_file_root OUTPUT_FILE_ROOT\n                        root name for output files created, both a csv and a json stats file will be created\n  -nt THREAD_COUNT, --thread_count THREAD_COUNT\n                        number of threads to start, defaults to max available\n  -A, --do_audit        compute precision and recall (requires expected record_id in search record)\n  -D, --debug           run in debug mode\n```\n\n## Contents\n\n1. [Prerequisites]\n1. [Input file]\n1. [Configuration file]\n1. [Typical use]\n1. [Sample output]\n\n### Prerequisites\n\n- Python 3.6 or higher\n- Senzing API version 3.00 or higher\n\n1. Place the following files in a directory of your choice:\n\n   - [G2Search.py]\n   - [search_config_template.json]\n\n2. The senzing environment must be set to your project.\n\n### Input file\n\nThe input file should contain a list of search records formatted according to the [Senzing Generic Entity Specification]\n\n### Configuration file\n\nSee the [search_config_template.json]. This is a template that containing the likely settings you\nwould use for each search you perform. Feel free to clone it and adjust the settings to fit your desired output.\n\nThere are three sections in this template:\n\n#### Filtering section\n\nFilters include:\n\n- max_return_count: only return the top (n) matches\n- match_score_filter: minimum computed match_score (see scoring section below)\n- match_level_filter: maximum match level (1=resolved, 2=possible match, 3=possibly related)\n- data_source_filter: entity must contain a record from a particular data source\n\n#### Scoring section\n\nThis section dictates the weighted scoring of search results. see the article [Scoring-Search-Results]\n\n#### Output Columns section\n\nThe syntax for each output column is:\n\n- {\"any column name\": \"{any python fstring expression}\"}\n\npython fstring values should come from either the search_record or the matched_entity values.\n\nIn addition to what is in the default [search_config_template.json], you can also choose any other attributes in the matched_entity structure computed in the score_entities function in the [G2Search.py]\n\n### Typical use\n\n```console\npython G2Search.py -c search_config_template.json -i /search_input.json -o search_result\n```\n\nYou can also use the -nt THREAD_COUNT to increase the number of threads from the default max available. For instance, if access to the database is slow, you may want to double the number of threads as they spend a lot of time waiting on database queries.\n\n### Sample output\n\n_see the [sample_search_result.csv] file to see the result of all your searches_\n\nAll of the search results are output to a csv file.\n\nThere will be one or more rows for each search record.\n\n- match_number: the match_number column will be zero if no rows are found match_number 1 will be the\n  best match found as determined by the weighted score. match_numbers 2-n are any additional matches\n  found also ranked by the weighed score.\n\n_see the [sample_search_result.json] file_\n\nThese accumulated statistics are displayed at the end of the run and captured in the output json file.\n\n[Senzing]: https://senzing.com/\n[Senzing Quick Start guides]: https://docs.senzing.com/quickstart/\n[Senzing Garage]: https://github.com/senzing-garage\n[G2Search.py]: G2Search.py\n[Prerequisites]: #prerequisites\n[Input file]: #input-file\n[Configuration file]: #configuration-file\n[Typical use]: #typical-use\n[Sample output]: #sample-output\n[search_config_template.json]: search_config_template.json\n[Senzing Generic Entity Specification]: https://senzing.zendesk.com/hc/en-us/articles/231925448-Generic-Entity-Specification-Data-Mapping\n[Scoring-Search-Results]: https://senzing.zendesk.com/hc/en-us/articles/360047855193-Scoring-Search-Results\n[sample_search_result.csv]: sample_search_result.csv\n[sample_search_result.json]: sample_search_result.json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenzing-garage%2Fg2search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsenzing-garage%2Fg2search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenzing-garage%2Fg2search/lists"}