Skip to main content

All possible translations, acronyms for a specific country name / country iso

Project description

Project description

country_acronyms

This package was made for everyone who needs to find all possible translations, acronyms for a specific country name / country iso.

Acknowledgements

country_acronyms provides the support for the:

  • ISO 3166-1 alpha-2
  • ISO 3166-1 alpha-3

Contributions

The code lives in a git repository on GitHub, and issues must be reported in there as well.

Installation

Install country_acronyms by running:

  pip install country_acronyms

Usage/Examples

from country_acronyms import get_supported_languages, 
                             get_country_acronyms, 
                             get_country_acronyms_iso, 
                             get_all_country_acronyms

# get available languages
get_supported_languages()

>>> {'afrikaans': 'af', 'albanian': 'sq', ... , 'yoruba': 'yo', 'zulu': 'zu'}

# acronyms for given country name
get_country_acronyms("Austria")

>>> {'af': 'Oostenryk', ... , 'zu': 'E-Austria'}

# acronyms for given country iso
get_country_acronyms_iso("it")

>>> {'af': 'Italië', ... , 'zu': 'Italy'}

# acronyms for given country iso
get_country_acronyms_iso("usa")

>>> {'af': 'Verenigde State', ... , 'zu': 'iziwe Ezihlangene'}

# getting all country acronyms by scraping wiki
get_all_country_acronyms()

>>> {'Abkhazia': ['Abcasia', ... , 'Apxazeti'], , 'Afghanistan': ['Æfganisthanaya', ... , 'l-Afghanistan'], ... }

Credits

This package uses the deep_translator, pycountry and bs4. Big up for those!

License

The project is licensed under the MIT License.

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

country_acronyms-0.0.7.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

country_acronyms-0.0.7-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file country_acronyms-0.0.7.tar.gz.

File metadata

  • Download URL: country_acronyms-0.0.7.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.2

File hashes

Hashes for country_acronyms-0.0.7.tar.gz
Algorithm Hash digest
SHA256 8ce7fb17d13bbf711d97e038e45b4d843680b05f4dd95a616cc58a922276d3a9
MD5 41c58d71767e50ec2eca106c70cc14cc
BLAKE2b-256 748940969662a5eac74d3f090e8aa1768440d01a5476de6ae84698e508fb8250

See more details on using hashes here.

File details

Details for the file country_acronyms-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for country_acronyms-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9a47f4bfe96b7ab1f8757f962b9fe6690fb81fa78f6e43b5781f16d882a6143a
MD5 d5aa9229329e721a34f4246e77e66621
BLAKE2b-256 d5d052a662d461a5b454fc3e97e9c59bc58a45b7f5b7cd2f815eb010939a0d1a

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