tardis-dev
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
- historical tick-level market data replay backed by Tardis.dev HTTP API
- support for many cryptocurrency exchanges — see docs.tardis.dev for the full list
Installation
Requires Python 3.10+ 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.
Metadata
Release files for tardis-dev 5.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tardis_dev-5.0.1.tar.gz | 16.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tardis_dev-5.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.9 kB
Release files / tardis_dev-5.0.1.tar.gz
| Download URL | tardis_dev-5.0.1.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74e9f6deebbf7d4eba02cc584188302694623335d84e559b68d0780faff991e7
|
|
BLAKE2b-256 checksum How to use checksums |
0fdc7aaf919febe66d95a2140fbb36c1c10f09cebc80761da2c54ee139385f8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| 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}
|
Release files / tardis_dev-5.0.1-py3-none-any.whl
| Download URL | tardis_dev-5.0.1-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3760fad09c241c9f9014830f80f13361695d3392fe70cd72e3cae8dd0c545d8
|
|
BLAKE2b-256 checksum How to use checksums |
762fb42fa08b7a08b63405e82eb16b429800004852f8f172a3dc828e88e32d8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| 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}
|