Skip to main content

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 historical market data as CSV files. If you need normalized replay or real-time streaming, use the Node.js client or Tardis Machine.

replay() accepts ISO date strings or Python datetime values. Naive datetimes are treated as UTC.


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


Development

This repository uses uv for dependency management, locking, builds, and release automation.

uv sync --locked --group dev
uv run black --check tardis_dev tests
uv run pytest tests/ -q -m "not live"
uv build --no-sources


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.

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-4.3.0.tar.gz (16.1 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-4.3.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tardis_dev-4.3.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tardis_dev-4.3.0.tar.gz
Algorithm Hash digest
SHA256 bd636f63fd2644a2532d928708fc8844fd6f7fbefcc705e7d95a0b5b96c4f35f
MD5 092616082bd36617facddd7953afd9ea
BLAKE2b-256 03a9c1750cccbfda9bbaf44e064e7ed107f4aef585d9ec6a3771bc0fb5bb113b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tardis_dev-4.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tardis_dev-4.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0677a3cc07490357615da5aa4d3667a6a89d90522cd878515d1fd66cc40eb1c0
MD5 042aed13b2195aa850ed2b6b2bfe1d42
BLAKE2b-256 9de314dfa7f605d8d3b14f2de9997239f52244feb4a1e56fbb4a6fa0bd472900

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 Sentry Error logging StatusPage Status page