Skip to content

Commit

Permalink
Merge pull request #25 from aoki-h-jp/release/1.1.0
Browse files Browse the repository at this point in the history
Release/1.1.0
  • Loading branch information
aoki-h-jp authored Jan 4, 2025
2 parents 18dea21 + 4428137 commit ef23648
Show file tree
Hide file tree
Showing 10 changed files with 609 additions and 154 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/Formatter.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9 # 使用するPythonのバージョンを指定してください
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pip install git+https://github.com/aoki-h-jp/binance-bulk-downloader
pipenv install --dev # Pipenvを使用して依存関係をインストール
pipenv install --dev
- name: Run pytest
run: |
pipenv run pytest -v -s # pytestを実行するコマンドを指定
pipenv run pytest -v -s
65 changes: 48 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# binance-bulk-downloader

[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110//)
[![Format code](https://github.com/aoki-h-jp/binance-bulk-downloader/actions/workflows/Formatter.yml/badge.svg?branch=main)](https://github.com/aoki-h-jp/binance-bulk-downloader/actions/workflows/Formatter.yml)
[![pytest](https://github.com/aoki-h-jp/binance-bulk-downloader/actions/workflows/pytest.yaml/badge.svg)](https://github.com/aoki-h-jp/binance-bulk-downloader/actions/workflows/pytest.yaml)
[![Github All Releases](https://img.shields.io/github/downloads/aoki-h-jp/binance-liquidation-feeder/total.svg)]()

## Python library for bulk downloading Binance historical data

A Python library to efficiently and concurrently download historical data files from Binance. Supports all asset types (spot, USDT-M, COIN-M, options) and all data frequencies.

## Installation

```bash
pip install git+https://github.com/aoki-h-jp/binance-bulk-downloader
pip install binance-bulk-downloader
```

## Usage

### Download all klines 1m data (USDT-M futures)

```python
Expand All @@ -32,6 +34,31 @@ downloader = BinanceBulkDownloader(data_frequency='1h', asset='spot')
downloader.run_download()
```

### Download specific symbols only

```python
from binance_bulk_downloader.downloader import BinanceBulkDownloader

# Download single symbol
downloader = BinanceBulkDownloader(
data_type="klines",
data_frequency="1h",
asset="spot",
timeperiod_per_file="daily",
symbols="BTCUSDT",
)
downloader.run_download()

# Download multiple symbols
downloader = BinanceBulkDownloader(
data_type="trades",
asset="spot",
timeperiod_per_file="daily",
symbols=["BTCUSDT", "ETHUSDT"],
)
downloader.run_download()
```

### Download all aggTrades data (USDT-M futures)

```python
Expand All @@ -42,6 +69,7 @@ downloader.run_download()
```

### Other examples

Please see /example directory.

```bash
Expand All @@ -55,25 +83,26 @@ python -m pytest
```

## Available data types

✅: Implemented and tested. ❌: Not available on Binance.

### by data_type

| data_type | spot | um | cm | options |
| :------------------ | :--: | :--: | :--: | :-----: |
| aggTrades |||||
| bookDepth |||||
| bookTicker |||||
| fundingRate |||||
| indexPriceKlines |||||
| klines |||||
| liquidationSnapshot |||||
| markPriceKlines |||||
| metrics |||||
| premiumIndexKlines |||||
| trades |||||
| BVOLIndex |||||
| EOHSummary |||||
| data_type | spot | um | cm | options |
| :------------------ | :--: | :--: | :--: | :-----: |
| aggTrades |||||
| bookDepth |||||
| bookTicker |||||
| fundingRate |||||
| indexPriceKlines |||||
| klines |||||
| liquidationSnapshot |||||
| markPriceKlines |||||
| metrics |||||
| premiumIndexKlines |||||
| trades |||||
| BVOLIndex |||||
| EOHSummary |||||

### by data_frequency (klines, indexPriceKlines, markPriceKlines, premiumIndexKlines)

Expand All @@ -97,9 +126,11 @@ python -m pytest
| 1mo |||||

## If you want to report a bug or request a feature

Please create an issue on this repository!

## Disclaimer

This project is for educational purposes only. You should not construe any such information or other material as legal,
tax, investment, financial, or other advice. Nothing contained here constitutes a solicitation, recommendation,
endorsement, or offer by me or any third party service provider to buy or sell any securities or other financial
Expand Down
1 change: 1 addition & 0 deletions binance_bulk_downloader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
BinanceBulkDownloader: A library to efficiently and concurrently download historical data from Binance.
"""

import binance_bulk_downloader.downloader
import binance_bulk_downloader.exceptions
Loading

0 comments on commit ef23648

Please sign in to comment.