Skip to content
Branch: master
Find file History
Latest commit 274f7e4 Aug 18, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
config up fifa Aug 12, 2019
lib up fifa Aug 17, 2019
test up fifa Aug 17, 2019
.gitignore up fifa Aug 12, 2019
CHANGELOG.md use CHANGELOG Aug 18, 2019
Manifest.txt up fifa Aug 17, 2019
README.md Update README.md Aug 17, 2019
Rakefile use CHANGELOG Aug 18, 2019

README.md

fifa - the world's football countries and codes (incl. non-member countries and irregular codes)

Usage

Get and pretty print (pp) all countries

require 'fifa'

pp Fifa.countries

resulting in:

[#<Country @fifa="AFG", @key="af", @name="Afghanistan">,
 #<Country @fifa="ALB", @key="al", @name="Albania">,
 #<Country @fifa="ALG", @key="dz", @name="Algeria">,
 #<Country @fifa="ASA", @key="as", @name="American Samoa">,
 #<Country @fifa="AND", @key="ad", @name="Andorra">,
 #<Country @fifa="ANG", @key="ao", @name="Angola">,
 #<Country @fifa="AIA", @key="ai", @name="Anguilla">,
 #<Country @fifa="ATG", @key="ag", @name="Antigua and Barbuda">,
 #<Country @fifa="ARG", @key="ar", @name="Argentina">,
 #<Country @fifa="ARM", @key="am", @name="Armenia">,
 #<Country @fifa="ARU", @key="aw", @name="Aruba">,
 #<Country @fifa="AUS", @key="au", @name="Australia">,
 #<Country @fifa="AUT", @key="at", @name="Austria">,
 #<Country @fifa="AZE", @key="az", @name="Azerbaijan">,
 ...
]

Note: If you prefer you can use the all-upcase FIFA name as an alias for Fifa.

Let's lookup some countries by the fifa (three-letter) code:

eng = Fifa['ENG']
# -or-
eng = Fifa['eng']
eng = Fifa[:eng]

eng.key    #=> "eng"
eng.name   #=> "England"
eng.fifa   #=> "ENG"


aut  = Fifa['AUT']
# -or-
aut  = Fifa['aut']
aut  = Fifa[:aut]

aut.key    #=> "at"
aut.name   #=> "Austria"
aut.fifa   #=> "AUT"

...

That's it.

What's FIFA¹?

The World's Football Association / Governing Body uses its own country list and (three-letter) codes - see the List of FIFA country codes @ Wikipedia or the countries.txt list shipping with this library.

Trivia - The FIFA member list includes 211 countries while the United Nations (UN) member list only includes 191 countries. For example, for historic reasons the FIFA includes:

  • England (ENG)
  • Wales (WAL)
  • Scotland (SCO)
  • Northern Ireland (NIR)

but doesn't include the United Kingdom (UK) itself. Or the FIFA includes (non-sovereign) dependent territories or autonomous regions that have their own national team or leagues, for example:

  • Gibraltar (GIB)
  • Faroe Islands (FRO)
  • Hong Kong (HKG)
  • and others

Note: This library includes non-FIFA member codes and irregular codes from countries in use by regional confederations too, for example:

  • Vatican City (VAT)
  • Zanzibar (ZAN)
  • and others

¹: Fédération Internationale de Football Association (FIFA) @ Wikipedia

License

The fifa scripts are dedicated to the public domain. Use it as you please with no restrictions whatsoever.

Questions? Comments?

Send them along to the Open Sports & Friends Forum/Mailing List. Thanks!

You can’t perform that action at this time.