You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Wyoming (USA US-WY)** - "Equality State (eng), Cowboy State (eng), Big Wyoming (eng)"
107
107
108
-
The full dataset of local/other names is available in the repo here [`local_other_names.csv`](https://github.com/amckenna41/iso3166-2/iso3166_2_resources/local_other_names.csv)
108
+
The full dataset of local/other names is available in the repo here [`local_other_names.csv`](https://github.com/amckenna41/iso3166-2/blob/main/iso3166_2_resources/local_other_names.csv)
109
109
110
110
111
-
###Flags
111
+
###Flags
112
112
The other equally important and bespoke/unique attribute that the software package supports is the ``flag`` attribute, which is a link to the subdivision's flag on the [`iso3166-flags`](https://github.com/amckenna41/iso3166-flags) repo. This is another **custom-built** repository, (alongside [`iso3166-2`](https://github.com/amckenna41/iso3166-2) and [`iso3166-updates`](https://github.com/amckenna41/iso3166-updates)) that stores a rich and comprehensive dataset of over **3500** individual subdivision flags.
113
113
114
114
The flags repo uses the `iso3166-2` software to get the full list of ISO 3166-2 subdivision codes which is kept up-to-date and accurate via the `iso3166-updates` software.
@@ -132,6 +132,8 @@ Two additional bespoke attributes that have been recently added to the software
132
132
*[natsort][natsort] >= 8.4.0
133
133
*[thefuzz][thefuzz] >= 0.22.1
134
134
*[requests][requests] >= 2.28.1
135
+
*[pycountry][pycountry] >= 24.6.1
136
+
135
137
<!-- * [unidecode][unidecode] >= 1.3.8 -->
136
138
137
139
## Installation
@@ -199,10 +201,11 @@ all default attributes.
199
201
'''
200
202
from iso3166_2 import*
201
203
202
-
#create instance of Subdivisions class
204
+
#create instance of Subdivisions class - only getting flag, parent code and type attributes
203
205
iso = Subdivisions(filter_attributes="flag,parentCode,type")
204
206
```
205
207
208
+
********
206
209
**Get list of subdivision codes for all or a subset of countries:**
207
210
```python
208
211
'''
@@ -340,7 +343,7 @@ An important thing to note about the ISO 3166-2 and its subdivision codes/names
340
343
341
344
The [`iso3166-updates`](https://github.com/amckenna41/iso3166-updates) repo is another open-source software package and accompanying RESTful API that pulls the latest updates and changes for any and all countries in the ISO 3166 from a variety of data sources including the ISO website itself. A script is called periodically to check for any updates/changes to the subdivisions, which are communicated via the ISO's Online Browsing Platform [[4]](#references), and will then be manually incorporated into this repo. Please visit the repository home page for more info about the purpose and process of the software and API - [`iso3166-updates`](https://github.com/amckenna41/iso3166-updates).
342
345
343
-
The list of ISO 3166 updates was last updated on <strong>November 2024</strong> (the last published ISO subdivision change). A log of the latest ISO 3166 updates can be seen in the [UPDATES.md][updates_md] file.
346
+
The list of ISO 3166 updates was last updated on <strong>July 2025</strong> (the last published ISO subdivision change). A log of the latest ISO 3166 updates can be seen in the [UPDATES.md][updates_md] file.
344
347
345
348
## API
346
349
The main API endpoint is:
@@ -405,7 +408,7 @@ having a lower value will return less exact but more total matches, e.g ``/api/s
405
408
<!-- ## ISO 3166-2 Scripts
406
409
* [`scripts/main.py`](https://github.com/amckenna41/iso3166-2/blob/main/scripts) - used for pulling and exporting the latest ISO 3166-2 data from the various data sources. In this script you can also export additional attributes for each country/subdivision via the RestCountries and CountryStateCity APIs.
407
410
* [`scripts/update_subdivisions.py`](https://github.com/amckenna41/iso3166-2/blob/main/scripts) - used for adding, amending and or deleting subdivisions to the `iso3166-2` software and object.
408
-
* [`scripts/local_other_names.py`](https://github.com/amckenna41/iso3166-2/blob/main/scripts/local_other_names.py) - used for adding the data from the local_other_names.csv dataset, including any validation checks on the data.
411
+
* [`scripts/local_other_names.py`](https://github.com/amckenna41/iso3166-2/blob/main/iso3166_2_resources/local_other_names.csv) - used for adding the data from the local_other_names.csv dataset, including any validation checks on the data.
409
412
* [`scripts/utils.py`](https://github.com/amckenna41/iso3166-2/blob/main/scripts/utils.py) - a series of utility functions used throughout the `iso3166-2` project.
410
413
* [`scripts/language_lookup.py`](https://github.com/amckenna41/iso3166-2/blob/main/scripts/language_lookup.py) - uses the `local_other_names.csv` dataset to encapsulate and validate the hundreds of language code used throughout the dataset and project.
.. Six paths/endpoints are available in the API - `/api/all`, `/api/alpha`, `/api/country_name`, `/api/subdivision`, `/api/search` and `/api/list_subdivisions`.
@@ -38,8 +37,6 @@ The other endpoints available in the API are:
38
37
39
38
.. * `/api/search_geo/`: search for subdivisions and return only geographic attributes (e.g. latLng, bounding box, geojson, neighbours, perimeter) for 1 or more input search terms. Accepts comma separated subdivision names or ISO 3166-2 subdivision codes, e.g `/api/search_geo/Saarland,US-CA`. Supports the `likeness` query string parameter to control match tolerance.
40
39
41
-
.. * `/api/search_latlng/`: search for subdivisions via their latLng values. Accepts a comma separated string of latitude and longitude (e.g. `/api/search_latlng/39.4178,-2.6232`). Matches are approximate (not necessarily exact) based on closeness to the input coordinates.
42
-
43
40
.. * `/api/list_subdivisions`: get list of all the subdivision codes for all countries.
0 commit comments