Nepal ForEx is a Python package for making Currency Exchange easier and fast between NPR and Foreign Currencies.
Project description
Nepal ForEx
Nepal ForEx is a Python package for making Currency Exchange easier and fast between NPR and Foreign Currencies.
It parses current exchange rate from Nepal Rastra Bank. Exchange rates are genuine and realtime provided by Nepal Rastra Bank.
Supported Currencies
- INR
- USD
- EUR
- GBP
- CHF
- AUD
- CAD
- SGD
- JPY
- CNY
- SAR
- QAR
- THB
- AED
- MYR
- KRW
- SEK
- DKK
- HKD
- BHD
Installation
Use the package manager pip to install nepal-forex.
pip install nepal-forex
Usage
Nepal ForEx
To get NPR exchange rate of specified currency on specified date.
from nepal_forex.nepal_forex import nepal_forex
nepal_forex.exchange_rate(currency='USD', date='2020-08-27') # Decimal('118.58')
To get NPR exchange rate of specified currency of today.
from nepal_forex.nepal_forex import nepal_forex
nepal_forex.exchange_rate(currency='USD') # Decimal('118.58')
To convert NPR amount to specified currency of today exchange rate.
from nepal_forex.nepal_forex import nepal_forex
nepal_forex.convert_to(amount=160, currency='USD') # Decimal('1.35')
To convert NPR amount to specified currency of specified date exchange rate.
from nepal_forex.nepal_forex import nepal_forex
nepal_forex.convert_to(amount=160, currency='USD', date='2020-08-27') # Decimal('1.35')
To convert specified currency amount to NPR of today exchange rate.
from nepal_forex.nepal_forex import nepal_forex
nepal_forex.convert_from(amount=100, currency='USD') # Decimal('11858.00')
To convert specified currency amount to NPR of specified date exchange rate.
from nepal_forex.nepal_forex import nepal_forex
nepal_forex.convert_from(amount=100, currency='USD', date='2020-08-27') # Decimal('11858.00')
Also Decimal places can be set.
from nepal_forex.nepal_forex import nepal_forex
nepal_forex.convert_to(amount=160, currency='USD', date='2020-08-27', decimal_places=4) # Decimal('1.3582')
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
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.