qlib-sync: China A-share data

v0.2.0
io.github.randyy179/qlib-sync Checked 8 hours ago Published 18 days ago

Install, update, and read a local Qlib China A-share daily dataset, with checksums and rollback.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

cn_status

Report the local A-share data's latest trading date, size, and stock pools, and whether the community release has newer data (set offline=True to skip the network check).

ParameterTypeDescription
offlineboolean

cn_update

Install or update the local A-share data from the community release. Returns quickly when already current. Otherwise downloads about 550 MB, checks it with the dataset maintainers' own validator, and swaps it in; this takes roughly a minute. A release that cannot be verified is refused, and on any failure the previous data is restored. The result lists new trading days, listed/delisted symbols, and `verified`.

ParameterTypeDescription
forceboolean

cn_health_check

Validate the local data's structure and perform a real Qlib read; returns ok, errors, checks.

cn_get_prices

Daily bars for up to 20 A-share symbols between start and end (YYYY-MM-DD, inclusive; end defaults to the latest date). fields: any of open, high, low, close, vwap, volume, amount, change, factor (default open, high, low, close, volume, change). change is the daily return as a fraction (0.01 = +1%). price_basis="raw" gives real traded prices and share volume; "adjusted" gives Qlib's split- and dividend-adjusted series. Rows are capped by max_rows.

ParameterTypeDescription
start *string
symbols *array
end
fields
max_rowsinteger
price_basisstring

cn_list_pool

Members of a stock pool on a date (default: the latest date). Pools: all, csi100, csi300, csi500, csi800, csi1000, csiall, plus any local pools; cn_status lists what exists.

ParameterTypeDescription
date
poolstring