views:

1388

answers:

4

Is there any quick guide/reference to list all the countries and its states/provinces?

Like when I click US, it will list: Alabama, alaska etc

A: 

This is as close as it gets. http://27.org/isocountrylist/

This list is rather old, however it does offer a great deal of value for those wanting a country list, with codes and abbreviations. Also, there is a link to US States and provinces there too. This has been a good resource over the years.

With this table data, it's possible for someone to create some normalized data between countries, states, provinces, counties or whatever political jurisdictions.

I thought this would be a huge time saver for this task.

randy melder
um.. the last update is 2006. Should I worry about that?
@kanayaki - Not too much has changed since 2006. You could cross reference this list with the Wikipedia page to make sure it is up to date.
Christian
@christ: Thanks. Listing the countries, states/provinces, valid ZIP code, valid phone numbers are really big pain is ***...
@Christian: What about Kosovo then?
Alix Axel
@kanayaki: Yeah http://stackoverflow.com/questions/1384762/i18n-validations wanna help?
Alix Axel
+1  A: 

I don't have code to do it, but if you want a good (free) list of administrative districts for most of the world you can use this Wikipedia page.

beggs
Should I copy the list from others website? Is it consider stealing? I know, I should not do that, but, I am stuck in listing countries..
copying the information from Wikipedia is not stealing. As stated in the Wikipedia TOS: "You can re-use content from Wikimedia projects freely, with the exception of content that is used under "fair use" exemptions, or similar exemptions of copyright law" (see: http://wikimediafoundation.org/wiki/Terms_of_Use for more info)As for randy melder's answer, the user is posting it for others to use and it was generated from ISO data which is freely distributed for all to use.
beggs
I see. Thanks :)
+3  A: 

pycountry is the most complete free reference I was ever able to find:

pycountry provides the ISO databases for the standards:

639 Languages
3166 Countries
3166-2 Subdivisions of countries
4217 Currencies
15924 Scripts

The databases are imported from Debian's pkg-isocodes, packaged into pycountry and made accessible through a Python API.

Translation files for the various strings are included as well.
Alix Axel
+2  A: 

Grabbing data from Geonames would be an option. It is kept relatively up to date, and is under a CC licence.

squeeks