Welcome to ISO 3166-2’s documentation 🌎!
iso3166-2 is a lightweight custom-built Python package, and accompanying API, that can be used to access all of the world’s ISO 3166-2 subdivision data. Here, subdivision can be used interchangably with regions/states/provinces etc. Currently, the package and API supports data from 250 countries/territories, according to the ISO 3166-1 standard. The software uses another custom-built Python package called iso3166-updates to ensure all the subdivision data is accurate, reliable and up-to-date. The ISO 3166-2 was first published in 1998 and as of November 2023 there are 5,039 codes defined in it.
There are 7 main data attributes available for each subdivision within the iso3166-2 software:
Name - subdivsion name, as it is commonly known in English
Local name - subdivision name in local language
Code - ISO 3166-2 subdivision code
Parent Code - subdivision’s parent code
Type - subdivision type, e.g. region, state, canton, parish etc
Latitude/Longitude - subdivision coordinates
Flag - subdivsion flag from iso3166-flag-icons repo
Note
A demo of the software and accompanying API is available here!
Last Updated
The ISO 3166-2 data was last updated on March 2023. A log of the latest ISO 3166-2 updates can be seen in the UPDATES.md file in the repository.
License
iso3166-2 is distributed under the MIT License.
Contents
- Usage
- API
- Accessing subdivision data for all countries
- Accessing subdivision data per country, using its ISO 3166-1 alpha codes
- Accessing all subdivision data for a specific subdivision, using its subdivision code
- Accessing all subdivision data for a specific country, using its name
- Accessing all subdivision data for a specific subdivision, using its subdivision name
- Contributing