Skip to content

A lightweight python library to retrieve currencies based on ISO 4217 standard

License

Notifications You must be signed in to change notification settings

sklbancor/iso4217

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snatsch - ISO 4217

A lightweight python library to retrieve currencies based on ISO 4217 standard. This library was created despite of many others existing onces because it is lightweight, simple and easy to use.

References:

- https://en.wikipedia.org/wiki/ISO_4217
- https://www.currency-iso.org/en/home/tables/table-a1.html

Getting Started

pip install snatsch-iso4217

Usage

To get a list of all available currencies:

import iso4217

# get a list of all alphabetic codes
iso4217.get_list_of_currencies()

To check if a currency code is valid:

import iso4217

# is the alphabetic code valid?
iso4217.is_valid_currency("DOP")

To retrieve information about a currency:

import iso4217

# get a currency
currency = iso4217.get_currency("DOP")

# how is the currency called?
currency.name

# where is the currency used?
currency.entities

# which is it's numeric code?
currency.num

# which is it's alphabetic code?
currency.code

# how many digits after decimal point?
currency.decimal_digits

# is the currency a fund?
currency.fund

# or check everything at once
currency.__dict__

Tests

Run this command in the root of the project:

PYTHONPATH=${PWD} pytest -v tests

About

A lightweight python library to retrieve currencies based on ISO 4217 standard

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%