{"id":13582285,"url":"https://github.com/dongri/phonenumber","last_synced_at":"2025-04-04T21:08:44.252Z","repository":{"id":20086232,"uuid":"88755293","full_name":"dongri/phonenumber","owner":"dongri","description":"With a given country and phone number, validate and format the MOBILE phone number to E.164 standard","archived":false,"fork":false,"pushed_at":"2024-02-08T11:10:02.000Z","size":112,"stargazers_count":162,"open_issues_count":1,"forks_count":42,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-02T06:11:29.722Z","etag":null,"topics":["golang","normalize","number","phone"],"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/dongri.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}},"created_at":"2017-04-19T14:35:02.000Z","updated_at":"2024-04-19T03:43:05.000Z","dependencies_parsed_at":"2023-02-18T01:16:20.851Z","dependency_job_id":"c7dcb162-3d52-4dd7-a797-7e5543d8ea2e","html_url":"https://github.com/dongri/phonenumber","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fphonenumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fphonenumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fphonenumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fphonenumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dongri","download_url":"https://codeload.github.com/dongri/phonenumber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249526,"owners_count":20908212,"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":["golang","normalize","number","phone"],"created_at":"2024-08-01T15:02:34.281Z","updated_at":"2025-04-04T21:08:44.230Z","avatar_url":"https://github.com/dongri.png","language":"Go","readme":"# phonenumber\n![Coverage](https://img.shields.io/badge/Coverage-99.4%25-brightgreen)\n[![Run Tests](https://github.com/dongri/phonenumber/actions/workflows/run-tests.yml/badge.svg)](https://github.com/dongri/phonenumber/actions?query=branch%3Amaster)\n## Description\n\ngolang port of AfterShip/phone\n\nphonenumber is used to normalize the mobile phone or landline number into a E.164 format.\n\nThe common problem is user normally input the phone number in this way:\n\n```\n09061354467 or\n090-6135-4467 or\n(090) 6135-4467 or\n819061354467 or\n+819061354467 or\n81(90) 6135-4467 or\n+81(90) 6135-4467 or ...\n```\n\nWhat we want is always:\n\n```\n819061354467\n```\n\n## Installation\nRun the following command to install the package:\n```\ngo get github.com/dongri/phonenumber\n```\n\n## Usage\n\n### Clearing format\nIn this case landline numbers will be an invalid result:\n```go\nimport \"github.com/dongri/phonenumber\"\n\nnumber := phonenumber.Parse(\"090-6135-4467\", \"JP\")\nfmt.Println(number)\n// Output: 819061354467\n```\n\nIn this case you can format numbers included landline numbers:\n```go\nimport \"github.com/dongri/phonenumber\"\n\nnumber := phonenumber.ParseWithLandLine(\"+371 65 552-336\", \"LV\")\nfmt.Println(number)\n// Output: 37165552336\n```\n\n### Get country for number\n```go\nimport \"github.com/dongri/phonenumber\"\n\n// Get country with mobile and landline numbers\n// Let's try to get country for Latvian landline number\nincludeLandLine := true\ncountry := phonenumber.GetISO3166ByNumber(\"37165552336\", includeLandLine)\nfmt.Println(country.CountryName)\n// Output: Latvia\n\n// Get country with mobile numbers only\nincludeLandLine = false\ncountry := phonenumber.GetISO3166ByNumber(\"37165552336\", includeLandLine)\nfmt.Println(country.CountryName)\n// Output:\n```\n\n## License\nMIT\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongri%2Fphonenumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongri%2Fphonenumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongri%2Fphonenumber/lists"}