{"id":17182444,"url":"https://github.com/simoncropp/countrydata","last_synced_at":"2025-05-16T07:06:57.882Z","repository":{"id":32690552,"uuid":"139317037","full_name":"SimonCropp/CountryData","owner":"SimonCropp","description":"Provides a .net wrapper around the GeoNames Data","archived":false,"fork":false,"pushed_at":"2025-05-12T10:02:42.000Z","size":995977,"stargazers_count":86,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-12T11:24:42.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonCropp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":"code_of_conduct.md","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,"zenodo":null},"funding":{"github":"SimonCropp"}},"created_at":"2018-07-01T09:43:45.000Z","updated_at":"2025-05-12T10:02:45.000Z","dependencies_parsed_at":"2023-02-10T19:46:17.594Z","dependency_job_id":"daded4a0-92a3-497e-ba5c-8100fb37e5ac","html_url":"https://github.com/SimonCropp/CountryData","commit_stats":{"total_commits":1166,"total_committers":7,"mean_commits":"166.57142857142858","dds":"0.42967409948542024","last_synced_commit":"00988ba69e1e2ff355901b4f54f29a840b139ea9"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FCountryData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FCountryData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FCountryData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FCountryData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonCropp","download_url":"https://codeload.github.com/SimonCropp/CountryData/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485064,"owners_count":22078767,"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":[],"created_at":"2024-10-15T00:37:06.265Z","updated_at":"2025-05-16T07:06:52.874Z","avatar_url":"https://github.com/SimonCropp.png","language":"C#","funding_links":["https://github.com/sponsors/SimonCropp"],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"/src/icon.png\" height=\"30px\"\u003e CountryData\n\n[![Build status](https://ci.appveyor.com/api/projects/status/bb8461c5js69pn4x/branch/main?svg=true)](https://ci.appveyor.com/project/SimonCropp/countrydata)\n[![NuGet Status](https://img.shields.io/nuget/v/CountryData.svg?label=CountryData)](https://www.nuget.org/packages/CountryData/)\n[![NuGet Status](https://img.shields.io/nuget/v/CountryData.Bogus.svg?label=CountryData.Bogus)](https://www.nuget.org/packages/CountryData.Bogus/)\n\nProvides a .net wrapper around the [GeoNames Data](https://www.geonames.org/). Also exposes the data as per country json files.\n\n**See [Milestones](../../milestones?state=closed) for release notes.**\n\n\n## NuGet packages\n\n * https://nuget.org/packages/CountryData/\n * https://nuget.org/packages/CountryData.Bogus/\n\nThe NuGets contain a static copy of all data. This data is embedded as resources inside the assembly. No network calls are done by the assembly. To get the latests version of the data do a NuGet update. There are several options to help keep a NuGet update:\n\n * [Dependabot](https://dependabot.com/): creates pull requests to keep dependencies secure and up-to-date.\n * [Using NuGet wildcards](https://docs.microsoft.com/en-us/nuget/reference/package-versioning#version-ranges-and-wildcards).\n * [Libraries.io](https://libraries.io/) supports subscribing to NuGet package updates.\n\n\n## Usage\n\n\u003c!-- snippet: usage --\u003e\n\u003ca id='snippet-usage'\u003e\u003c/a\u003e\n```cs\n// All country info. This is only the country metadata\n// and not all locationData.\nvar allCountryInfo = CountryLoader.CountryInfo;\nvar costaRicaInfo = allCountryInfo.Single(_ =\u003e _.Iso == \"CR\");\n\n// Loads all location data for a specific country\nvar australiaData = CountryLoader.LoadAustraliaLocationData();\nvar name = australiaData.Name;\nvar state = australiaData.States[0];\nvar province = state.Provinces[0];\nvar community = province.Communities[0];\nvar place = community.Places[0];\nvar postCode = place.PostCode;\nvar placeName = place.Name;\nvar latitude = place.Location.Latitude;\nvar longitude = place.Location.Longitude;\n```\n\u003csup\u003e\u003ca href='/src/Tests/Snippets.cs#L33-L52' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-usage' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n## Bogus Usage\n\n\u003c!-- snippet: bogususage --\u003e\n\u003ca id='snippet-bogususage'\u003e\u003c/a\u003e\n```cs\nvar faker = new Faker\u003cTarget\u003e()\n    .RuleFor(\n        property: u =\u003e u.RandomCountryName,\n        setter: (f, u) =\u003e f.Country().Name())\n    .RuleFor(\n        property: u =\u003e u.AustralianCapital,\n        setter: (f, u) =\u003e CountryDataSet.Australia().Capital)\n    .RuleFor(\n        property: u =\u003e u.RandomIrelandState,\n        setter: (f, u) =\u003e CountryDataSet.Ireland().State().Name)\n    .RuleFor(\n        property: u =\u003e u.RandomIcelandPostCode,\n        setter: (f, u) =\u003e CountryDataSet.Iceland().PostCode());\nvar targetInstance = faker.Generate();\n```\n\u003csup\u003e\u003ca href='/src/Tests/Snippets.cs#L10-L27' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-bogususage' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n## Json Files\n\n\n### Country Codes\n\nList of country codes: https://raw.githubusercontent.com/SimonCropp/CountryData/master/Data/countrycodes.txt\n\n```\nhttps://raw.githubusercontent.com/SimonCropp/CountryData/master/Data/PostCodes/[CountryCode].json.txt\n```\n\n\n### Country Information\n\nhttps://github.com/SimonCropp/CountryData/blob/master/Data/countryInfo.json.txt\n\n\n### Country Location Data\n\nFor example the url for Australia (AU) is:\n\nhttps://raw.githubusercontent.com/SimonCropp/CountryData/master/Data/PostCodes/AU.json.txt\n\n\n### Structure\n\nThe GeoNames data is structured as:\n\nCountry \u003e State \u003e Province \u003e Community \u003e Place\n\nHowever many countries do not have data for every level.\n\n\n## Icon\n\n[World](https://thenounproject.com/term/world/956116/) designed by [Pedro Santos](https://thenounproject.com/pedrosantospt3) from [The Noun Project](https://thenounproject.com/pedrosantospt3).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimoncropp%2Fcountrydata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimoncropp%2Fcountrydata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimoncropp%2Fcountrydata/lists"}