Skip to content

KtorZPersonal/go-iso-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO-ISO-CODES

Overview

go-iso-codes aggregates data to get various ISO code and details about countries, currencies and languages among the world.

The package offers methods to quickly lookup a country, language or currency based on a code, a fraction of the name or a combination of other criterias.

The full lists of data are also available and can be easily generated to JSON via the encoding/json package.

Getting Started

Three packages are available should you need to only import currencies or languages. Note nevertheless that the countries package uses the two others.

import (
    "fmt"

    "github.com/KtorZ/go-iso-codes/countries"
    "github.com/KtorZ/go-iso-codes/currencies"
    "github.com/KtorZ/go-iso-codes/languages"
)

func main() {
    eurCurrency := currencies.Lookup(currencies.Currency{Alpha3: "EUR"})
    fmt.Println(eurCurrency)
    // [{EUR 978 2 Euro}]

    allCurrencies := currencies.Currencies
    fmt.Println(allCurrencies)
    // A lot of stuff

    europeanEnglishCountries := countries.Lookup(countries.Country{
        Currencies: []currencies.Currency{eurCurrency},
        Languages: []languages.Language{
            Alpha2: "EN",
        },
    })
    fmt.Println(europeanEnglishCountries)
    // Also a lot of stuff
}

Release Notes

  • 0.1.0 Sept 25, 2016
    • First release

About

Countries, currencies and languages ISO codes in Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages