{"id":18301896,"url":"https://github.com/fegoa89/zipcodes","last_synced_at":"2025-04-05T14:31:18.597Z","repository":{"id":57547752,"uuid":"180545098","full_name":"fegoa89/zipcodes","owner":"fegoa89","description":"Zipcode geocoding and distance calculation using datasets from http://www.geonames.org/","archived":false,"fork":false,"pushed_at":"2023-04-13T19:36:04.000Z","size":8,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T05:43:09.952Z","etag":null,"topics":["geonames","golang","golang-package","postal-code","zipcodes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fegoa89.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-10T09:10:34.000Z","updated_at":"2024-09-28T06:57:50.000Z","dependencies_parsed_at":"2024-06-20T16:36:49.146Z","dependency_job_id":"4024573f-0c02-4557-8467-c733f983b962","html_url":"https://github.com/fegoa89/zipcodes","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/fegoa89%2Fzipcodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2Fzipcodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2Fzipcodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2Fzipcodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fegoa89","download_url":"https://codeload.github.com/fegoa89/zipcodes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247352541,"owners_count":20925288,"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":["geonames","golang","golang-package","postal-code","zipcodes"],"created_at":"2024-11-05T15:17:20.889Z","updated_at":"2025-04-05T14:31:13.584Z","avatar_url":"https://github.com/fegoa89.png","language":"Go","readme":"# zipcodes - Zip Code Lookups\n\nA Zipcode lookup package that uses the GeoNames Postal Code dataset from http://www.geonames.org .\nYou can initialize it with a Postal Code dataset downloaded from http://download.geonames.org/export/zip .\n\n## Install\n\nInstall with\n```sh\ngo get github.com/fegoa89/zipcodes\n```\n\n### Initialize Struct\nInitializes a zipcodes struct. It will throw an error if:\n- The file does not exist / wrong format.\n- Some of the lines contain less that 12 elements (in the readme.txt of each postal code dataset, they define up to 12 elements).\n- Where latitude / longitude value are contains a wrong format (string that can not be converted to `float64`).\n\n```golang\nzipcodesDataset, err := zipcodes.New(\"path/to/my/dataset.txt\")\n```\n\n### Lookup\nLooks for a zipcode inside the map interface we loaded. If the object can not be found by the zipcode, it will return an error. \nWhen a object is found, returns its zipcode, place name, administrative name, latitude and longitude:\n\n```golang\nlocation, err := zipcodesDataset.Lookup(\"10395\")\n```\n\n### DistanceInKm\nReturns the line of sight distance between two zipcodes in kilometers:\n\n```golang\nlocation, err := zipcodesDataset.DistanceInKm(\"01945\", \"03058\") // 49.87\n```\n\n### DistanceInMiles\nReturns the line of sight distance between two zipcodes in miles:\n\n```golang\nlocation, err := zipcodesDataset.DistanceInMiles(\"01945\", \"03058\") // 30.98\n```\n\n### DistanceInKmToZipCode\nCalculates the distance between a zipcode and a give lat/lon in Kilometers:\n\n```golang\nlocation, err := zipcodesDataset.DistanceInKmToZipCode(\"01945\", 51.4267, 13.9333) // 1.11\n```\n\n### DistanceInMilToZipCode\nCalculates the distance between a zipcode and a give lat/lon in Miles:\n\n```golang\nlocation, err := zipcodesDataset.DistanceInMilToZipCode(\"01945\", 51.4267, 13.9333) // 0.69\n```\n\n### GetZipcodesWithinKmRadius\nReturns a list of zipcodes within the radius of this zipcode in Kilometers:\n\n```golang\nlocation, err := zipcodesDataset.GetZipcodesWithinKmRadius(\"01945\", 50) // [\"03058\"]\n```\n\n### GetZipcodesWithinMlRadius\nReturns a list of zipcodes within the radius of this zipcode in Miles:\n\n```golang\nlocation, err := zipcodesDataset.GetZipcodesWithinMlRadius(\"01945\", 50) // [\"03058\"]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffegoa89%2Fzipcodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffegoa89%2Fzipcodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffegoa89%2Fzipcodes/lists"}