Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

Project_CandleFetcher

Project_CandleFetcher is a Python 3.12+ project for acquiring, validating, and storing historical candlestick data from multiple venues.

This Hugging Face Dataset repository contains both:

  1. the candlefetcher Python package and its tests/documentation; and
  2. the canonical large candlestick CSV dataset under candleset/.

Repository: https://huggingface.co/datasets/MostafaRoohy/Project_CandleFetcher

Repository layout

Project_CandleFetcher/
├── candlefetcher/          # Python package
│   ├── core/               # Candle, symbol, timeframe, and validation domain types
│   ├── fetcher/            # API and bulk-download acquisition families
│   └── util/               # Shared datetime, HTTP, file, logging, and rate-limit utilities
├── candleset/              # Canonical large CSV dataset
├── test/                   # Test suite
│   └── conftest.py         # Shared pytest configuration/fixtures
├── doc/                    # Project documentation
├── playground/             # Experiments and notebooks
├── plan/                   # Project plans
├── env/                    # Environment configuration
├── AGENTS.md               # Repository-specific engineering rules
└── pyproject.toml

Candle dataset layout

Candle files are stored by exchange, market, symbol, and timeframe:

candleset/
└── <exchange>/
    └── <market>/
        └── <symbol>/
            └── <symbol>_<timeframe>.csv

Example:

candleset/binance/futures/JASMYUSDT/JASMYUSDT_M01.csv

The repository is intended to grow with additional exchanges, markets, symbols, and timeframes while keeping that hierarchy stable unless an exchange requires a documented exception.

Large CSV storage

CSV files are tracked through the Git LFS-compatible filter used by Git-Xet:

*.csv filter=lfs diff=lfs merge=lfs -text

That means Git commits contain small pointer objects for CSV files while Hugging Face stores the actual large-file content through Xet storage.

Git-Xet must be installed and integrated with Git on machines that create or update files under candleset/.

Verify the setup with:

git xet --version
git xet install

After the one-time setup, dataset updates use ordinary Git commands:

git pull
git add .
git commit -m "Update candlestick dataset"
git push

New CSV files and modified CSV files are handled by the same *.csv rule automatically. Do not remove the CSV rule from .gitattributes or intentionally commit large CSV contents as ordinary Git blobs.

Canonical candleset/ CSV schema

The Binance Vision playground publishes the repository's canonical per-symbol/timeframe CSV files with these columns:

timestamp
timehuman_iran
open
high
low
close
volume
quote_volume
trade_count
taker_buy_volume
taker_buy_quote_volume

timestamp is the authoritative Unix timestamp. timehuman_iran is an additional human-readable Asia/Tehran representation and is not the partitioning or ordering authority.

The lower-level Binance Vision downloader temporarily works with a richer internal long-form schema before the playground validates and transforms the data into the canonical candleset/ schema above.

Python package

The package metadata currently defines:

  • package name: candlefetcher
  • Python: >=3.12
  • runtime dependencies: numpy, pandas, aiofiles, curl_cffi

Install the repository in editable mode:

python -m pip install -e .

For the test dependencies:

python -m pip install -e '.[test]'

Run the test suite with:

pytest

Binance Vision example

The project exposes synchronous and asynchronous Binance Vision acquisition helpers. A small synchronous example:

from candlefetcher.fetcher.download.binance_vision import download_binance_vision_candles

result = download_binance_vision_candles(
    symbols    = 'BTCUSDT',
    timeframes = 'M01',
    start      = '2024-01',
    end        = '2024-02',
    market     = 'spot',
    output     = 'file/binance_vision_raw.csv',
)

print(result)

start is inclusive and end is exclusive after request normalization. Friendly YYYY, YYYY-MM, and YYYY-MM-DD bounds are supported by the Binance Vision request model.

Use playground/binance_vision_downloader.ipynb when publishing canonical files into candleset/; the playground performs the additional transformation and structural audit before atomic publication.

Development rules

Read AGENTS.md before modifying the project. It is the repository authority for:

  • architecture and repository layout;
  • mandatory shared utilities;
  • code formatting and docstring conventions;
  • test/documentation expectations;
  • Git authorship and commit policy;
  • handling of candleset/ and Git-Xet-managed CSV files.

Canonical remote

The canonical Git remote is the Hugging Face Dataset repository:

https://huggingface.co/datasets/MostafaRoohy/Project_CandleFetcher

A historical GitHub repository may still exist, but it is not assumed to be synchronized with this repository unless explicitly requested.

Downloads last month
179