Skip to main content

Python client for tardis.dev - historical tick-level cryptocurrency market data replay API.

Project description

tardis-dev

PyPi Python Code style: black


Python tardis-dev package provides convenient access to tick-level historical cryptocurrency market data in exchange-native format. It focuses on two primary workflows: replaying historical market data and downloading CSV datasets. If you need normalized replay or real-time streaming, use the Node.js client or Tardis Machine.


import asyncio
from tardis_dev import Channel, replay


async def main():
    async for local_timestamp, message in replay(
        exchange="binance",
        from_date="2024-03-01",
        to_date="2024-03-02",
        filters=[Channel("trade", ["btcusdt"]), Channel("depth", ["btcusdt"])],
        api_key="YOUR_API_KEY",
    ):
        print(local_timestamp, message)


asyncio.run(main())

Features



  • support for many cryptocurrency exchanges — see docs.tardis.dev for the full list



Installation

Requires Python 3.9+ installed.

pip install tardis-dev


Documentation

See official docs



Examples

Replay historical market data

import asyncio
from tardis_dev import Channel, replay


async def main():
    async for local_timestamp, message in replay(
        exchange="binance",
        from_date="2024-03-01",
        to_date="2024-03-02",
        filters=[Channel("trade", ["btcusdt"]), Channel("depth", ["btcusdt"])],
    ):
        print(local_timestamp, message)


asyncio.run(main())

Download CSV datasets

from tardis_dev import download_datasets


download_datasets(
    exchange="binance",
    data_types=["trades", "incremental_book_L2"],
    symbols=["BTCUSDT"],
    from_date="2024-03-01",
    to_date="2024-03-02",
    api_key="YOUR_API_KEY",
)

Migration from tardis-client

This package is the v3 API. Existing tardis-client and tardis_dev.datasets.download() users should migrate to the new top-level functions:

  • replay: TardisClient().replay(...) -> replay(...)
  • datasets: from tardis_dev import datasets; datasets.download(...) -> from tardis_dev import download_datasets
  • cache cleanup: tardis_client.clear_cache() -> clear_cache()

See Migration Notice for the full migration guide.



See the tardis-dev docs for more examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tardis_dev-3.0.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tardis_dev-3.0.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file tardis_dev-3.0.0.tar.gz.

File metadata

  • Download URL: tardis_dev-3.0.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.9.25 Linux/6.17.0-1008-azure

File hashes

Hashes for tardis_dev-3.0.0.tar.gz
Algorithm Hash digest
SHA256 5c6f11798b68144c79c5f9be9f33bda8d094cc091adda9085c6aeee29b0c134b
MD5 41eaf6f30b436c97268884a9d1958170
BLAKE2b-256 adcd1691e4459b144ceb28de1791365e78e5b9cd9fb49eebffa69be7c5c1b576

See more details on using hashes here.

File details

Details for the file tardis_dev-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: tardis_dev-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.9.25 Linux/6.17.0-1008-azure

File hashes

Hashes for tardis_dev-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71347fd1b1e3d01396d7bd20de25d9bacfe1dcfb21a356c55a9784c07fc6e9a1
MD5 6a3ff43ecd3a48f605ff4c18ebb620ac
BLAKE2b-256 0979726dd41ffa492f66e7ca06a40eef4b48fe87c0ecb618a72911112a9f4714

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page