Skip to main content

Python library for currency exchange.

Project description

Project Portfolio: https://github.com/calebyhan/CalebHan

currency-ch

Python library for currency exchanges.

All rates originated from FloatRates.

Disclaimer: all rates may or may not be the most accurate, and could vary by search on the internet.

Installation


Use the package manager pip to install currency-ch.

pip install currency-ch

Usage


import currency



# converts amount of money from one currency to another

currency.convert("usd", "eur", 1)



# returns rate from one currency to another

currency.rate("usd", "eur")

Documentation


currency.convert(input_currency, output_currency, amount, roundTo)

Converts input_currency of amount (default 1) to output_currency with rounded to roundTo decimal places (default 2).

currency.rate(input_currency, output_currency, roundTo)

Returns rate of converting input_currency to output_currency rounded to roundTo decimal places (default 2).

currency.add(values, output_currency, roundTo)

Adds up currencies in 2-D array values (in format [amount, input_currency]), and displays in form of output_currency rounded to roundTo decimal places (default 2).

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

currency-ch-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

currency_ch-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file currency-ch-0.1.0.tar.gz.

File metadata

  • Download URL: currency-ch-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for currency-ch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aec44606b5935f1f6ea840403c920f18b4816035067462a022a35a3be1f8ce67
MD5 71099dafc58c0d9adce23f9f3d77ed03
BLAKE2b-256 7c65a8ca687263218fbf578f5fcf033a32926fb40ad486efa8ab026e1f6c3e42

See more details on using hashes here.

File details

Details for the file currency_ch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: currency_ch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for currency_ch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee1ff1a944274933fe131557ba7683eb1976b5ac8a14a5ca190ce947f78cf9ca
MD5 fbf4b5df0396e72bb4dc996bb89969f1
BLAKE2b-256 4753eb4598fe52aac1522e89e4b012d52fa8235780fe9f63d2b40718dcb32a5f

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