Hello,
I've put together a new world data gem, that is, worldlite, that
includes all the world countries (and territories) as good ol' ruby
code. Example:
module WorldLite
c = Country.new
c.name = 'Austria'
c.key = 'at'
c.alpah2 = 'AT' # iso two-letter country code (ISO 3166-1 alpha-2)
c.alpha3 = 'AUT' # iso three-letter country code (ISO 3166-1 alpha-3)
c.fifa = 'AUT' # football country code (fifa = Fédération
Internationale de Football Association)
c.ioc = 'AUT' # olympics country code (ioc = International
Olympic Committee)
c.net = 'at' # internet top level domain
c.motor = 'A' # motor vehicle license plate code
c.num3 = '040' # iso numeric three-digits code as string (ISO
3166-1 numeric)
c.num = 40 # iso numeric code as number
c.continent_name = 'Europe'
c.un = true # United Nations member? -- 193 member countries
c.eu = true # European Union member? -- 27 member countries
c.euro = true # Euro Zone member? -- 17 member countries
c.wikipedia = 'Austria' # e.g. see en.wikipedia.org/wiki/Austria
c.wikidata = 40 # e.g. see wikidata.org/wiki/Q40
c.factbook = 'au' # e.g. see
www.cia.gov/library/publications/the-world-factbook/geos/au.html
end # module WorldLite
The new worldlite gem is lightweight, that is, no database and no
dependencies (extra gems) required. All code and data is public
domain, that is, license-free - no copyright and no rights reserverd -
use as you please.
To try use:
require 'worldlite'
include WorldLite
WORLD.size # => 245
WORLD_UN.size # => 193
WORLD_G20.size # => 20
and so on. For countries try:
AT.class.name # => WorldLite::Country
AT.name # => Austria
AT.alpha3 # => AUT
Still early and rough but all the world's countries and territories
(245 total) included.
Cheers.
[1] https://github.com/worlddb/world.lite.ruby
Very cool. Thanks for taking the time to compile this into a gem.
I might have missed it, but does it include country calling codes?
Cheers,
Ammar
···
On Aug 21, 2014, at 5:58 PM, Gerald Bauer <gerald.bauer@gmail.com> wrote:
Hello,
I've put together a new world data gem, that is, worldlite, that
includes all the world countries (and territories) as good ol' ruby
code. Example:
module WorldLite
c = Country.new
c.name = 'Austria'
c.key = 'at'
c.alpah2 = 'AT' # iso two-letter country code (ISO 3166-1 alpha-2)
c.alpha3 = 'AUT' # iso three-letter country code (ISO 3166-1 alpha-3)
c.fifa = 'AUT' # football country code (fifa = Fédération
Internationale de Football Association)
c.ioc = 'AUT' # olympics country code (ioc = International
Olympic Committee)
c.net = 'at' # internet top level domain
c.motor = 'A' # motor vehicle license plate code
c.num3 = '040' # iso numeric three-digits code as string (ISO
3166-1 numeric)
c.num = 40 # iso numeric code as number
c.continent_name = 'Europe'
c.un = true # United Nations member? -- 193 member countries
c.eu = true # European Union member? -- 27 member countries
c.euro = true # Euro Zone member? -- 17 member countries
c.wikipedia = 'Austria' # e.g. see en.wikipedia.org/wiki/Austria
c.wikidata = 40 # e.g. see wikidata.org/wiki/Q40
c.factbook = 'au' # e.g. see
www.cia.gov/library/publications/the-world-factbook/geos/au.html
end # module WorldLite
The new worldlite gem is lightweight, that is, no database and no
dependencies (extra gems) required. All code and data is public
domain, that is, license-free - no copyright and no rights reserverd -
use as you please.
To try use:
require 'worldlite'
include WorldLite
WORLD.size # => 245
WORLD_UN.size # => 193
WORLD_G20.size # => 20
and so on. For countries try:
AT.class.name # => WorldLite::Country
AT.name # => Austria
AT.alpha3 # => AUT
Still early and rough but all the world's countries and territories
(245 total) included.
Cheers.
[1] GitHub - ordbase/ordbase.github.io: website - hosting public generative ORC-721 reference images (in 1x & 4x) for D.I.Y. Punks & friends
Hello,
Thanks for your kind words. The country calling codes are NOT yet
included. Try to get the country calling codes, currencies, and other
codes added soon depending on demand and usage. Still early and rough.
Cheers.
PS: If you want to help out adding the codes. The source for the
worldlite gem are just plain text fixtures - for "extra" codes it's
key value pairs (in .yml) e.g.
at: +43
and so on. See the world.db [1] for details.
[1] github.com/openmundi/world.db
···
de: +42