Skip to main content

countrynames

build

This library helps with the mapping of country names to their respective two or three letter codes. The idea is to incorporate common names for countries, and even some limited misspellings, as they occur in source data.

There is also support for fuzzy matching, which uses a heuristic based on levenshtein distance.

Usage

import countrynames

assert 'DE' == countrynames.to_code('Germany')
assert 'DE' == countrynames.to_code('Bundesrepublik Deutschland')
assert 'DE' == countrynames.to_code('Bundesrepublik Deutschlan', fuzzy=True)
assert 'DE' == countrynames.to_code('DE')
assert 'DEU' == countrynames.to_code_3('Germany')

Non-standard country codes

  • XK or XKX - Kosovo
  • EU or EUU - European Union

For some dissolved countries (e.g. SUHH for Soviet Union) and sub-regions (e.g. GB-SCT for Scotland) special codes are defined and returned from both to_code and to_code_3.

Metadata

Release files for countrynames 1.16.4

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

Source distribution (sdist)

Source distribution for countrynames 1.16.4
File Size Uploaded Provenance Actions
countrynames-1.16.4.tar.gz 467.8 kB With provenance Details for countrynames-1.16.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for countrynames 1.16.4
File Interpreter ABI Platform Actions
countrynames-1.16.4-py3-none-any.whl Python 3 none any Details for countrynames-1.16.4-py3-none-any.whl

Total release size: 941.2 kB

Release files / countrynames-1.16.4.tar.gz

Download URL countrynames-1.16.4.tar.gz
Size 467.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4eb5e93ee6b26737ae8246fbb6707f07504c9f814b4555e648e3009ff43d89ac
BLAKE2b-256 checksum
How to use checksums
0f42b7d34fc2a13915f827638f8b0c0e37f11eba724fb5e11aa50240df651fe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2024.

Transparency log

Release files / countrynames-1.16.4-py3-none-any.whl

Download URL countrynames-1.16.4-py3-none-any.whl
Size 473.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9f27cd78aa2371aa4677521fb5e4374b25f4ceb710f90c9ae80541b3efcb619
BLAKE2b-256 checksum
How to use checksums
2c274205dc4c8621a1a2d675e2db483bfae5d0e02938bc691ae0ab3d03b28d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2024.

Transparency log

Security for countrynames 1.16.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for countrynames-1.16.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2024.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.16.4 This release

2 release files Full provenance

0.0.1

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