Migration Notice
Migrate from tardis-client and tardis_dev.datasets to the unified tardis-dev package
Last updated
Was this helpful?
Was this helpful?
import asyncio
from tardis_client import TardisClient, Channel
async def main():
tardis_client = TardisClient(api_key="YOUR_API_KEY")
async for local_timestamp, message in tardis_client.replay(
exchange="bitmex",
from_date="2019-06-01",
to_date="2019-06-02",
filters=[Channel("trade", ["XBTUSD"])],
):
print(local_timestamp, message)
asyncio.run(main())import asyncio
from tardis_dev import Channel, replay
async def main():
async for local_timestamp, message in replay(
exchange="bitmex",
from_date="2019-06-01",
to_date="2019-06-02",
filters=[Channel("trade", ["XBTUSD"])],
api_key="YOUR_API_KEY",
):
print(local_timestamp, message)
asyncio.run(main())from tardis_dev import datasets
datasets.download(
exchange="deribit",
data_types=["trades", "incremental_book_L2"],
symbols=["BTC-PERPETUAL"],
from_date="2019-11-01",
to_date="2019-11-02",
api_key="YOUR_API_KEY",
)from tardis_dev import download_datasets
download_datasets(
exchange="deribit",
data_types=["trades", "incremental_book_L2"],
symbols=["BTC-PERPETUAL"],
from_date="2019-11-01",
to_date="2019-11-02",
api_key="YOUR_API_KEY",
)from tardis_client import TardisClient
tardis_client = TardisClient()
tardis_client.clear_cache()from tardis_dev import clear_cache
clear_cache()
clear_cache(cache_dir="./cache")