Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


iso4217: Currency data package for Python

This Python package contains ISO 4217 currency data, represented as enum module which was introduced in 3.4. Note that this works on Python 2.5 as well as 3.7, the latest version of Python, through enum34 package.

>>> from iso4217 import Currency
>>> Currency.usd
<Currency.usd: 'USD'>
>>> Currency.usd.code
>>> Currency.usd.currency_name
'US Dollar'
>>> Currency.usd.exponent  # USD has cents
>>> Currency.jpy
<Currency.jpy: 'JPY'>
>>> Currency.jpy.currency_name
>>> Currency.jpy.exponent  # JPY has no minor units
>>> Currency('KRW')  # Get by the code string
<Currency.krw: 'KRW'>
>>> Currency.krw is Currency('KRW')

Written by Hong Minhee. Distributed under Public Domain.