Self-contained ISO 3166-1 country definitions.
Reason this release was yanked:
Missing "python_requires" in setup.py
Project description
- Version:
- 2.0.0
ISO 3166-1 defines two-letter, three-letter, and three-digit country codes. python-iso3166 is a self-contained module that converts between these codes and the corresponding country name.
Installation
$ pip install iso3166
Usage
Country details
>>> from iso3166 import countries
>>>
>>> countries.get('us')
Country(name=u'United States', alpha2='US', alpha3='USA', numeric='840')
>>> countries.get('ala')
Country(name=u'\xc5land Islands', alpha2='AX', alpha3='ALA', numeric='248')
>>> countries.get(8)
Country(name=u'Albania', alpha2='AL', alpha3='ALB', numeric='008')
Country lists and indexes
>>> from iso3166 import countries
>>> for c in countries:
print(c)
>>> Country(name=u'Afghanistan', alpha2='AF', alpha3='AFG', numeric='004')
Country(name='Åland Islands', alpha2='AX', alpha3='ALA', numeric='248')
Country(name='Albania', alpha2='AL', alpha3='ALB', numeric='008')
Country(name='Algeria', alpha2='DZ', alpha3='DZA', numeric='012')
>>> import iso3166
>>> iso3166.countries_by_name
>>> {'AFGHANISTAN': Country(name=u'Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
'ALBANIA': Country(name=u'Albania', alpha2='AL', alpha3='ALB', numeric='008'),
'ALGERIA': Country(name=u'Algeria', alpha2='DZ', alpha3='DZA', numeric='012'),
...
>>> iso3166.countries_by_numeric
>>> {'004': Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
'008': Country(name='Albania', alpha2='AL', alpha3='ALB', numeric='008'),
'010': Country(name='Antarctica', alpha2='AQ', alpha3='ATA', numeric='010'),
...
>>> iso3166.countries_by_alpha2
>>> {'AD': Country(name='Andorra', alpha2='AD', alpha3='AND', numeric='020'),
'AE': Country(name='United Arab Emirates', alpha2='AE', alpha3='ARE', numeric='784'),
'AF': Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
...
>>> iso3166.countries_by_alpha3
>>> {'ABW': Country(name='Aruba', alpha2='AW', alpha3='ABW', numeric='533'),
'AFG': Country(name='Afghanistan', alpha2='AF', alpha3='AFG', numeric='004'),
'AGO': Country(name='Angola', alpha2='AO', alpha3='AGO', numeric='024'),
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iso3166-2.0.0.tar.gz
(10.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iso3166-2.0.0.tar.gz.
File metadata
- Download URL: iso3166-2.0.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c629a6a7af98851869bcebdc5c8d19041a1f814be864352ba73a40d5cc891fb4
|
|
| MD5 |
1cc1e938864374784bc28467c8716ba7
|
|
| BLAKE2b-256 |
6f622e73d92d085fd8e527e0d573635b443ac644243a0671040f73bab395d546
|
File details
Details for the file iso3166-2.0.0-py3-none-any.whl.
File metadata
- Download URL: iso3166-2.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cda6ac0ec7df6ddd9cc6a24692adef45b946ed7be80f16379bd38404e2a57cb
|
|
| MD5 |
d1f0a053585244a68999d5756109fbf8
|
|
| BLAKE2b-256 |
36d270bff701fa15caafcd719580794a76125283d12069c89f2352ab00ebf8a9
|