Skip to main content

CCXT Download Utility

Latest version Code style: black

A lightweight wrapper to conventiently and efficiently download cryptocurrency data using CCXT.

About ccxt-download

What is it for? Downloading cryptocurrency data accessible via CCXT, but with less effort.

Why is this necessary? Many times I have found myself needing some data, only to spend some time writing a quick and dirty script to download said data with no thought about storing it for later. Add multiple symbols across different time periods to the mix, and things just get worse. Then when I want to load that data later, its so badly organised (or not at all) that it is easier to write another quick and dirty script and repeat the cycle. With this package, the above issues are no longer issues. For me anyway.

What makes this useful? The following features:

  • asynchronous downloading (download data in parallel)
  • intelligent file management (won't re-download data if it already exists)
    • if data is downloaded for the current day, it will be marked as incomplete, which will signal that it should be updated in future downloads
  • efficient data storage (using Apache Parquet)
  • helpful utilities for loading and processing data

Usage

Below are some brief examples illustrating the basic functionality of ccxt-download. For more, see the examples.

Downloading data

from ccxt_download import public, CANDLES

# Download candles
public.download(
    exchange="bybit",
    data_types=[CANDLES],
    symbols=[
        "ETH/USDT:USDT",
        "BTC/USDT:USDT",
    ],
    start_date="2023-09-01",
    end_date="2023-09-05",
)

Data will be downloaded between the dates specified. If the data already exists, it will not be re-downloaded. The exception to this is when a dataset has been marked as incomplete, for example when you download data for the current day (which has not ended yet). When this is detected, that incomplete dataset will be updated. If it can be completed, the incomplete marking will be removed.

Reading downloaded data

from ccxt_download import CANDLES
from ccxt_download.utilities import load_data

df = load_data(
    exchange="bybit",
    data_type=CANDLES,
    data_type_id="1m",
    symbols=["ETH/USDT:USDT"],
    start_date="2023-09-01",
    end_date="2023-09-04",
)

Installation

pip install ccxt-download

Notes and future work

  • Support for private downloads to assist in accounting, account tracking and analysis, etc.

Contributing

Contributions to ccxt-download are welcomed. However, please try follow the guidelines below.

Seek early feedback

Please open an issue before a pull request to discuss any changes you wish to make.

Code style

The code in this project is formatted using Black. The Black package is included in the dev dependencies of ccxt-download. As mentioned below, please run black . before opening a pull request.

Setting up for Development

Fork this repository, then install from source using an editable installation. Additionally, install with the optional dev dependencies.

pip install -e .[dev]

If you want to make sure you have formatted the code before commiting, install the pre-commit hook using the command below. This will check that the code is formatted whenever you try to make a commit.

pre-commit install

If you get a message saying the code isn't formatted correctly, simply run the command below and try again.

black .

Metadata

Release files for ccxt-download 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccxt-download 0.4.1
File Size Uploaded
ccxt_download-0.4.1.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ccxt-download 0.4.1
File Interpreter ABI Platform
ccxt_download-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / ccxt_download-0.4.1.tar.gz

Download URL ccxt_download-0.4.1.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fb97237fc0da94cc09df6e29ecd92d7d1e3fbd070f9fa76b6aa1708fd20ec95e
BLAKE2b-256 checksum
How to use checksums
48c1a7fe8079371bc7c4371f26a9a30202c1b2b2137e9b1e691ca5ef889698f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release files / ccxt_download-0.4.1-py3-none-any.whl

Download URL ccxt_download-0.4.1-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffe94bdcad2e88e1dbe338272aa0716e0d1afabf45fcd0b3b4d6708563d74118
BLAKE2b-256 checksum
How to use checksums
5163f12c9ddd17b68e715f2a7964a695eda85e121199d23624bdf588f504a138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page