Skip to content

sbishnu019/nepal-forex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

MIT

About

Nepal ForEx is a Python package for making Currency Exchange easier and fast between NPR and Foreign Currencies.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages