A library for country and currency ISO codes
Project description
teritorio: ISO codes for countries and currencies
Installation and usage
Installation
teritorio can be installed by running pip install teritorio
. It requires Python 3.7.0+ to run.
Usage
The two main objects are Countries
and Currencies
:
Countries usage
from teritorio import Countries
# list all countries
for country in Countries():
print(country)
# get a specific country
countries = Countries()
# access the country as an attribute
print(countries.DEU) # Country(english_name='Germany', french_name="Allemagne (l')", alpha_2_code='DE', alpha_3_code='DEU', numeric_code=276)
# access the country with square brackets
print(countries["DEU"]) # Country(english_name='Germany', french_name="Allemagne (l')", alpha_2_code='DE', alpha_3_code='DEU', numeric_code=276)
Currencies usage
from teritorio import Currencies
# list all currencies
for currency in Currencies():
print(currency)
# get a specific currency
currencies = Currencies()
# access the currency as an attribute
print(currencies.GBP) # Currency(code='GBP', name='Pound Sterling', entities=['GUERNSEY', 'ISLE OF MAN', 'JERSEY', 'UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE)'], numeric_code=826, minor_units=2)
# access the currency with square brackets
print(currencies["GBP"]) # Currency(code='GBP', name='Pound Sterling', entities=['GUERNSEY', 'ISLE OF MAN', 'JERSEY', 'UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE)'], numeric_code=826, minor_units=2)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
teritorio-1.1.0.tar.gz
(21.1 kB
view hashes)
Built Distribution
teritorio-1.1.0-py3-none-any.whl
(20.0 kB
view hashes)
Close
Hashes for teritorio-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8aee3f0c39f04e1803a06b3cdd7a2a09176dc236a8afa3dc8a68e8288f3325a1 |
|
MD5 | 121ae60f28005e934b85e92eb5e78f8b |
|
BLAKE2b-256 | 3e5b12177bd5e9110fb87ce6001510445efe9efc4948fcef20f1d78ccb5aee8d |