:mod:`golosscripts.functions` ============================= .. py:module:: golosscripts.functions Module Contents --------------- .. data:: log .. function:: price_troyounce_to_price_1mg(price_troyounce: float) -> float Convert price per troy ounce to price per milligramm. .. function:: get_price_rub_gold_cbr(timeout: Union[int, float] = 12, session: Optional[aiohttp.ClientSession] = None) -> float :async: Get price of 1 mg Gold from Russian Central Bank; return value is RUB. .. function:: get_price_usd_rub_cbr(timeout: Union[int, float] = 12, session: Optional[aiohttp.ClientSession] = None) -> float :async: Get USD/RUB price from Russian Central Bank API mirror. .. function:: get_price_usd_gold_cbr() -> float :async: Calculate price of 1 mg GOLD in USD based on cbr.ru rates. .. function:: fetch_ticker(exchange: str, market: str) -> Dict[str, Any] :async: Fetch ticker data from exchange. :param exchange: exchnage name, see `Supported exchanges `_ :param market: market like 'BTC/USD' :return: ticker :rtype: dict .. function:: get_price_btc_usd_exchanges() -> float :async: Returns average BTC/USD price across several pre-defined exchanges.