Skip to main content

A lightweight package to efficiently download cryptocurrency data using CCXT.

Project description

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 .

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

ccxt_download-0.4.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

ccxt_download-0.4.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file ccxt_download-0.4.1.tar.gz.

File metadata

  • Download URL: ccxt_download-0.4.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for ccxt_download-0.4.1.tar.gz
Algorithm Hash digest
SHA256 fb97237fc0da94cc09df6e29ecd92d7d1e3fbd070f9fa76b6aa1708fd20ec95e
MD5 1b99762f7633a7246e88891a336839a3
BLAKE2b-256 48c1a7fe8079371bc7c4371f26a9a30202c1b2b2137e9b1e691ca5ef889698f5

See more details on using hashes here.

File details

Details for the file ccxt_download-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ccxt_download-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ffe94bdcad2e88e1dbe338272aa0716e0d1afabf45fcd0b3b4d6708563d74118
MD5 a117d8746278ac5a91a99cc364b0255b
BLAKE2b-256 5163f12c9ddd17b68e715f2a7964a695eda85e121199d23624bdf588f504a138

See more details on using hashes here.

Supported by

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