|
Download README.md from joshuaxql/qlib_data: direct link, hf CLI and curl.
- Browser
- Download file 1.89 kB
-
https://huggingface.co/datasets/joshuaxql/qlib_data/resolve/main/README.md
- Command line
-
hf download hf://datasets/joshuaxql/qlib_data/README.md
-
curl -L -o README.md https://huggingface.co/datasets/joshuaxql/qlib_data/resolve/main/README.md
1.89 kB
| license: mit | |
| language: | |
| - zh | |
| tags: | |
| - finance | |
| - stocks | |
| - time-series | |
| - qlib | |
| # 中国股票量化研究数据 | |
| ## 数据范围 | |
| 数据来源为 Tushare,包含沪深 A 股日线行情、交易日历、历史股票池、行业、股票基础信息和财务数据。 | |
| - 日线交易日:2010-01-04 至 2026-09-30,共 4,067 个交易日。 | |
| - 股票基础信息:5,557 只;日线行情:5,490 只。 | |
| - 财务数据:5,527 只股票,163 项指标。 | |
| - 财务公告日期:2010-04-08 至 2026-09-30。 | |
| - 已公布交易日历延伸至:2027-09-30。 | |
| ## 下载与解压 | |
| 下载 [cn_data.zip](https://huggingface.co/datasets/joshuaxql/qlib_data/resolve/main/cn_data.zip?download=true),解压到 `~/.qlib/qlib_data/`。 | |
| 也可使用 Python 下载并解压: | |
| ```bash | |
| python -m pip install huggingface_hub | |
| ``` | |
| ```python | |
| from pathlib import Path | |
| from zipfile import ZipFile | |
| from huggingface_hub import hf_hub_download | |
| archive = hf_hub_download( | |
| repo_id="joshuaxql/qlib_data", | |
| filename="cn_data.zip", | |
| repo_type="dataset", | |
| ) | |
| destination = Path("~/.qlib/qlib_data").expanduser() | |
| destination.mkdir(parents=True, exist_ok=True) | |
| with ZipFile(archive) as stream: | |
| stream.extractall(destination) | |
| ``` | |
| 解压后的数据根目录为 `~/.qlib/qlib_data/cn_data/`。 | |
| ## 数据目录 | |
| ```text | |
| cn_data/ | |
| ├─ calendars/ # 交易日历 | |
| ├─ features/ # 日线行情与配套字段 | |
| ├─ instruments/ # 全市场、指数成分与特殊处理股票的历史股票池 | |
| ├─ industry/ # 历史行业归属 | |
| ├─ industry_names.json # 行业中文名称 | |
| ├─ financial/ # 财务数据与公告历史 | |
| └─ stock_basic.csv # 股票基础信息 | |
| ``` | |
| 配套代码仓库:[https://github.com/joshuaxql/qlib](https://github.com/joshuaxql/qlib)。 | |