https://github.com/karpeleslab/countrydb
Country database for Go
https://github.com/karpeleslab/countrydb
Last synced: 12 months ago
JSON representation
Country database for Go
- Host: GitHub
- URL: https://github.com/karpeleslab/countrydb
- Owner: KarpelesLab
- License: lgpl-2.1
- Created: 2022-03-06T05:22:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-27T00:11:14.000Z (over 3 years ago)
- Last Synced: 2025-07-01T00:09:08.867Z (12 months ago)
- Language: Go
- Size: 1.99 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# countries database
Based on ISO 3166-1
Translations for country names/etc fetched from https://salsa.debian.org/iso-codes-team/iso-codes
# Usage
You can get data directly for a given country, such as like this:
```go
info := countrydb.France;
return info.ISO3166_Alpha2;
```
## Country lookup by iso code
```go
country, found := countrydb.ByAlpha2[code];
if found {
...
}
```