-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c4578c
commit 90cedaa
Showing
8 changed files
with
898 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: test | ||
on: | ||
pull_request: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/system4-tech/task-runner:ubuntu | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- run: make deps | ||
|
||
- name: Check scripts | ||
run: make shellcheck | ||
|
||
- name: Run tests | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
external-sources=true | ||
source-path=SCRIPTDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
all: clean deps shellcheck test build | ||
deps: | ||
@wget https://raw.githubusercontent.com/system4-tech/binance-sh/refs/heads/main/lib/binance.sh -qP lib/ | ||
build: | ||
@awk -f inline.awk src/main.sh > dist/binance-data-downloader.sh | ||
@chmod +x dist/binance-data-downloader.sh | ||
clean: | ||
@rm -f lib/*.sh dist/*.sh | ||
test: | ||
@bats tests/*.bats | ||
shellcheck: | ||
@shellcheck src/*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
# binance-data-downloader | ||
Downloads Binance public market data in various formats (NJSON, CSV and TSV). | ||
# [`binance-data-downloader.sh`](dist/binance-data-downloader.sh) | ||
|
||
This repository contains shell scripts for downloading Binance public market data in various formats (NDJSON, CSV and TSV). | ||
|
||
## Usage | ||
|
||
```sh | ||
$ binance-data-downloader -h | ||
Usage: $0 -p <product> -i <interval> -s <start_time> [-e <end_time>] [-f <format>] [-o <output_dir>] | ||
|
||
Options: | ||
-p Product: spot, um, cm [required] | ||
-i Interval (e.g., 1d, 1h, 15m) [required] | ||
-s Start time [required] | ||
-e End time (default: current time) | ||
-f Output format: csv, tsv, ndjson (default: csv) | ||
-o Output directory (default: current directory) | ||
-h Show this help message | ||
|
||
# Download CSV data for all spot symbols since 2019-01-01 | ||
$ binance-data-downloader.sh -p spot -i 1d -s 2019-01-01 -f csv -o data/spot/ | ||
data/spot/BTCUSDT_2019-01-01_2024-11-29.csv | ||
data/spot/ETHUSDT_2019-01-01_2024-11-29.csv | ||
data/spot/BNBUSDT_2019-01-01_2024-11-29.csv | ||
... | ||
``` | ||
|
||
See [tests](tests/) for more examples. |
Oops, something went wrong.