A fast CLI tool for real-time stock data
Project description
agent-stock
面向 AI Agent 的股市数据命令行工具,提供市场概览、个股行情、板块涨跌、技术指标与资金流向等信息。
安装
# pipx
pipx install agent-stock # 安装
pipx upgrade agent-stock # 升级
# uv tool
uv tool install agent-stock # 安装
uv tool upgrade agent-stock # 升级
# pip
python -m pip install agent-stock # 安装
python -m pip install -U agent-stock # 升级
快速开始
# 市场数据
stock search 腾讯
stock chgdiagram --market ab
stock heatmap --market ab
stock rank --count 20
# 个股数据
stock quote 000001
stock quote 000001,600519
stock kline 000001
stock fundflow 000001
# 帮助与版本
stock --help
stock quote --help
stock -v
命令
可以通过 stock --help 或 stock <子命令> --help 查看帮助。
市场数据
stock index --market <market> # 大盘主要指数总览
stock chgdiagram --market <market> # 涨跌分布
stock heatmap --market <market> # 行业板块热力图
stock search <keyword> # 股票搜索
stock query <condition> # 条件选股
stock rank --sort <sort> --count <count> # 市场排序(仅 A 股)
参数说明:
- market: 市场,可选 ab|us|hk,默认 ab
- sort: 排序类型,可选 turnover|amplitude|volumeRatio|exchange|priceRatio,默认 turnover
- count: 排序数量,默认 20,取值范围 1 - 100
- keyword: 关键词,示例:腾讯、tengxun等
- condition: 自然语言的条件语句,示例:"MACD金叉;KDJ金叉;非ST;非涨停;市盈率大于0;市盈率小于100;市值大于50亿;"
个股数据
stock quote <symbols> # 个股实时行情(支持批量查询)
stock plate <symbol> # 个股相关板块涨跌幅(地域/行业/概念)
stock news <symbol> # 个股最新资讯
stock kline <symbol> # 日K数据以及技术指标(EMA/BOLL/KDJ/RSI)
stock fundflow <symbol> # 资金分布与每日主力/散户净流向
参数说明:
- symbol: 股票代码,支持 A 股、港股、美股
- A股:6 位数字,如 600519、000001
- 港股:5 位数字,如 00700
- 美股:us.,如 us.aapl、us.msft(大小写不敏感)
- symbols: 单个或多个股票代码,用逗号分隔,如 000001,00700,us.aapl
开发
# 安装依赖
uv sync
# 运行测试
uv run pytest tests/ -v
# Lint
uv run ruff check .
# 安装当前目录源码,并暴露 `stock` 命令
uv tool install --from . agent-stock
# 强制升级
uv tool install --from . agent-stock --force --reinstall --refresh --no-cache
# 卸载
uv tool uninstall agent-stock
# 调试
uv run python -m stock quote 000001
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_stock-0.1.5.tar.gz.
File metadata
- Download URL: agent_stock-0.1.5.tar.gz
- Upload date:
- Size: 49.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ad972d9a51ee3abb9c6f70107e6a42abfebbcc81d7cacab7e640537dfd423fa
|
|
| MD5 |
f300abbc14ba89eb8899937966131aa4
|
|
| BLAKE2b-256 |
fb556bab2df95879ac9437b472edbb606ce04fc12c5f80784b7e4ca9632cf054
|
Provenance
The following attestation bundles were made for agent_stock-0.1.5.tar.gz:
Publisher:
publish.yml on AnoyiX/agent-stock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_stock-0.1.5.tar.gz -
Subject digest:
2ad972d9a51ee3abb9c6f70107e6a42abfebbcc81d7cacab7e640537dfd423fa - Sigstore transparency entry: 1185481440
- Sigstore integration time:
-
Permalink:
AnoyiX/agent-stock@92f95d7a2c7da1fe2f21f79c9ddefffed190a9c6 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/AnoyiX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92f95d7a2c7da1fe2f21f79c9ddefffed190a9c6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_stock-0.1.5-py3-none-any.whl.
File metadata
- Download URL: agent_stock-0.1.5-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0acedbf36597bad19fb9b139395d75318da8b425dbe840e1079921a9be130c3d
|
|
| MD5 |
1d59939afe34312b428bb5162f69bc4e
|
|
| BLAKE2b-256 |
64b417ec5aeab4c74f09dcce70128f64e1da56816c285868e791ee391f6aa109
|
Provenance
The following attestation bundles were made for agent_stock-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on AnoyiX/agent-stock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_stock-0.1.5-py3-none-any.whl -
Subject digest:
0acedbf36597bad19fb9b139395d75318da8b425dbe840e1079921a9be130c3d - Sigstore transparency entry: 1185481465
- Sigstore integration time:
-
Permalink:
AnoyiX/agent-stock@92f95d7a2c7da1fe2f21f79c9ddefffed190a9c6 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/AnoyiX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92f95d7a2c7da1fe2f21f79c9ddefffed190a9c6 -
Trigger Event:
push
-
Statement type: