libphonenumber-csharp 8.13.16

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package libphonenumber-csharp --version 8.13.16                
NuGet\Install-Package libphonenumber-csharp -Version 8.13.16                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="libphonenumber-csharp" Version="8.13.16" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add libphonenumber-csharp --version 8.13.16                
#r "nuget: libphonenumber-csharp, 8.13.16"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install libphonenumber-csharp as a Cake Addin
#addin nuget:?package=libphonenumber-csharp&version=8.13.16

// Install libphonenumber-csharp as a Cake Tool
#tool nuget:?package=libphonenumber-csharp&version=8.13.16                

Build status codecov NuGet

C# port of Google's libphonenumber library.

The code was rewritten from the Java source mostly unchanged, please refer to the original documentation for sample code and API documentation.

The original Apache License 2.0 was preserved.

See this for details about the port.

Phonenumber metadata is updated in the Google repo approximately every two weeks. This library is manually updated to include the latest metadata, usually within a day or so. There is currently plans to fully automate this https://github.com/twcclegg/libphonenumber-csharp/issues/172

Example

  var phoneNumberUtil = PhoneNumbers.PhoneNumberUtil.GetInstance();
  var e164PhoneNumber = "+44 117 496 0123";
  var nationalPhoneNumber = "2024561111";
  var smsShortNumber = "83835";
  var phoneNumber = phoneNumberUtil.Parse(e164PhoneNumber, null);
  phoneNumber = phoneNumberUtil.Parse(nationalPhoneNumber, "US");
  phoneNumber = phoneNumberUtil.Parse(smsShortNumber, "US");

Features

  • Parsing/formatting/validating phone numbers for all countries/regions of the world.
  • GetNumberType - gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP and Personal Numbers (whenever feasible).
  • IsNumberMatch - gets a confidence level on whether two numbers could be the same.
  • GetExampleNumber/GetExampleNumberByType - provides valid example numbers for 218 countries/regions, with the option of specifying which type of example phone number is needed.
  • IsPossibleNumber - quickly guessing whether a number is a possible phonenumber by using only the length information, much faster than a full validation.
  • AsYouTypeFormatter - formats phone numbers on-the-fly when users enter each digit.
  • FindNumbers - finds numbers in text input

ToDo

  • port read/write source xml data to binary for better performance and smaller .nupkg size (WIP)
  • update / add / port new unit tests and logging from java source

How to unfold automatic generated files

  • Install Jetbrains - Resharper for Visual Studio
  • File by file, right click and "Cleanup code"
  • Check the unfolded file

Available on NuGet as package libphonenumber-csharp.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (113)

Showing the top 5 NuGet packages that depend on libphonenumber-csharp:

Package Downloads
N3O.Umbraco.Validation

TODO

OrchardCore.Users

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. The Users module adds user management functionality.

OrchardCore.Application.Cms.Core.Targets

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with TheAdmin theme but without any front-end Themes.

TheTheme

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. The default Theme - Can be used as base theme for new themes.

OrchardCore.Application.Cms.Targets

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with following themes. - TheAdmin Theme - SafeMode Theme - TheAgency Theme - TheBlog Theme - TheComingSoon Theme - TheTheme theme

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on libphonenumber-csharp:

Repository Stars
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
notifo-io/notifo
Multi channel notification service for collaboration tools, e-commerce, news service and more.
shr670377723/CommunityServer-master
Version Downloads Last updated
8.13.46 7,074 9/25/2024
8.13.45 115,349 9/6/2024
8.13.44 97,776 8/26/2024
8.13.43 164,921 8/9/2024
8.13.42 132,591 7/26/2024
8.13.41 14,296 7/25/2024
8.13.40 270,814 7/3/2024
8.13.39 229,430 6/15/2024
8.13.38 133,960 6/5/2024
8.13.37 410,917 5/17/2024
8.13.36 170,453 5/3/2024
8.13.35 253,570 4/19/2024
8.13.34 265,932 4/5/2024
8.13.33 221,703 3/25/2024
8.13.32 209,121 3/12/2024
8.13.31 210,683 2/25/2024
8.13.30 312,707 2/9/2024
8.13.29 286,302 1/26/2024
8.13.28 20,209 1/25/2024
8.13.27 612,660 12/21/2023
8.13.26 448,789 11/29/2023
8.13.25 304,077 11/20/2023
8.13.24 520,945 10/31/2023
8.13.23 316,459 10/17/2023
8.13.22 378,509 9/29/2023
8.13.21 188,612 9/20/2023
8.13.20 298,519 9/7/2023
8.13.19 294,062 8/22/2023
8.13.18 373,482 8/3/2023
8.13.17 132,676 7/27/2023
8.13.16 219,389 7/11/2023
8.13.15 1,644 7/11/2023
8.13.14 646,184 6/15/2023
8.13.13 1,681 6/15/2023
8.13.12 1,700 6/15/2023
8.13.11 1,025,648 4/27/2023
8.13.10 111,636 4/20/2023
8.13.9 193,165 4/10/2023
8.13.8 181,371 3/27/2023
8.13.7 682,734 3/3/2023
8.13.6 536,403 2/10/2023
8.13.5 242,249 1/29/2023
8.13.4 377,727 1/9/2023
8.13.3 399,068 12/22/2022
8.13.2 643,173 12/8/2022
8.13.1 248,863 11/28/2022
8.13.0 525,659 11/8/2022
8.12.57 747,520 10/14/2022
8.12.56 776,195 9/23/2022
8.12.55 482,688 9/9/2022
8.12.54 413,169 8/22/2022
8.12.53 459,943 8/8/2022
8.12.52 469,885 7/19/2022
8.12.51.1 151,385 7/12/2022
8.12.50 803,223 6/13/2022
8.12.49 375,614 6/1/2022
8.12.48 304,819 5/18/2022
8.12.47 6,340 5/18/2022
8.12.46 798,265 4/15/2022
8.12.45 1,113,752 3/14/2022
8.12.44 102,791 3/9/2022
8.12.43 479,271 2/14/2022
8.12.42 1,958 2/14/2022
8.12.41 1,961 2/14/2022
8.12.40 2,052 2/14/2022
8.12.39 2,028 2/14/2022
8.12.38 1,675,976 12/15/2021
8.12.37 2,469 12/15/2021
8.12.36 2,353 12/15/2021
8.12.35 2,140 12/15/2021
8.12.34 1,735,904 10/7/2021
8.12.33 406,001 9/23/2021
8.12.32 220,937 9/11/2021
8.12.31 2,505 9/11/2021
8.12.30 295,190 8/18/2021
8.12.29 2,290 8/18/2021
8.12.28 457,469 7/23/2021
8.12.27 256,415 7/8/2021
8.12.26 141,452 6/25/2021
8.12.25 134,494 6/16/2021
8.12.24 822,551 5/31/2021
8.12.23 242,749 5/13/2021
8.12.22 354,459 4/30/2021
8.12.21 350,195 4/8/2021
8.12.19 604,397 3/2/2021
8.12.18 477,067 2/10/2021
8.12.17 259,797 1/27/2021
8.12.16 146,463 1/15/2021
8.12.15 502,674 12/18/2020
8.12.14 317,455 12/4/2020
8.12.13 509,046 11/18/2020
8.12.11 1,075,333 10/9/2020
8.12.10 187,793 9/29/2020
8.12.9 407,612 9/2/2020
8.12.8 449,381 8/17/2020
8.12.7 502,375 7/21/2020
8.12.6 192,790 7/6/2020
8.12.5 2,620 7/6/2020
8.12.4 514,622 5/21/2020
8.12.3 197,129 5/8/2020
8.12.2 230,172 4/23/2020
8.12.1 510,763 3/31/2020
8.12.0 288,874 3/20/2020
8.11.5 306,733 3/3/2020
8.11.4 293,045 2/13/2020
8.11.3 282,895 2/3/2020
8.11.2 844,946 1/16/2020
8.11.1 389,951 12/12/2019
8.11.0 119,418 11/29/2019
8.10.23 92,078 11/18/2019
8.10.22 55,156 11/14/2019
8.10.21 420,402 10/17/2019
8.10.20 187,892 10/3/2019
8.10.19 186,283 9/21/2019
8.10.18 44,292 9/17/2019
8.10.17 288,356 8/16/2019
8.10.16 90,143 8/5/2019
8.10.15 196,631 7/18/2019
8.10.14 202,782 7/1/2019
8.10.13 438,706 5/31/2019
8.10.12 264,255 5/15/2019
8.10.11 84,468 5/7/2019
8.10.10 133,363 4/17/2019
8.10.9 252,489 4/5/2019
8.10.8 112,390 3/23/2019
8.10.7 147,878 3/11/2019
8.10.6 143,909 2/22/2019
8.10.5 473,543 2/8/2019
8.10.4 188,707 1/25/2019
8.10.3 132,296 1/11/2019
8.10.2 359,536 12/7/2018
8.10.1 64,894 11/29/2018
8.10.0 35,884 11/29/2018
8.9.16 472,577 10/19/2018
8.9.15 120,012 10/6/2018
8.9.14 91,976 9/21/2018
8.9.13 116,887 9/7/2018
8.9.12 226,085 8/25/2018
8.9.11 85,395 8/18/2018
8.9.10 310,082 7/12/2018
8.9.9 74,800 6/29/2018
8.9.8 71,012 6/15/2018
8.9.7 82,338 5/30/2018
8.9.6 127,685 5/16/2018
8.9.5 37,032 5/4/2018
8.9.4 104,912 4/17/2018
8.9.3 39,750 4/5/2018
8.9.2 70,979 3/19/2018
8.9.1 33,925 3/8/2018
8.9.0 49,490 2/22/2018
8.8.11 62,103 2/8/2018
8.8.10 36,602 1/25/2018
8.8.9 210,838 1/10/2018
8.8.8 148,739 12/8/2017
8.8.7 30,584 12/1/2017
8.8.6 67,876 11/17/2017
8.8.5 151,092 10/31/2017
8.8.4 136,859 10/17/2017
8.8.3 62,985 10/6/2017
8.8.2 48,231 9/22/2017
8.8.1 47,163 9/8/2017
8.8.0 107,143 8/22/2017
8.7.1 42,283 8/3/2017
8.7.0.1 55,233 7/21/2017
8.6.0.1 4,568 7/18/2017
8.6.0 41,599 7/10/2017
8.3.1.2 97,209 6/24/2017
8.3.1.1 127,355 3/13/2017
8.3.1 20,698 3/4/2017
7.7.4 329,070 11/13/2016
7.5.1 410,654 8/6/2016
7.2.5 430,570 2/11/2016
7.0.11 150,234 10/5/2015
7.0.9 80,945 8/16/2015
7.0.5.5 79,386 5/27/2015
7.0.5.4 3,176 5/23/2015
7.0.5.3 18,171 4/28/2015
7.0.5.1 2,983 4/27/2015
7.0.5 3,236 4/25/2015
4.10.0.62 293,644 8/21/2012
4.10.0.61 3,110 8/9/2012
4.10.0.59 3,284 7/27/2012
4.10.0.55 3,273 7/19/2012
4.9.0.52 3,186 7/13/2012
4.9.0.43 3,081 7/10/2012
4.9.0.42 3,183 7/9/2012
4.8.0.35 3,273 6/22/2012
4.8.0.33 4,043 6/16/2012
4.8.0.31 3,186 6/7/2012
4.8.0.30 3,836 5/31/2012
4.8.0.24 3,617 5/9/2012
4.7.0.21 4,459 4/28/2012
4.7.0.19 3,167 4/25/2012
4.6.0.16 3,495 3/30/2012
4.6.0.13 13,033 2/10/2012
4.5.0.9 6,786 1/30/2012
4.5.0.6 3,257 1/21/2012
4.5.0.4 4,136 1/20/2012
4.4.0.1 29,882 1/10/2012
3.8.0.400 3,321 11/28/2011
3.8.0.399 3,271 11/27/2011
3.8.0.394 3,300 11/24/2011
3.8.0.342 3,372 9/17/2011
3.7.1.342 3,287 9/17/2011
3.7.1.312 3,239 8/5/2011
3.7.1.306 10,307 8/5/2011