All Projects → biter777 → Countries

biter777 / Countries

Licence: bsd-2-clause
Countries - ISO 3166 (ISO3166-1, ISO3166, Digit, Alpha-2 and Alpha-3) countries codes and names (on eng and rus), ISO 4217 currency designators, ITU-T E.164 IDD calling phone codes, countries capitals, UN M.49 regions codes, ccTLD countries domains, IOC/NOC and FIFA letters codes, VERY FAST, NO maps[], NO slices[], NO init() funcs, NO external links/files/data, NO interface{}, NO specific dependencies, Databases/JSON/GOB/XML/CSV compatible, Emoji countries flags and currencies support, full support ISO-3166-1, ISO-4217, ITU-T E.164, Unicode CLDR and ccTLD standarts.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Countries

Countries
Countries, Languages & Continents data (capital and currency, native name, calling codes).
Stars: ✭ 656 (+671.76%)
Mutual labels:  json, currencies, countries, emoji
Javamoney Lib
JavaMoney financial libraries, extending and complementing JSR 354
Stars: ✭ 104 (+22.35%)
Mutual labels:  currency, currencies, money
Django Prices
Django fields for the prices module
Stars: ✭ 135 (+58.82%)
Mutual labels:  currency, currencies, money
Prices
Python price handling for humans.
Stars: ✭ 248 (+191.76%)
Mutual labels:  currency, currencies, money
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-69.41%)
Mutual labels:  money, currency, currencies
Iso 3166 Countries With Regional Codes
ISO 3166-1 country lists merged with their UN Geoscheme regional codes in ready-to-use JSON, XML, CSV data sets
Stars: ✭ 1,372 (+1514.12%)
Mutual labels:  json, iso, countries
Cash Cli
💰💰 Convert currency rates directly from your terminal!
Stars: ✭ 168 (+97.65%)
Mutual labels:  currency, currencies, money
currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-81.18%)
Mutual labels:  money, currency, currencies
Nager.Country
Worldwide Country Informations (ISO-3166-1 Alpha2, ISO-3166-1 Alpha3, ISO 639-1)
Stars: ✭ 68 (-20%)
Mutual labels:  currency, countries, currencies
Jackson Datatype Money
Extension module to properly support datatypes of javax.money
Stars: ✭ 165 (+94.12%)
Mutual labels:  json, currency, money
django-prices-openexchangerates
openexchangerates.org support for django-prices
Stars: ✭ 33 (-61.18%)
Mutual labels:  money, currency, currencies
react-local-currency
💵 💴Shows the price of your services in the customer's currency 💶 💷
Stars: ✭ 21 (-75.29%)
Mutual labels:  money, currency, currencies
Dinero.js
Create, calculate, and format money in JavaScript and TypeScript.
Stars: ✭ 5,286 (+6118.82%)
Mutual labels:  currency, money
Money
PHP implementation of Fowler's Money pattern.
Stars: ✭ 3,868 (+4450.59%)
Mutual labels:  currency, money
World countries
Constantly updated lists of world countries and their associated alpha-2, alpha-3 and numeric country codes as defined by the ISO 3166 standard, available in CSV, JSON , PHP and SQL formats, in multiple languages and with national flags included
Stars: ✭ 598 (+603.53%)
Mutual labels:  json, countries
Vue Numeric
Input field component to display a formatted currency value based on Vue.js
Stars: ✭ 341 (+301.18%)
Mutual labels:  currency, money
Countries
World countries in JSON, CSV, XML and Yaml. Any help is welcome!
Stars: ✭ 5,379 (+6228.24%)
Mutual labels:  json, countries
Country Json
A simple data of the world by country each in JSON format.
Stars: ✭ 688 (+709.41%)
Mutual labels:  currency, countries
Money
A precise, type-safe representation of a monetary amount in a given currency
Stars: ✭ 817 (+861.18%)
Mutual labels:  currency, money
Go Money
Go implementation of Fowler's Money pattern
Stars: ✭ 887 (+943.53%)
Mutual labels:  currency, money

countries

Countries - ISO 3166 (ISO3166-1, ISO3166, Digit, Alpha-2, Alpha-3) countries codes and names (on eng and rus), ISO 4217 currency designators, ITU-T E.164 IDD calling phone codes, countries capitals, UN M.49 regions codes, IANA ccTLD countries domains, IOC/NOC and FIFA codes, VERY FAST, NO maps[], NO slices[], NO init() funcs, NO external links/files/data, NO interface{}, NO specific dependencies, Databases/JSON/GOB/XML/CSV compatible, Emoji countries flags and currencies support, full support ISO-3166-1, ISO-4217, ITU-T E.164, Unicode CLDR and IANA ccTLD standarts.

Full support ISO-3166-1, ISO-4217, ITU-T E.164, Unicode CLDR and IANA ccTLD standarts.

GoDoc GoDev Go Walker Documentation Status DOI codeclimate GolangCI GoReport Codacy Badge codecov Coverage Status Coverage ISO ITU IANA License FOSSA Status Build Status Build status Circle CI Semaphore Status Build Status Codeship Status DMCA.com Protection Status Dependencies Free Gluten Free DepShield Badge Stars

installation

go get github.com/biter777/countries

usage

	countryJapan := countries.Japan
	fmt.Printf("Country name in english: %v\n", countryJapan)                   // Japan
	fmt.Printf("Country name in russian: %v\n", countryJapan.StringRus())       // Япония
	fmt.Printf("Country ISO-3166 digit code: %d\n", countryJapan)               // 392
	fmt.Printf("Country ISO-3166 Alpha-2 code: %v\n", countryJapan.Alpha2())    // JP
	fmt.Printf("Country ISO-3166 Alpha-3 code: %v\n", countryJapan.Alpha3())    // JPN
	fmt.Printf("Country IOC/NOC code: %v\n", countryJapan.IOC())                // JPN
	fmt.Printf("Country FIFA code: %v\n", countryJapan.FIFA())                  // JPN
	fmt.Printf("Country Capital: %v\n", countryJapan.Capital())                 // Tokyo
	fmt.Printf("Country ITU-T E.164 call code: %v\n", countryJapan.CallCodes()) // +81
	fmt.Printf("Country ccTLD domain: %v\n", countryJapan.Domain())             // .jp
	fmt.Printf("Country UN M.49 region name: %v\n", countryJapan.Region())      // Asia
	fmt.Printf("Country UN M.49 region code: %d\n", countryJapan.Region())      // 142
	fmt.Printf("Country emoji/flag: %v\n\n", countryJapan.Emoji())              // 🇯🇵

	currencyJapan := countryJapan.Currency()
	fmt.Printf("Country ISO-4217 Currency name in english: %v\n", currencyJapan)           // Yen
	fmt.Printf("Country ISO-4217 Currency digit code: %d\n", currencyJapan)                // 392
	fmt.Printf("Country ISO-4217 Currency Alpha code: %v\n", currencyJapan.Alpha())        // JPY
	fmt.Printf("Country Currency emoji: %v\n", currencyJapan.Emoji())                      // 💴
	fmt.Printf("Country of Currency %v: %v\n\n", currencyJapan, currencyJapan.Countries()) // Japan

	// OR you can alternative use:
	japanInfo := countries.Japan.Info()
	fmt.Printf("Country name in english: %v\n", japanInfo.Name)                          // Japan
	fmt.Printf("Country ISO-3166 digit code: %d\n", japanInfo.Code)                      // 392
	fmt.Printf("Country ISO-3166 Alpha-2 code: %v\n", japanInfo.Alpha2)                  // JP
	fmt.Printf("Country ISO-3166 Alpha-3 code: %v\n", japanInfo.Alpha3)                  // JPN
	fmt.Printf("Country IOC/NOC code: %v\n", japanInfo.IOC)                              // JPN
	fmt.Printf("Country FIFA code: %v\n", japanInfo.FIFA)                                // JPN
	fmt.Printf("Country Capital: %v\n", japanInfo.Capital)                               // Tokyo
	fmt.Printf("Country ITU-T E.164 call code: %v\n", japanInfo.CallCodes)               // +81
	fmt.Printf("Country ccTLD domain: %v\n", japanInfo.Domain)                           // .jp
	fmt.Printf("Country UN M.49 region name: %v\n", japanInfo.Region)                    // Asia
	fmt.Printf("Country UN M.49 region code: %d\n", japanInfo.Region)                    // 142
	fmt.Printf("Country emoji/flag: %v\n", japanInfo.Emoji)                              // 🇯🇵
	fmt.Printf("Country ISO-4217 Currency name in english: %v\n", japanInfo.Currency)    // Yen
	fmt.Printf("Country ISO-4217 Currency digit code: %d\n", japanInfo.Currency)         // 392
	fmt.Printf("Country ISO-4217 Currency Alpha code: %v\n", japanInfo.Currency.Alpha()) // JPY

	// Detection usage
	// Detect by name
	country := countries.ByName("angola")
	fmt.Printf("Country name in english: %v\n", country)                // Angola
	fmt.Printf("Country ISO-3166 digit code: %d\n", country)            // 24
	fmt.Printf("Country ISO-3166 Alpha-2 code: %v\n", country.Alpha2()) // AO
	fmt.Printf("Country ISO-3166 Alpha-3 code: %v\n", country.Alpha3()) // AGO
	// Detect by code/numeric
	country = countries.ByNumeric(24)
	fmt.Printf("Country name in english: %v\n", country)                // Angola
	fmt.Printf("Country ISO-3166 digit code: %d\n", country)            // 24
	fmt.Printf("Country ISO-3166 Alpha-2 code: %v\n", country.Alpha2()) // AO
	fmt.Printf("Country ISO-3166 Alpha-3 code: %v\n", country.Alpha3()) // AGO

	// Comparing usage
	// Compare by code/numeric
	if countries.ByName("angola") == countries.AGO {
		fmt.Println("Yes! It's Angola!") // Yes! It's Angola!
	}
	// Compare by name
	if strings.EqualFold("angola", countries.AGO.String()) {
		fmt.Println("Yes! It's Angola!") // Yes! It's Angola!
	}

	// Database usage
	type User struct {
		gorm.Model
		Name     string
		Country  countries.CountryCode
		Currency countries.CurrencyCode
	}
	user := &User{Name: "Helen", Country: countries.Slovenia, Currency: countries.CurrencyEUR}
	db, err := gorm.Open("postgres", 500, "host=127.0.0.2 port=5432 user=usr password=1234567 dbname=db")
	if err != nil {
		panic(err)
	}
	defer db.Close()
	db.Create(user)

options

You can take a counties names in russian language, use StringRus(). For Emoji use Emoji(). Enjoy!

import "github.com/biter777/countries"

For more complex options, consult the documentation.

contributing

  1. Welcome pull requests, bug fixes and issue reports.
    Before proposing a change, please discuss it first by raising an issue.
    Contributors list: @biter777, @gavincarr, @benja-M-1.

  2. Donate. A donation isn't necessary, but it's welcome.

    Donate using Liberapay ko-fi
  3. Star us. Give us a star, please, if it's not against your religion :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].