https://github.com/dahlia/iso4217
ISO 4217 currency data package for Python
https://github.com/dahlia/iso4217
currency enum i18n iso4217 python
Last synced: about 1 year ago
JSON representation
ISO 4217 currency data package for Python
- Host: GitHub
- URL: https://github.com/dahlia/iso4217
- Owner: dahlia
- Created: 2015-07-24T09:26:20.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2022-07-14T18:32:31.000Z (almost 4 years ago)
- Last Synced: 2024-05-09T18:57:08.801Z (about 2 years ago)
- Topics: currency, enum, i18n, iso4217, python
- Language: Python
- Homepage: https://pypi.org/project/iso4217/
- Size: 35.2 KB
- Stars: 60
- Watchers: 20
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
``iso4217``: Currency data package for Python
=============================================
.. image:: https://badge.fury.io/py/iso4217.svg?
:target: https://pypi.python.org/pypi/iso4217
.. image:: https://github.com/dahlia/iso4217/actions/workflows/main.yaml/badge.svg
:target: https://github.com/dahlia/iso4217/actions/workflows/main.yaml
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.code
'USD'
>>> Currency.USD.currency_name
'US Dollar'
>>> Currency.USD.exponent # USD has cents
2
>>> Currency.JPY
>>> Currency.JPY.currency_name
'Yen'
>>> Currency.JPY.exponent # JPY has no minor units
0
>>> Currency('KRW') # Get by the code string
>>> Currency.KRW is Currency('KRW')
True
>>> Currency.krw is Currency.KRW # Lower enumerants are also available
Written by `Hong Minhee`_. Distributed under Public Domain.
.. _ISO 4217: http://www.iso.org/iso/home/standards/currency_codes.htm
.. _enum: https://docs.python.org/3/library/enum.html
.. _enum34: https://pypi.python.org/pypi/enum34
.. _Hong Minhee: https://hongminhee.org/