How to use the steampy.utils.parse_price function in steampy

To help you get started, we’ve selected a few steampy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bukson / steampy / test / test_utils.py View on Github external
def test_parse_price_without_currency_symbol(self):
        price = '11,33 USD'
        decimal_price = utils.parse_price(price)
        self.assertEquals(decimal_price, decimal.Decimal('11.33'))
github bukson / steampy / test / test_utils.py View on Github external
def test_parse_price_without_decimal_separator(self):
        price = '2137 CZK'
        decimal_price = utils.parse_price(price)
        self.assertEquals(decimal_price, decimal.Decimal('2137'))
github bukson / steampy / test / test_utils.py View on Github external
def test_parse_price_with_currency_symbol(self):
        price = '$11.33 USD'
        decimal_price = utils.parse_price(price)
        self.assertEquals(decimal_price, decimal.Decimal('11.33'))
github bukson / steampy / test / test_utils.py View on Github external
def test_parse_price_without_space(self):
        price = '21,37zł'
        decimal_price = utils.parse_price(price)
        self.assertEqual(decimal_price, decimal.Decimal('21.37'))
github bukson / steampy / steampy / client.py View on Github external
def get_wallet_balance(self, convert_to_decimal: bool = True) -> Union[str, decimal.Decimal]:
        url = SteamUrl.STORE_URL + '/account/history/'
        response = self._session.get(url)
        response_soup = bs4.BeautifulSoup(response.text, "html.parser")
        balance = response_soup.find(id='header_wallet_balance').string
        if convert_to_decimal:
            return parse_price(balance)
        else:
            return balance