{"id":13399654,"url":"https://github.com/google/libphonenumber","last_synced_at":"2026-02-13T13:57:04.586Z","repository":{"id":24112157,"uuid":"27500243","full_name":"google/libphonenumber","owner":"google","description":"Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers.","archived":false,"fork":false,"pushed_at":"2025-12-05T03:07:49.000Z","size":310504,"stargazers_count":17692,"open_issues_count":121,"forks_count":2126,"subscribers_count":396,"default_branch":"master","last_synced_at":"2025-12-06T11:22:27.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":false,"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/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-12-03T18:02:17.000Z","updated_at":"2025-12-06T08:01:25.000Z","dependencies_parsed_at":"2023-09-26T12:32:43.556Z","dependency_job_id":"9ed57eac-ef62-46b9-bf4b-90daf9807e4d","html_url":"https://github.com/google/libphonenumber","commit_stats":{"total_commits":2035,"total_committers":158,"mean_commits":"12.879746835443038","dds":0.8353808353808354,"last_synced_commit":"b27f61f779ce9e0913680cb0f4292c6d20733368"},"previous_names":["googlei18n/libphonenumber"],"tags_count":254,"template":false,"template_full_name":null,"purl":"pkg:github/google/libphonenumber","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flibphonenumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flibphonenumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flibphonenumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flibphonenumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/libphonenumber/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Flibphonenumber/sbom","scorecard":{"id":78247,"data":{"date":"2025-08-14T07:12:40Z","repo":{"name":"github.com/google/libphonenumber","commit":"568f19b4e25433a5c39e3b32786ee7d93348c143"},"scorecard":{"version":"v5.0.0-rc2","commit":"7ce8609469289d5f3b1bf5ee3122f42b4e3054fb"},"score":9.2,"checks":[{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#binary-artifacts"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#branch-protection"}},{"name":"CI-Tests","score":10,"reason":"30 out of 30 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#ci-tests"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#code-review"}},{"name":"Contributors","score":10,"reason":"project has 10 contributing companies or organizations","details":["Info: google contributor org/company found, home-assistant contributor org/company found, esphome-econet contributor org/company found, software freedom institute contributor org/company found, microsoft contributor org/company found, Azure contributor org/company found, rsnapshot contributor org/company found, google  @googlei18n contributor org/company found, unicode-org contributor org/company found, gallery contributor org/company found, "],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#contributors"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#dangerous-workflow"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#dependency-update-tool"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: OSSFuzz integration found","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_asyoutypeformatter.cc:44","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_matcher.cc:44","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_phone.cc:44","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_shortnumberinfo.cc:44","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_asyoutypeformatter.cc:44","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_matcher.cc:44","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_phone.cc:44","Info: CppLibFuzzer integration found: cpp/test/phonenumbers/fuzz_shortnumberinfo.cc:44"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#license"}},{"name":"Maintained","score":10,"reason":"25 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":9,"reason":"dependency not pinned by hash detected -- score normalized to 9","details":["Warn: npmCommand not pinned by hash: .github/workflows/java-unit-test.yml:49","Info:  13 out of  13 GitHub-owned GitHubAction dependencies pinned","Info:   8 out of   8 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#sast"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":8,"reason":"5 out of the last 5 releases have a total of 5 signed artifacts.","details":["Info: signed release artifact: libphonenumber-9.0.11.tar.gz.asc: https://api.github.com/repos/google/libphonenumber/releases/assets/279112810","Info: signed release artifact: libphonenumber-9.0.10.tar.gz.asc: https://api.github.com/repos/google/libphonenumber/releases/assets/274010801","Info: signed release artifact: libphonenumber-9.0.9.tar.gz.asc: https://api.github.com/repos/google/libphonenumber/releases/assets/270911331","Info: signed release artifact: libphonenumber-9.0.8.tar.gz.asc: https://api.github.com/repos/google/libphonenumber/releases/assets/266775846","Info: signed release artifact: libphonenumber-9.0.7.tar.gz.asc: https://api.github.com/repos/google/libphonenumber/releases/assets/262208120","Warn: release artifact v9.0.11 does not have provenance: https://api.github.com/repos/google/libphonenumber/releases/237221443","Warn: release artifact v9.0.10 does not have provenance: https://api.github.com/repos/google/libphonenumber/releases/233376810","Warn: release artifact v9.0.9 does not have provenance: https://api.github.com/repos/google/libphonenumber/releases/230649647","Warn: release artifact v9.0.8 does not have provenance: https://api.github.com/repos/google/libphonenumber/releases/227328926","Warn: release artifact v9.0.7 does not have provenance: https://api.github.com/repos/google/libphonenumber/releases/223904999"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#signed-releases"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:31","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:32","Info: jobLevel 'contents' permission set to 'read': .github/workflows/scorecards.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/scorecards.yml:30","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:24","Info: topLevel 'contents' permission set to 'read': .github/workflows/cpp-unit-test.yml:6","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:13","Info: topLevel 'contents' permission set to 'read': .github/workflows/java-unit-test.yml:6","Info: topLevel 'actions' permission set to 'read': .github/workflows/osv-scanner-unified.yml:28","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/osv-scanner-unified.yml:30","Info: topLevel 'contents' permission set to 'read': .github/workflows/osv-scanner-unified.yml:32","Info: topLevel permissions set to 'read-all': .github/workflows/scorecards.yml:18","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#token-permissions"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vv7r-c36w-3prj","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T05:16:44.157Z","repository_id":24112157,"created_at":"2025-08-15T05:16:44.158Z","updated_at":"2025-08-15T05:16:44.158Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27569098,"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-12-07T02:00:07.896Z","response_time":53,"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-07-30T19:00:40.920Z","updated_at":"2026-02-13T13:57:04.578Z","avatar_url":"https://github.com/google.png","language":"C++","funding_links":[],"categories":["C++","Publishing Preparations","\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","Phone Numbers"],"sub_categories":["UI Test Automation Scripting"],"readme":"\u003cp align=\"right\"\u003e\n\u003cimg src=\"https://travis-ci.org/google/libphonenumber.svg?branch=master\"\u003e\n\u003c/p\u003e\n\n# What is it?\n\nGoogle's common Java, C++ and JavaScript library for parsing, formatting, and\nvalidating international phone numbers. The Java version is optimized for\nrunning on smartphones, and is used by the Android framework since 4.0 (Ice\nCream Sandwich).\n\n# Quick links\n\n*   **Reporting an issue?** Want to send a pull request? See the [contribution\n    guidelines](CONTRIBUTING.md)\n*   Check the [frequently asked questions](FAQ.md)\n*   Fun! [Falsehoods Programmers Believe About Phone Numbers](FALSEHOODS.md)\n*   Look for\n    [`README`s](https://github.com/google/libphonenumber/find/master) in\n    directories relevant to the code you're interested in.\n*   For contributors and porters: [How to run the Java demo](run-java-demo.md)\n*   For porters: [How to make metadata changes](making-metadata-changes.md)\n\n# Highlights of functionality\n\n*   Parsing, formatting, and validating phone numbers for all countries/regions\n    of the world.\n*   `getNumberType` - gets the type of the number based on the number itself;\n    able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared\n    Cost, VoIP, Personal Numbers, UAN, Pager, and Voicemail (whenever feasible).\n*   `isNumberMatch` - gets a confidence level on whether two numbers could be\n    the same.\n*   `getExampleNumber` and `getExampleNumberForType` - provide valid example\n    numbers for all countries/regions, with the option of specifying which type\n    of example phone number is needed.\n*   `isPossibleNumber` - quickly guesses whether a number is a possible\n    phone number by using only the length information, much faster than a full\n    validation.\n*   `isValidNumber` - full validation of a phone number for a region using\n    length and prefix information.\n*   `AsYouTypeFormatter` - formats phone numbers on-the-fly when users enter\n    each digit.\n*   `findNumbers` - finds numbers in text.\n*   `PhoneNumberOfflineGeocoder` - provides geographical information related to\n    a phone number.\n*   `PhoneNumberToCarrierMapper` - provides carrier information related to a\n    phone number.\n*   `PhoneNumberToTimeZonesMapper` - provides timezone information related to a\n    phone number.\n\n# Demo\n\n## Java\n\nThe [Java demo](https://libphonenumber.appspot.com/) is updated with a slight\ndelay after the GitHub release.\n\nLast demo update: v9.0.24.\n\nNote: Even though the library (main branch/[maven release](https://repo1.maven.org/maven2/com/googlecode/libphonenumber/libphonenumber/8.12.56/))\nis at v8.12.57, because of some deployment issues, we were unable to update the\nJava demo with the new binary version. We will soon fix this. Meantime, please\nuse JS demo.\n\nIf this number is lower than the [latest release's version\nnumber](https://github.com/google/libphonenumber/releases), we are between\nreleases and the demo may be at either version.\n\n### Demo App\n\nThere is a demo Android App called [E.164 Formatter](java/demoapp) in this\nrepository. The purpose of this App is to show an example of how the library can\nbe used in a real-life situation, in this case specifically in an Android App\nusing Java.\n\n## JavaScript\n\nThe [JavaScript\ndemo](https://htmlpreview.github.io/?https://github.com/google/libphonenumber/blob/master/javascript/i18n/phonenumbers/demo-compiled.html)\nmay be run at various tags; this link will take you to `master`.\n\n# Java code\n\nTo include the Java code in your application, either integrate with Maven (see\n[wiki](https://github.com/google/libphonenumber/wiki)) or download the latest\njars from the [Maven\nrepository](https://repo1.maven.org/maven2/com/googlecode/libphonenumber/libphonenumber/).\n\n# Javadoc\n\nJavadoc is automatically updated to reflect the latest release at\nhttps://javadoc.io/doc/com.googlecode.libphonenumber/libphonenumber/.\n\n# Versioning and Announcements\n\nWe generally choose the release number following these guidelines.\n\nIf any of the changes pushed to master since the last release are incompatible\nwith the intent / specification of an existing libphonenumber API or may cause\nlibphonenumber (Java, C++, or JS) clients to have to change their code to keep\nbuilding, we publish a major release. For example, if the last release were\n7.7.3, the new one would be 8.0.0.\n\nIf any of those changes *enable* clients to update their code to take advantage\nof new functionality, and if clients would have to roll-back these changes in\nthe event that the release was marked as \"bad\", we publish a minor release. For\nexample, we'd go from 7.7.3 to 7.8.0.\n\nOtherwise, including when a release contains only\n[metadata](FAQ.md#metadata_definition) changes, we publish a sub-minor release,\ne.g. 7.7.3 to 7.7.4.\n\nSometimes we make internal changes to the code or metadata that, while not\naffecting compatibility for clients, could affect compatibility for **porters**\nof the library. For such changes we make announcements to\n[libphonenumber-discuss](\nhttps://groups.google.com/forum/#!forum/libphonenumber-discuss). Such changes\nare not reflected in the version number, and we would publish a sub-minor\nrelease if there were no other changes.\n\nWant to get notified of new releases? During most of the year, excepting\nholidays and extenuating circumstances, we release fortnightly. We update\n[release tags](https://github.com/google/libphonenumber/releases) and\ndocument detailed [release notes](\nhttps://github.com/google/libphonenumber/blob/master/release_notes.txt).\nWe also send an announcement to [libphonenumber-discuss](\nhttps://groups.google.com/forum/#!forum/libphonenumber-discuss) for every\nrelease.\n\n# Quick Examples\n\nLet's say you have a string representing a phone number from Switzerland. This\nis how you parse/normalize it into a `PhoneNumber` object:\n\n```java\nString swissNumberStr = \"044 668 18 00\";\nPhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();\ntry {\n  PhoneNumber swissNumberProto = phoneUtil.parse(swissNumberStr, \"CH\");\n} catch (NumberParseException e) {\n  System.err.println(\"NumberParseException was thrown: \" + e.toString());\n}\n```\n\nAt this point, `swissNumberProto` contains:\n\n```json\n{\n  \"country_code\": 41,\n  \"national_number\": 446681800\n}\n```\n\n`PhoneNumber` is a class that was originally auto-generated from\n`phonenumber.proto` with necessary modifications for efficiency. For details on\nthe meaning of each field, refer to `resources/phonenumber.proto`.\n\nNow let us validate whether the number is valid:\n\n```java\nboolean isValid = phoneUtil.isValidNumber(swissNumberProto); // returns true\n```\n\nThere are a few formats supported by the formatting method, as illustrated\nbelow:\n\n```java\n// Produces \"+41 44 668 18 00\"\nSystem.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.INTERNATIONAL));\n// Produces \"044 668 18 00\"\nSystem.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.NATIONAL));\n// Produces \"+41446681800\"\nSystem.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.E164));\n```\n\nYou could also choose to format the number in the way it is dialed from another\ncountry:\n\n```java\n// Produces \"011 41 44 668 1800\", the number when it is dialed in the United States.\nSystem.out.println(phoneUtil.formatOutOfCountryCallingNumber(swissNumberProto, \"US\"));\n```\n\n## Formatting Phone Numbers 'as you type'\n\n```java\nPhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();\nAsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(\"US\");\nSystem.out.println(formatter.inputDigit('6'));  // Outputs \"6\"\n...  // Input more digits\nSystem.out.println(formatter.inputDigit('3'));  // Now outputs \"650 253\"\n```\n\n## Geocoding Phone Numbers\n\n```java\nPhoneNumberOfflineGeocoder geocoder = PhoneNumberOfflineGeocoder.getInstance();\n// Outputs \"Zurich\"\nSystem.out.println(geocoder.getDescriptionForNumber(swissNumberProto, Locale.ENGLISH));\n// Outputs \"Zürich\"\nSystem.out.println(geocoder.getDescriptionForNumber(swissNumberProto, Locale.GERMAN));\n// Outputs \"Zurigo\"\nSystem.out.println(geocoder.getDescriptionForNumber(swissNumberProto, Locale.ITALIAN));\n```\n\n## Mapping Phone Numbers to original carriers\n\nCaveat: We do not provide data about the current carrier of a phone number, only\nthe original carrier who is assigned the corresponding range. Read about [number\nportability](FAQ.md#what-is-mobile-number-portability).\n\n```java\nPhoneNumber swissMobileNumber =\n    new PhoneNumber().setCountryCode(41).setNationalNumber(798765432L);\nPhoneNumberToCarrierMapper carrierMapper = PhoneNumberToCarrierMapper.getInstance();\n// Outputs \"Swisscom\"\nSystem.out.println(carrierMapper.getNameForNumber(swissMobileNumber, Locale.ENGLISH));\n```\n\nMore examples on how to use the library can be found in the [unit\ntests](https://github.com/google/libphonenumber/tree/master/java/libphonenumber/test/com/google/i18n/phonenumbers).\n\n# Third-party Ports\n\nSeveral third-party ports of the phone number library are known to us. We share\nthem here in case they're useful for developers.\n\nHowever, we emphasize that these ports are by developers outside the\nlibphonenumber project. We do not evaluate their quality or influence their\nmaintenance processes.\n\n*   C#: https://github.com/twcclegg/libphonenumber-csharp\n*   Gleam: https://github.com/massivefermion/phony\n*   Go: https://github.com/nyaruka/phonenumbers\n*   Objective-c: https://github.com/iziz/libPhoneNumber-iOS\n*   Swift: https://github.com/marmelroy/PhoneNumberKit\n*   PHP: https://github.com/giggsey/libphonenumber-for-php\n*   PostgreSQL in-database types: https://github.com/blm768/pg-libphonenumber\n*   Python: https://github.com/daviddrysdale/python-phonenumbers\n*   Ruby: https://github.com/ianks/mini_phone\n*   Ruby: https://github.com/daddyz/phonelib\n*   Ruby: https://github.com/mobi/telephone_number\n*   Rust: https://github.com/vloldik/rlibphonenumber\n*   Rust: https://github.com/1aim/rust-phonenumber\n*   Erlang: https://github.com/marinakr/libphonenumber_erlang\n*   Clojure: https://github.com/randomseed-io/phone-number\n*   R: https://github.com/socialresearchcentre/dialr/\n*   Elixir: https://github.com/socialpaymentsbv/ex_phone_number\n*   Salesforce: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G12oJUAR\n*   Dart: https://github.com/superakabo/dlibphonenumber\n  \nAlternatives to our own versions:\n\n*   Android-optimized: Our Java version loads the metadata from\n    `Class#getResourcesAsStream` and asks that Android apps follow the Android\n    loading best practices of repackaging the metadata and loading from\n    `AssetManager#open()` themselves\n    ([FAQ](https://github.com/google/libphonenumber/blob/master/FAQ.md#optimize-loads)).\n    If you don't want to do this, check out the port at\n    https://github.com/MichaelRocks/libphonenumber-android, which does repackage\n    the metadata and use `AssetManager#open()`, and may be depended on without\n    needing those specific loading optimizations from clients. You should also check\n    out the port at https://github.com/lionscribe/libphonenumber-android which also\n    supports geocoding, and only requires a one line code change.\n*   Javascript: If you don't want to use our version, which depends on Closure,\n    there are several other options, including\n    https://github.com/catamphetamine/libphonenumber-js - a stripped-down\n    rewrite, about 110 KB in size - and\n    https://github.com/seegno/google-libphonenumber - a browserify-compatible\n    wrapper around the original unmodified library installable via npm, which\n    packs the Google Closure library, about 420 KB in size.\n\nTools based on libphonenumber metadata:\n\n*   Scala: https://github.com/mr-tolmach/raf - library for generating valid phone numbers in the E.164 format\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Flibphonenumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Flibphonenumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Flibphonenumber/lists"}