![]() |
VOOZH | about |
dotnet add package EarthCountriesInfo --version 10.1.0
NuGet\Install-Package EarthCountriesInfo -Version 10.1.0
<PackageReference Include="EarthCountriesInfo" Version="10.1.0" />
<PackageVersion Include="EarthCountriesInfo" Version="10.1.0" />Directory.Packages.props
<PackageReference Include="EarthCountriesInfo" />Project file
paket add EarthCountriesInfo --version 10.1.0
#r "nuget: EarthCountriesInfo, 10.1.0"
#:package EarthCountriesInfo@10.1.0
#addin nuget:?package=EarthCountriesInfo&version=10.1.0Install as a Cake Addin
#tool nuget:?package=EarthCountriesInfo&version=10.1.0Install as a Cake Tool
EarthCountriesInfo is an open-source C# class library that provides comprehensive information about countries on planet Earth. Whether you're building educational tools, geographic applications, or simply curious about global diversity, EarthCountriesInfo has you covered!
To include EarthCountriesInfo in your project, install the NuGet package:
dotnet add package EarthCountriesInfo
The CountryProperties class provides essential information for each country:
public sealed record CountryProperties(
Dictionary<LanguageId, string> CountryNames,
string CountryPhoneCode,
Dictionary<int, string>? ValidLengthsAndFormat
);
CountryNames: A dictionary containing country names in various languages.CountryPhoneCode: The international phone code for the country.ValidLengthsAndFormat (optional): Valid phone number lengths and formats (if available).using EarthCountriesInfo;
using HumanLanguages;
// Get information for a specific country (e.g., INDIA)
if (Countries.CountryPropertiesDictionary.TryGetValue(CountryIsoCode.IN, out CountryProperties infoAboutIndia))
{
Console.WriteLine($"Country Name (English): {infoAboutIndia.CountryNames[LanguageId.en]}");
Console.WriteLine($"Country Phone Code: +{infoAboutIndia.CountryPhoneCode}");
if (infoAboutIndia.ValidLengthsAndFormat != null)
{
foreach (var (length, format) in infoAboutIndia.ValidLengthsAndFormat)
{
Console.WriteLine($"Valid Length: {length}, Format: {format}");
}
}
}
We welcome contributions! If you find a bug, have an idea for improvement, or want to add support for additional countries, please submit an issue or a pull request on GitHub.
Visit our GitHub repository for the latest updates, documentation, and community contributions: EarthCountriesInfo GitHub Repository
This project is licensed under the GNU GENERAL PUBLIC LICENSE.
Happy coding! 🌎🚀📚
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 4 NuGet packages that depend on EarthCountriesInfo:
| Package | Downloads |
|---|---|
|
GeoIpServices
A C# library that provides geolocation information for IP addresses with MongoDB caching. Wraps third-party IP geolocation services (IpStack) to reduce API usage and costs through intelligent caching and session management. |
|
|
SMSwitch
Package Description |
|
|
StorageConnector
A unified interface for multi-cloud storage operations. StorageConnector provides a consistent abstraction layer for Azure Blob Storage, AWS S3, and Google Cloud Storage with built-in support for pre-signed URLs, geographic routing, and facial recognition integration. |
|
|
UmbCountryPicker
A property editor for Umbraco CMS. It let's you pick a country from a list of countries. |
This package is not used by any popular GitHub repositories.