Skip to main content

Country List

https://github.com/bulv1ne/country_list/actions/workflows/python-app.yml/badge.svg https://img.shields.io/pypi/v/country_list.svg Updates https://coveralls.io/repos/github/bulv1ne/country_list/badge.svg?branch=master https://img.shields.io/badge/code%20style-black-000000.svg Quality Gate Status

Features

  • List of all countries with names and ISO 3166-1 codes in all languages and all data formats.

Installation

Install country_list by running:

pip install country_list

Usage

Get all available languages:

from country_list import available_languages

for language in available_languages():
    print(language)

Get country names in english and swedish:

>>> from country_list import countries_for_language
>>> # countries_for_language returns a list of tuples now, might be changed to an OrderedDict
>>> countries = dict(countries_for_language('en'))
>>> print(countries['GB'])
'United Kingdom'
>>> print(countries['SE'])
'Sweden'
>>> countries = dict(countries_for_language('sv'))
>>> print(countries['GB'])
'Storbritannien'
>>> print(countries['SE'])
'Sverige'

Get country codes from country name:

>>> from country_list import countries_for_language
>>> # countries_for_language returns a list of tuples now, might be changed to an OrderedDict
>>> country_names = {name: code for code, name in countries_for_language('en')}
>>> print(country_names['United Kingdom'])
'GB'
>>> print(country_names['Sweden'])
'SE'
>>> country_names = {name: code for code, name in countries_for_language('sv')}
>>> print(country_names['Storbritannien'])
'GB'
>>> print(country_names['Sverige'])
'SE'

Credits

This package contains the data files from umpirsky/country-list.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

License

The project is licensed under the MIT license.

Metadata

Release files for country-list 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for country-list 1.1.2
File Size Uploaded Provenance Actions
country_list-1.1.2.tar.gz 304.0 kB Without provenance Details for country_list-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for country-list 1.1.2
File Interpreter ABI Platform Actions
country_list-1.1.2-py3-none-any.whl Python 3 none any Details for country_list-1.1.2-py3-none-any.whl

Total release size: 1.8 MB

Release files / country_list-1.1.2.tar.gz

Download URL country_list-1.1.2.tar.gz
Size 304.0 kB
Tags Source
SHA-256 checksum
How to use checksums
074ff18368b5a6291dd4870d120cd2a5594ada260b75e715b9c3edd18ed559b6
BLAKE2b-256 checksum
How to use checksums
8b6f2b49546664601cc713b450efc2186c7cddb1b2c6fefdb0c6e3fec0f4d7e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / country_list-1.1.2-py3-none-any.whl

Download URL country_list-1.1.2-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
caf767be45f6a252270f0eabb1d04517b58ff915bdabb1992b5a77a9b8328e04
BLAKE2b-256 checksum
How to use checksums
3dee78c0d065e44cd6c21cc2183eb2ccf7ab0061ef0534ca044da0c0ac5316ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for country-list 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page