{"id":24559260,"url":"https://github.com/parcellab/regionidentifier","last_synced_at":"2025-03-16T19:41:45.007Z","repository":{"id":8892266,"uuid":"59992664","full_name":"parcelLab/regionIdentifier","owner":"parcelLab","description":"Identify the region code ISO 3166-2 from a country and zip code.","archived":false,"fork":false,"pushed_at":"2023-08-01T07:02:16.000Z","size":2590,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-04-14T12:19:43.323Z","etag":null,"topics":["team-architecture"],"latest_commit_sha":null,"homepage":"https://parcellab.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parcelLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-30T08:13:17.000Z","updated_at":"2024-06-05T13:17:32.564Z","dependencies_parsed_at":"2024-06-05T13:17:30.648Z","dependency_job_id":"2d257936-0342-4b71-a034-cdfb381523b8","html_url":"https://github.com/parcelLab/regionIdentifier","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2FregionIdentifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2FregionIdentifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2FregionIdentifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2FregionIdentifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parcelLab","download_url":"https://codeload.github.com/parcelLab/regionIdentifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243922341,"owners_count":20369382,"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","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":["team-architecture"],"created_at":"2025-01-23T06:16:04.852Z","updated_at":"2025-03-16T19:41:44.981Z","avatar_url":"https://github.com/parcelLab.png","language":"JavaScript","readme":"# Region Identifier\n\nUtility module that provides an easy way to identify the region of the country depending on the postal code, brings a set of determined regions for some of the countries and if it doesn't find a match uses google geolocation API to get the region.\n\n*Relevant links:*\n* https://en.wikipedia.org/wiki/ISO_3166-2 — codes used for all the regions can be found here\n* https://en.wikipedia.org/wiki/Category:Postal_codes_by_country - explanations of postal code structure per country\n* https://download.geonames.org/export/zip/ - all the Geoname files for download (see below)\n\n#### Predefined Regions\n- AUT\n- BEL\n- CAN\n- CHE\n- DEU\n- ESP\n- FIN\n- FRA\n- GBR\n- ITA\n- MEX\n- NLD\n- RUS\n- SWE\n- USA\n\n## Test\n```sh\n$ npm test\n```\n\n### License\nThis module was built using adapted information from http://download.geonames.org/ that's registered under the **CC BY 3.0** as well as this module.\nLink to more information about **CC BY 3.0** http://creativecommons.org/licenses/by/3.0/.\n\n## Usage\n\n#### Basic:\n```javascript\nconst { RegionIdentifier } = requrie('regionIdentifier');\nconst identifier = new RegionIdentifier('\u003cGOOGLE API KEY\u003e');\n```\n#### Get region:\n```javascript\n//Using country name\nidentifier.get('Deutschland', '6578')\n    .then(([region, googleUsed])) =\u003e {\n        console.log(region); // null DE-TH\n    }\n    .catch((err) =\u003e {\n        console.error(err);\n    });\n\n//using ISO3 code\nidentifier.get('DEU', '6578')\n    .then(([region, googleUsed])) =\u003e {\n        console.log(region); // null DE-TH\n    }\n    .catch((err) =\u003e {\n        console.error(err);\n    });\n\n//using ISO2 code\nidentifier.get('DE', '6578')\n    .then(([region, googleUsed])) =\u003e {\n        console.log(region); // null DE-TH\n    }\n    .catch((err) =\u003e {\n        console.error(err);\n    });\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Fregionidentifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparcellab%2Fregionidentifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Fregionidentifier/lists"}