
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
This project provides lists of various ISO standards (e.g. country, language, language scripts, and currency names) in one place
isocodes provides you access to lists of various ISO standards (e.g. country, language, language scripts, and currency names).
The data is coming from https://salsa.debian.org/iso-codes-team/iso-codes, many thanks to them.
pip install isocodes
You can acces one country by using the method get with the parameters being the json keys of the .json files in the share/iso-codes/json folder
>>> from isocodes import countries
>>> countries.get(name="Germany")
{'alpha_2': 'DE', 'alpha_3': 'DEU', 'flag': '🇩🇪', 'name': 'Germany', 'numeric': '276', 'official_name': 'Federal Republic of Germany'}
You can get a json parsed list from the .json files in the share/iso-codes/json folder with the items property.
That list contains each countries in the form of the dictionary that you can get with the method get.
>>> from isocodes import countries
>>> for country in countries.items:
... print(country)
...
{'alpha_2': 'AW', 'alpha_3': 'ABW', 'flag': '🇦🇼', 'name': 'Aruba', 'numeric': '533'}
{'alpha_2': 'AF', 'alpha_3': 'AFG', 'flag': '🇦🇫', 'name': 'Afghanistan', 'numeric': '004', 'official_name': 'Islamic Republic of Afghanistan'}
{'alpha_2': 'AO', 'alpha_3': 'AGO', 'flag': '🇦🇴', 'name': 'Angola', 'numeric': '024', 'official_name': 'Republic of Angola'}
{'alpha_2': 'AI', 'alpha_3': 'AIA', 'flag': '🇦🇮', 'name': 'Anguilla', 'numeric': '660'}
{'alpha_2': 'AX', 'alpha_3': 'ALA', 'flag': '🇦🇽', 'name': 'Åland Islands', 'numeric': '248'}
You can get a list with sorted data by one of the property with the by_xxx property, xxx being one of the data key (alpha_2, name, numeric, etc.).
>>> countries.by_numeric[0]
('004', {'alpha_2': 'AF', 'alpha_3': 'AFG', 'flag': '🇦🇫', 'name': 'Afghanistan', 'numeric': '004', 'official_name': 'Islamic Republic of Afghanistan'})
Same as countries but you replace countries by languages
Same as countries but you replace countries by currencies
Same as countries but you replace countries by subdivisions_countries
Same as countries but you replace countries by former_countries
Same as countries but you replace countries by extendend_languages
Same as countries but you replace countries by language_families
Same as countries but you replace countries by script_names
Translations are included in this project with gettext support. The domain names are to be found on https://salsa.debian.org/iso-codes-team/iso-codes
>>> import gettext
>>> import isocodes
>>> french = gettext.translation('iso_639-2', isocodes.LOCALES_DIR, languages=['fr'])
>>> french.install()
>>> _("French")
'français'
bash update.sh
FAQs
This project provides lists of various ISO standards (e.g. country, language, language scripts, and currency names) in one place
We found that isocodes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.