{"id":19946844,"url":"https://github.com/datainq/teryt","last_synced_at":"2025-08-18T01:32:18.383Z","repository":{"id":57545792,"uuid":"298915623","full_name":"datainq/teryt","owner":"datainq","description":"A tiny Golang library to parse and work with Polish TERYT database","archived":false,"fork":false,"pushed_at":"2020-10-22T19:39:07.000Z","size":9760,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T15:49:45.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/datainq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-26T23:19:07.000Z","updated_at":"2020-10-22T19:38:54.000Z","dependencies_parsed_at":"2022-09-05T10:50:47.204Z","dependency_job_id":null,"html_url":"https://github.com/datainq/teryt","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/datainq/teryt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fteryt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fteryt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fteryt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fteryt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datainq","download_url":"https://codeload.github.com/datainq/teryt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fteryt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270932564,"owners_count":24670240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-13T00:32:59.956Z","updated_at":"2025-08-18T01:32:18.332Z","avatar_url":"https://github.com/datainq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# teryt ![CI](https://github.com/datainq/teryt/workflows/CI/badge.svg)\n\n[TERYT](https://pl.wikipedia.org/wiki/TERYT) - Krajowy Rejestr Urzędowy Podziału Terytorialnego Kraju\nis an Polish official registry of country administrative division. \n\nSource: http://eteryt.stat.gov.pl/eTeryt/rejestr_teryt/udostepnianie_danych/baza_teryt/uzytkownicy_indywidualni/pobieranie/pliki_pelne_struktury.aspx\n\nThe registry has four parts:\n * TERC - identifiers and names of administrative units,\n * SIMC - identifiers nad names of places,\n * BREC - statistical regions and census areas,\n * NOBC - (it includes ULIC), address identification of streets, estate, buildings and apartments.\n\nThis library provides parser for the TERC, SIMC, ULIC\ndatasets.\n\nThe full data files are available at official GUS website:\nhttp://eteryt.stat.gov.pl/eTeryt/rejestr_teryt/udostepnianie_danych/baza_teryt/uzytkownicy_indywidualni/pobieranie/pobieranie.aspx?contrast=default\n\n## Install\n\n```\ngo get github.com/datainq/teryt\n```\n\n## Usage\n\nYou need to download data files. After loading you can work on it.\n\nCheck example search program in `cmd/search.go`. \nYou can run it by executing in a main repo directory:\n\n```\n\u003e go run cmd/search.go -simc data/SIMC_Urzedowy_2020-09-26.zip -terc data/TERC_Urzedowy_2020-09-26.zip\n\nINFO[0000] terc: data/TERC_Urzedowy_2020-09-26.zip\nINFO[0000] simc: data/SIMC_Urzedowy_2020-09-26.zip\n\u003eOlsztyn\nsearch for \"olsztyn\"\nResults: (24.767138ms)\n0. dist 0: WARMIŃSKO-MAZURSKIE Olsztyn (miasto na prawach powiatu)\n1. dist 0: ŚLĄSKIE częstochowski Olsztyn (gmina wiejska)\n2. dist 0: ŚLĄSKIE częstochowski Olsztyn Olsztyn (wieś)\n3. dist 1: WIELKOPOLSKIE wolsztyński Wolsztyn (gmina miejsko-wiejska)\n4. dist 1: WIELKOPOLSKIE wolsztyński Wolsztyn (miasto)\n5. dist 1: WIELKOPOLSKIE wolsztyński Wolsztyn (obszar wiejski)\n6. dist 1: LUBELSKIE bialski Rokitno Olszyn (wieś)\n7. dist 1: WIELKOPOLSKIE wolsztyński Wolsztyn Wolsztyn (miasto)\n8. dist 1: WIELKOPOLSKIE czarnkowsko-trzcianecki Wieleń Folsztyn (wieś)\n9. dist 2: DOLNOŚLĄSKIE lubański Olszyna (gmina miejsko-wiejska)\n\u003e\n```\n\n## Benchmarks\n\n```\ngo test -test.v -test.bench ^BenchmarkSearch_Search.*$ -test.run ^$ -benchtime=5s\ngoos: linux\ngoarch: amd64\npkg: github.com/datainq/teryt/search\nBenchmarkSearch_SearchOld\nBenchmarkSearch_SearchOld-8   \t     172\t  34626860 ns/op\t 1804163 B/op\t  114175 allocs/op\nBenchmarkSearch_Search\nBenchmarkSearch_Search-8      \t     770\t   7788946 ns/op\t  923129 B/op\t   57257 allocs/op\nBenchmarkSearch_SearchV3\nBenchmarkSearch_SearchV3/parallel-1\nBenchmarkSearch_SearchV3/parallel-1-8         \t     901\t   6752492 ns/op\t     690 B/op\t      22 allocs/op\nBenchmarkSearch_SearchV3/parallel-2\nBenchmarkSearch_SearchV3/parallel-2-8         \t    1743\t   3525559 ns/op\t    1055 B/op\t      28 allocs/op\nBenchmarkSearch_SearchV3/parallel-3\nBenchmarkSearch_SearchV3/parallel-3-8         \t    2450\t   2430533 ns/op\t    1412 B/op\t      34 allocs/op\nBenchmarkSearch_SearchV3/parallel-4\nBenchmarkSearch_SearchV3/parallel-4-8         \t    3187\t   2001791 ns/op\t    1778 B/op\t      40 allocs/op\nBenchmarkSearch_SearchV3/parallel-5\nBenchmarkSearch_SearchV3/parallel-5-8         \t    2359\t   2427669 ns/op\t    2154 B/op\t      46 allocs/op\nBenchmarkSearch_SearchV3/parallel-6\nBenchmarkSearch_SearchV3/parallel-6-8         \t    2626\t   2103522 ns/op\t    2491 B/op\t      52 allocs/op\nBenchmarkSearch_SearchV3/parallel-7\nBenchmarkSearch_SearchV3/parallel-7-8         \t    2953\t   1835657 ns/op\t    2869 B/op\t      58 allocs/op\nBenchmarkSearch_SearchV3/parallel-8\nBenchmarkSearch_SearchV3/parallel-8-8         \t    3070\t   1693271 ns/op\t    3211 B/op\t      64 allocs/op\nPASS\nok  \tgithub.com/datainq/teryt/search\t84.667s\n```\n\n## Benchmark of levenstein function\n\n```\n/tmp/___BenchmarkAll_in_github_com_datainq_teryt_search -test.v -test.bench ^\\QBenchmarkAll\\E$ -test.run ^$\ngoos: linux\ngoarch: amd64\npkg: github.com/datainq/teryt/search\n\nBenchmarkAll\n\nBenchmarkAll/ASCII\nBenchmarkAll/ASCII/agniva\nBenchmarkAll/ASCII/agniva-8  \t 3696501\t       319 ns/op\nBenchmarkAll/ASCII/m1ome\nBenchmarkAll/ASCII/m1ome-8   \t 2402422\t       501 ns/op\nBenchmarkAll/ASCII/arbovm\nBenchmarkAll/ASCII/arbovm-8  \t 2978025\t       401 ns/op\nBenchmarkAll/ASCII/dgryski\nBenchmarkAll/ASCII/dgryski-8 \t 2841715\t       419 ns/op\nBenchmarkAll/ASCII/datainq\nBenchmarkAll/ASCII/datainq-8 \t 3842545\t       306 ns/op\nBenchmarkAll/ASCII/datainq2\nBenchmarkAll/ASCII/datainq2-8         \t 4183891\t       283 ns/op\n\nBenchmarkAll/Polish\nBenchmarkAll/Polish/agniva\nBenchmarkAll/Polish/agniva-8          \t 3356847\t       357 ns/op\nBenchmarkAll/Polish/m1ome\nBenchmarkAll/Polish/m1ome-8           \t 2727634\t       436 ns/op\nBenchmarkAll/Polish/arbovm\nBenchmarkAll/Polish/arbovm-8          \t 3106969\t       378 ns/op\nBenchmarkAll/Polish/dgryski\nBenchmarkAll/Polish/dgryski-8         \t 3026116\t       396 ns/op\nBenchmarkAll/Polish/datainq\nBenchmarkAll/Polish/datainq-8         \t 3573074\t       336 ns/op\nBenchmarkAll/Polish/datainq2\nBenchmarkAll/Polish/datainq2-8        \t 3883668\t       304 ns/op\n\nBenchmarkAll/French\nBenchmarkAll/French/agniva\nBenchmarkAll/French/agniva-8          \t 2499796\t       481 ns/op\nBenchmarkAll/French/m1ome\nBenchmarkAll/French/m1ome-8           \t 3454462\t       340 ns/op\nBenchmarkAll/French/arbovm\nBenchmarkAll/French/arbovm-8          \t 2388702\t       489 ns/op\nBenchmarkAll/French/dgryski\nBenchmarkAll/French/dgryski-8         \t 2227182\t       544 ns/op\nBenchmarkAll/French/datainq\nBenchmarkAll/French/datainq-8         \t 2646777\t       462 ns/op\nBenchmarkAll/French/datainq2\nBenchmarkAll/French/datainq2-8        \t 2740575\t       428 ns/op\n\nBenchmarkAll/Nordic\nBenchmarkAll/Nordic/agniva\nBenchmarkAll/Nordic/agniva-8          \t 1236994\t       986 ns/op\nBenchmarkAll/Nordic/m1ome\nBenchmarkAll/Nordic/m1ome-8           \t 2088196\t       520 ns/op\nBenchmarkAll/Nordic/arbovm\nBenchmarkAll/Nordic/arbovm-8          \t 1243872\t       952 ns/op\nBenchmarkAll/Nordic/dgryski\nBenchmarkAll/Nordic/dgryski-8         \t 1000000\t      1044 ns/op\nBenchmarkAll/Nordic/datainq\nBenchmarkAll/Nordic/datainq-8         \t 1356010\t       877 ns/op\nBenchmarkAll/Nordic/datainq2\nBenchmarkAll/Nordic/datainq2-8        \t 1271364\t       881 ns/op\n\nBenchmarkAll/Tibetan\nBenchmarkAll/Tibetan/agniva\nBenchmarkAll/Tibetan/agniva-8         \t 1413631\t       873 ns/op\nBenchmarkAll/Tibetan/m1ome\nBenchmarkAll/Tibetan/m1ome-8          \t 1459371\t       750 ns/op\nBenchmarkAll/Tibetan/arbovm\nBenchmarkAll/Tibetan/arbovm-8         \t 1330542\t       961 ns/op\nBenchmarkAll/Tibetan/dgryski\nBenchmarkAll/Tibetan/dgryski-8        \t 1212814\t      1022 ns/op\nBenchmarkAll/Tibetan/datainq\nBenchmarkAll/Tibetan/datainq-8        \t 1391295\t       867 ns/op\nBenchmarkAll/Tibetan/datainq2\nBenchmarkAll/Tibetan/datainq2-8       \t 1497633\t       811 ns/op\nPASS\n\nProcess finished with exit code 0\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatainq%2Fteryt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatainq%2Fteryt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatainq%2Fteryt/lists"}