dahlia / iso4217

ISO 4217 currency data package for Python

Home Page:https://pypi.org/project/iso4217/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iso4217: Currency data package for Python

https://badge.fury.io/py/iso4217.svg?

This Python package contains ISO 4217 currency data, represented as enum module which was introduced in 3.4.

>>> from iso4217 import Currency
>>> Currency.USD
<Currency.USD: 'USD'>
>>> Currency.USD.code
'USD'
>>> Currency.USD.currency_name
'US Dollar'
>>> Currency.USD.exponent  # USD has cents
2
>>> Currency.JPY
<Currency.JPY: 'JPY'>
>>> Currency.JPY.currency_name
'Yen'
>>> Currency.JPY.exponent  # JPY has no minor units
0
>>> Currency('KRW')  # Get by the code string
<Currency.KRW: 'KRW'>
>>> Currency.KRW is Currency('KRW')
True
>>> Currency.krw is Currency.KRW  # Lower enumerants are also available

Written by Hong Minhee. Distributed under Public Domain.

About

ISO 4217 currency data package for Python

https://pypi.org/project/iso4217/


Languages

Language:Python 100.0%