Skip to main content

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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nepal-forex-1.0.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file nepal-forex-1.0.tar.gz.

File metadata

  • Download URL: nepal-forex-1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.5

File hashes

Hashes for nepal-forex-1.0.tar.gz
Algorithm Hash digest
SHA256 b65ed8382432e8c8fef427e78c2a8a4607256261472a7fe33cf99aa0521e9fdb
MD5 a1fe2bfbc70f523f68b812c87be54136
BLAKE2b-256 5f7362c0790f00e08f6b756afc15fa14e8076382f5b02ccb5e656f39d6584b86

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page