ManuHub.Libraries.Countries
1.0.1
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.1
This package targets .NET Standard 2.1. The package is compatible with this framework or higher.
dotnet add package ManuHub.Libraries.Countries --version 1.0.1
NuGet\Install-Package ManuHub.Libraries.Countries -Version 1.0.1
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="ManuHub.Libraries.Countries" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ManuHub.Libraries.Countries" Version="1.0.1" />
<PackageReference Include="ManuHub.Libraries.Countries" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ManuHub.Libraries.Countries --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ManuHub.Libraries.Countries, 1.0.1"
#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.
#:package ManuHub.Libraries.Countries@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ManuHub.Libraries.Countries&version=1.0.1
#tool nuget:?package=ManuHub.Libraries.Countries&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ManuHub.Libraries.Countries
A comprehensive .NET Standard library providing detailed country data, including:
- Country names and emoji flags
- ISO Alpha-2 and Alpha-3 codes
- International dialing (ISD) codes
- Timezone information with human-readable UTC offsets
- Capital cities, geographic coordinates, regions, and descriptions
- Search and filter capabilities
- Embedded JSON data for fast access
- Clean
CountryResult
wrapper for success/error handling - Supports .NET Standard 2.0+ and .NET 8/9
Installation
You can install the package via NuGet:
dotnet add package ManuHub.Libraries.Countries
Or via the NuGet Package Manager:
Install-Package ManuHub.Libraries.Countries
Usage
Get all countries
using ManuHub.Libraries.Countries;
var allCountriesResult = CountryProvider.GetAllCountries();
if (allCountriesResult.Success)
{
foreach (var country in allCountriesResult.Countries)
{
Console.WriteLine(country);
}
}
else
{
Console.WriteLine($"Error: {allCountriesResult.ErrorMessage}");
}
Lookup by Alpha-2 code
var indiaResult = CountryProvider.GetByAlpha2("IN");
if (indiaResult.Success)
{
var india = indiaResult.Countries.First();
Console.WriteLine(india); // 🇮🇳 India (+91, UTC+05:30)
}
else
{
Console.WriteLine(indiaResult.ErrorMessage);
}
Search countries by partial name
var searchResult = CountryProvider.SearchByName("land");
if (searchResult.Success)
{
foreach (var country in searchResult.Countries)
{
Console.WriteLine(country.Name);
}
}
Filter countries by region
var asiaResult = CountryProvider.GetByRegion("Asia");
if (asiaResult.Success)
{
foreach (var country in asiaResult.Countries)
{
Console.WriteLine($"{country.Name} ({country.Capital})");
}
}
ToString() Output
Every Country
object has a clean string representation for display:
var india = CountryProvider.GetByAlpha2("IN").Countries.First();
Console.WriteLine(india);
Result
🇮🇳 India (+91, UTC+05:30)
Features
- Embedded JSON data for fast and offline access
- ISO standard codes (Alpha-2 and Alpha-3)
- Dialing codes with '+' sign
- Timezone IDs converted to UTC offsets automatically
- Latitude/longitude for mapping
- Description fields for additional context
- Search and filter by multiple criteria with caching and indexing
- Clean
CountryResult
wrapper for success/error handling
Requirements
- .NET Standard 2.0+ compatible (works in .NET Core, .NET 5+, .NET Framework 4.7.2+)
Contributing
Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue.
License
MIT License. See LICENSE for details.
Made with ❤️ by ManuHub.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | 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.
-
.NETStandard 2.1
- System.Text.Json (>= 9.0.7)
-
net8.0
- System.Text.Json (>= 9.0.7)
-
net9.0
- System.Text.Json (>= 9.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.