Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
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.
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')
XK
or XKX
- KosovoEU
or EUU
- European UnionFor 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
.
FAQs
A library to map country names to 2-letter ISO codes.
We found that countrynames demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.