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
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | aec44606b5935f1f6ea840403c920f18b4816035067462a022a35a3be1f8ce67 |
|
MD5 | 71099dafc58c0d9adce23f9f3d77ed03 |
|
BLAKE2b-256 | 7c65a8ca687263218fbf578f5fcf033a32926fb40ad486efa8ab026e1f6c3e42 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee1ff1a944274933fe131557ba7683eb1976b5ac8a14a5ca190ce947f78cf9ca |
|
MD5 | fbf4b5df0396e72bb4dc996bb89969f1 |
|
BLAKE2b-256 | 4753eb4598fe52aac1522e89e4b012d52fa8235780fe9f63d2b40718dcb32a5f |