{"id":22281961,"url":"https://github.com/whisperfish/rust-phonenumber","last_synced_at":"2025-05-14T18:05:41.036Z","repository":{"id":44704334,"uuid":"95766784","full_name":"whisperfish/rust-phonenumber","owner":"whisperfish","description":"Library for parsing, formatting and validating international phone numbers.","archived":false,"fork":false,"pushed_at":"2025-01-11T12:53:33.000Z","size":4781,"stargazers_count":170,"open_issues_count":31,"forks_count":55,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-09T05:03:18.550Z","etag":null,"topics":["formatter","parser","phone-number","rust","rust-library","validator"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/whisperfish.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":"2017-06-29T10:30:17.000Z","updated_at":"2025-03-24T12:48:44.000Z","dependencies_parsed_at":"2024-12-10T17:05:07.491Z","dependency_job_id":"bbd0749b-748c-4b0f-91ce-4b40ba7df250","html_url":"https://github.com/whisperfish/rust-phonenumber","commit_stats":null,"previous_names":["1aim/rust-phonenumber"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whisperfish%2Frust-phonenumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whisperfish%2Frust-phonenumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whisperfish%2Frust-phonenumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whisperfish%2Frust-phonenumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whisperfish","download_url":"https://codeload.github.com/whisperfish/rust-phonenumber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253678839,"owners_count":21946314,"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":["formatter","parser","phone-number","rust","rust-library","validator"],"created_at":"2024-12-03T16:23:54.898Z","updated_at":"2025-05-14T18:05:36.028Z","avatar_url":"https://github.com/whisperfish.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phonenumber\n\n![CI Build](https://github.com/whisperfish/rust-phonenumber/workflows/Build/badge.svg)\n[![Crates.io](https://img.shields.io/crates/v/phonenumber.svg)](https://crates.io/crates/phonenumber)\n[![phonenumber](https://docs.rs/phonenumber/badge.svg)](https://docs.rs/phonenumber)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nRust version of [libphonenumber](https://github.com/googlei18n/libphonenumber).\nWe currently require 1.58.0 as minimum supported Rust version (MSRV).\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nphonenumber = \"0.3\"\n```\n## Example\n\nThe following example parses, validates and formats the given phone number.\n\n```rust,no_run\nuse phonenumber::Mode;\nuse std::env;\n\nfn main() {\n\tlet mut args = env::args().skip(1).collect::\u003cVec\u003c_\u003e\u003e();\n\n\tif args.len() \u003c 1 {\n\t\tpanic!(\"not enough arguments\");\n\t}\n\n\tlet number  = args.pop().unwrap();\n\tlet country = args.pop().map(|c| c.parse().unwrap());\n\n\tlet number = phonenumber::parse(country, number).unwrap();\n\tlet valid  = phonenumber::is_valid(\u0026number);\n\n\tif valid {\n\t\tprintln!(\"\\x1b[32m{:#?}\\x1b[0m\", number);\n\t\tprintln!();\n\t\tprintln!(\"International: {}\", number.format().mode(Mode::International));\n\t\tprintln!(\"     National: {}\", number.format().mode(Mode::National));\n\t\tprintln!(\"      RFC3966: {}\", number.format().mode(Mode::Rfc3966));\n\t\tprintln!(\"        E.164: {}\", number.format().mode(Mode::E164));\n\t}\n\telse {\n\t\tprintln!(\"\\x1b[31m{:#?}\\x1b[0m\", number);\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhisperfish%2Frust-phonenumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhisperfish%2Frust-phonenumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhisperfish%2Frust-phonenumber/lists"}