baostock — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited baostock (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
BAOSTOCK_SERVER_IP:自定义服务器 IP(用于 nginx 代理等场景)BAOSTOCK_SERVER_PORT:服务器端口,默认 10030python scripts/market_data.py --type kline --code sh.600000 --start 2024-01-01 --end 2024-01-31python scripts/financial_data.py --type profit --code sh.600000 --year 2023 --quarter 4python scripts/stock_info.py --type all_stocks --date 2024-01-02python scripts/stock_info.py --type index_stocks --index hs300python scripts/stock_info.py --type industrypython scripts/stock_info.py --type trade_dates --start 2024-01-01 --end 2024-12-31--file 指定代码列表文件--frequency 参数(d/w/m/5/15/30/60)--adjust 参数(1=后复权,2=前复权,3=不复权)python scripts/market_data.py --type kline --code sh.600519 --start 2024-03-01 --end 2024-03-31 --frequency d --adjust 2python scripts/financial_data.py --type profit --code sh.601398 --year 2023 --quarter 4python scripts/stock_info.py --type index_stocks --index hs300python scripts/market_data.py --type kline --code sh.600519,sz.000001,sh.600036 --start 2024-01-01 --end 2024-12-31 --output stocks.csvimport baostock as bs
import pandas as pd
# 登录系统
lg = bs.login()
# 获取日K线数据
rs = bs.query_history_k_data_plus(
"sh.600519",
"date,code,open,high,low,close,volume,amount",
start_date='2024-01-01', end_date='2024-12-31',
frequency="d", adjustflag="2"
)
# 转换为 DataFrame
data_list = []
while (rs.error_code == '0') & rs.next():
data_list.append(rs.get_row_data())
df = pd.DataFrame(data_list, columns=rs.fields)
# 登出系统
bs.logout()| 特性 | baostock | tushare | jqdatasdk | akshare |
|---|---|---|---|---|
| 费用 | 免费 | 免费/付费 | 需注册积分 | 免费 |
| 注册要求 | ❌ 不需要 | ✅ 需要 | ✅ 需要 | ❌ 不需要 |
| 数据范围 | A股为主 | 全面(含宏观) | A股+因子 | 全面(含加密货币) |
| K线数据 | ✅ | ✅ | ✅ | ✅ |
| 财务数据 | ✅ | ✅ | ✅ | ✅ |
| 分钟线 | ✅ | ✅ | ✅ | ✅ |
| 实时行情 | ❌ | ❌ | ❌ | ✅ |
| 特色数据 | 交易日历 | 宏观/Shibor | 因子数据 | 龙虎榜/北向/加密货币 |
bs.login() 即可使用sh.600000(上海)、sz.000001(深圳)、bj.430047(北京)bs.login() 开始、bs.logout() 结束.astype(float) 转换~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.