def main():
    btc = Decimal(0)
    try:
        for balance in get_balances():
            try:
                btc += get_amt_in_btc(balance)
            except ValueError:
                sys.stderr.write(
                    'WARNING: Cannot convert {0} to btc\n'.format(
                        balance.currency.abbreviation
                    )
                )
                # there isn't an exchange for this coin to BTC, ignore it
                pass
    except HTTPError as e:
        print("Error: status code {0}".format(e.code))
        print("Is coinex down?")
        return

    btc_str = '{0:12.8f}'.format(btc)
    print('{0} BTC'.format(btc_str))

    try:
        usd = get_amt_in_usd(btc)
    except HTTPError as e:
        print("Error: status code {0}".format(e.code))
        print("Is bitstramp down?")
        return

    usd_str = '{0:12.8f}'.format(usd)
    print('{0} USD'.format(usd_str))
Get the market cap!
dataset/ETHPy150Open robmcl4/Coinex/market_cap.py/main