Skip to main content

Maps from two or three letter country codes to short names

Project description

PyPI npm

This package helps turning two or three letter codes into short English names.

shortcountrynames is maintained by Robert Gieseke (rob.g@web.de).

CSV file

CSV file, with two and three-letter country codes and short English country names based on the country-codes Data Package with some changes and additions to the choice of short names.

Python module

Install with

pip install shortcountrynames

Usage

from shortcountrynames import to_name

assert to_name("DE") == "Germany"
assert to_name("DEU") == "Germany"

JavaScript module

Install with

npm install shortcountrynames

Usage

import {names, to_name} from 'shortcountrynames'

// Define custom codes
names["FOO"] = 'Foo'

console.log(to_name("DEU")) // Germany
console.log(to_name("FOO")) // Foo

Notes

Non-standard codes:

EU, EUU - European Union

XK, XKX - Kosovo

Releasing

Run make update-version to update the Python and Node version and create a new tag.

Push to GitHub with

git push origin main --tags

License

CC0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shortcountrynames-0.17.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shortcountrynames-0.17.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file shortcountrynames-0.17.0.tar.gz.

File metadata

  • Download URL: shortcountrynames-0.17.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shortcountrynames-0.17.0.tar.gz
Algorithm Hash digest
SHA256 c987ca60cd0bb95281cdd98af7397c31c334cf34e21c8206112a73f85f02e589
MD5 5db7c1f30be855f29f9450ccd9494200
BLAKE2b-256 f3ecba7526fd8f62e0c30cf08243242980fd3302d0e178f820b0c6252d7257fe

See more details on using hashes here.

File details

Details for the file shortcountrynames-0.17.0-py3-none-any.whl.

File metadata

  • Download URL: shortcountrynames-0.17.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shortcountrynames-0.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33a324fd8b684006715f638d57d1e07940d48a40e1477069989b3ac722ea9476
MD5 1218e82942fbce70a510b8c044c49c64
BLAKE2b-256 315763fd52a2413250617cc850e38321c10d6edd96acd14b3aef61141b8ea545

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page