StockStalker.currency - RockoonTechnologies/StockStalker GitHub Wiki
Currency
The currency
module is what allows you to one currency to another, or just get its live value
To operate currency
simply import it:
import StockStalker.currency as currency
*Note: the base for all conversions are in EUR *Note: values of currency are near-realtime
This module supports 140+ currencys
To begin, create a Currency
object:
currency.Currency(shorthand, amount)
usd = currency.Currency("USD", 10)
Then you can convert it like so:
eur = currency.Convert(usd, "EUR")
If a currency is not supported, the following exception will be raised:
Currency not supported
Supported currencies are: {supportedCurrencies}"
Verify Currency
the following function ensures wether a Currency is supported:
currency.verifyShorthand(shorthand)
returns True
, if supported, False
if not