Exemplo n.º 1
0
    async def wrapper():
        async with AsyncPymarketcap(debug=True) as apym:
            res = await apym._cache_symbols()

            assert type(res) == dict
            for symbol, slug in res.items():
                assert type(symbol) == str
                assert type(slug) == str
Exemplo n.º 2
0
 async def wrapper():
     async with AsyncPymarketcap(debug=True) as apym:
         properties = [
             "symbols", "coins", "exchange_names", "exchange_slugs"
         ]
         for prop in properties:
             res = eval("apym.%s" % prop)
             assert type(res) == list
             assert len(res) > 0
async def main():
    async with AsyncPymarketcap(queue_size=50, consumers=50,
                                debug=True) as apym:
        async for d in apym.graphs.every_currency(['bitcoin'],
                                                  start=start,
                                                  end=end,
                                                  use_auto_timeframe=True):
            pprint(d)
            print(d.keys())
Exemplo n.º 4
0
async def graphs_currency(**kwargs):
    async with AsyncPymarketcap(debug=True, queue_size=50,
                                consumers=50) as apym:
        currencies = []
        show_msg = True
        async for currency in apym.graphs.every_currency(**kwargs):
            if show_msg:
                print("Testing all responses...")
                show_msg = False
            currencies.append(currency)
        return currencies
Exemplo n.º 5
0
    async def wrapper():
        async with AsyncPymarketcap(**asyncparms) as apym:
            show_msg = True
            async for (currency) in apym.every_historical():
                if show_msg:
                    print("Testing all responses...")
                    show_msg = False
                res.append(currency)

                assert_types(currency)
                assert_consistence(currency)
            assert isinstance(res, list)
    async def wrapper():
        async with AsyncPymarketcap(debug=True, queue_size=50,
                                    consumers=50) as apym:
            res = []
            show_msg = True
            async for (currency) in apym.graphs.every_currency():
                if show_msg:
                    print("Testing all responses...")
                    show_msg = False
                res.append(currency)

                assert_types(currency)

            assert type(res) == list
Exemplo n.º 7
0
    async def wrapper():
        async with AsyncPymarketcap(**asyncparms) as apym:
            show_msg = True
            async for exc in apym.every_exchange():
                if show_msg:
                    print("Testing all responses...")
                    show_msg = False
                res.append(exc)

                assert_types(exc)
                assert_consistence(exc)
            assert isinstance(res, list)

        with open(cache_file, "w") as f:
            f.write(json.dumps(res, ensure_ascii=False))
Exemplo n.º 8
0
    async def wrapper():
        async with AsyncPymarketcap(debug=True,
                                    queue_size=50,
                                    consumers=50) as apym:
            res = []
            show_msg = True
            async for exc in apym.every_exchange():
                if show_msg:
                    print("Testing all responses...")
                    show_msg = False
                res.append(exc)

                assert_types(exc)
                assert_consistence(exc)
            assert type(res) == list
Exemplo n.º 9
0
 async def wrapper():
     async with AsyncPymarketcap() as apym:
         res = await apym._cache_symbols()
         assert len(res) > 0
Exemplo n.º 10
0
 async def get_all_historical():
     async with AsyncPymarketcap(**asyncparms) as apym:
         async for currency in apym.every_historical():
             res.append(currency)
Exemplo n.º 11
0
 async def wrapper():
     async with AsyncPymarketcap(**asyncparms) as apym:
         sync_interface = apym.sync
     assert isinstance(sync_interface, Pymarketcap)
Exemplo n.º 12
0
async def main():
    async with AsyncPymarketcap() as apym:
        async for currency in apym.every_currency():
            print(currency)
Exemplo n.º 13
0
 async def wrapper():
     async with AsyncPymarketcap(debug=True) as apym:
         sync_interface = apym.sync
     assert isinstance(sync_interface, Pymarketcap)
Exemplo n.º 14
0
 async def get_all_exchanges():
     async with AsyncPymarketcap(**asyncparms) as apym:
         async for currency in apym.every_exchange():
             res.append(currency)
Exemplo n.º 15
0
async def main():
    async with AsyncPymarketcap(queue_size=50, consumers=50) as apym:
        async for currency in apym.every_historical():
            res.append(currency)