Provides a .net wrapper around the GeoNames Data. Also exposes the data as per country json files.
https://nuget.org/packages/CountryData/
PM> Install-Package CountryData
https://nuget.org/packages/CountryData.Bogus/
PM> Install-Package CountryData.Bogus
// All country info. This is only the country metadata
// and not all locationData.
var allCountryInfo = CountryLoader.CountryInfo;
var costaRicaInfo = allCountryInfo.Single(x => x.Iso == "CR");
// Loads all location data for a specific country
var australiaData = CountryLoader.LoadAustraliaLocationData();
var name = australiaData.Name;
var state = australiaData.States.First();
var province = state.Provinces.First();
var community = province.Communities.First();
var place = community.Places.First();
var postCode = place.PostCode;
var name = place.Name;
var latLong = place.LatLong;
var faker = new Faker<Target>()
.RuleFor(u => u.RandomCountryName, (f, u) => f.Country().Name())
.RuleFor(u => u.RandomCountryCurrency, (f, u) => f.Country().CurrencyCode())
.RuleFor(u => u.AustralianCapital, (f, u) => f.Country().Australia().Capital)
.RuleFor(u => u.RandomIrelandState, (f, u) => f.Country().Ireland().State().Name)
.RuleFor(u => u.RandomIcelandPostCode, (f, u) => f.Country().Iceland().PostCode());
var targetInstance = faker.Generate();
List of country codes: https://raw.githubusercontent.com/SimonCropp/CountryData/master/data/countrycodes.txt
https://raw.githubusercontent.com/SimonCropp/CountryData/master/Data/PostCodes/[CountryCode].json.txt
https://github.com/SimonCropp/CountryData/blob/master/Data/countryInfo.json.txt
For example the url for Australia (AU) is
https://raw.githubusercontent.com/SimonCropp/CountryData/master/Data/PostCodes/au.json.txt
The GeoNames data is structured as
State > Province > Community > Place
However many countries do not have data for every level.
World designed by Pedro Santos from The Noun Project