CLI wrapper for Reportify SDK - Access Reportify API through command line
Project description
Reportify API CLI
通过命令行访问 Reportify SDK 的所有功能。
特性
- 🚀 完整功能 - 支持 Reportify SDK 的所有 8 个模块、44+ 个方法
- 📊 多种输出格式 - JSON、Table、CSV、Markdown
- 🎯 简单易用 - 统一的 JSON 输入格式,清晰的帮助文档
- 🤖 AI 友好 - 专为 AI Agent 设计,提供详细的参数说明
安装
# 安装依赖并安装 CLI
make install
# 或使用 uv 直接安装
uv pip install -e .
配置
设置 API Key(必需):
# 方式 1: 环境变量
export REPORTIFY_API_KEY='your-api-key'
# 方式 2: .env 文件
echo "REPORTIFY_API_KEY=your-api-key" > .env
快速开始
# 查看帮助
reportify-cli --help
reportify-cli -h
# 查看模块帮助
reportify-cli docs --help
# 查看命令帮助
reportify-cli docs get --help
# 获取文档详情(JSON 格式)
reportify-cli docs get --input '{"doc_id": "1214713494948155392"}'
# 获取股票行情(Table 格式)
reportify-cli stock quote --input '{"symbol": "600519"}' --format table
# 获取财务数据(Markdown 格式)
reportify-cli stock income_statement \
--input '{"symbol": "600519", "period": "annual"}' \
--format markdown
可用模块
| 模块 | 说明 | 命令数 |
|---|---|---|
search |
文档搜索功能 | 9 |
docs |
文档内容功能 | 4 |
stock |
股票数据功能 | 14 |
timeline |
时间线功能 | 5 |
kb |
知识库功能 | 1 |
user |
用户数据功能 | 1 |
quant |
量化分析功能 | 8 |
concepts |
概念动态功能 | 2 |
输出格式
支持 4 种输出格式:
--format json- JSON 格式(默认)--format table- 表格格式--format csv- CSV 格式--format markdown或--format md- Markdown 表格
开发
# 查看所有可用命令
make help
# 运行测试
make test
# 运行单元测试
make test-unit
# 运行集成测试(需要 API Key)
make test-integration
# 代码格式化
make format
# 代码检查
make lint
# 清理缓存
make clean
# 重新安装
make reinstall
项目结构
reportify-cli/
├── src/ # 源代码
│ ├── main.py # CLI 入口
│ ├── commands/ # 命令模块
│ ├── client.py # SDK 客户端
│ ├── output.py # 输出格式化
│ ├── params.py # 参数定义
│ ├── settings.py # 配置管理
│ └── utils.py # 工具函数
├── tests/ # 测试
│ ├── test_commands/ # 单元测试
│ └── integration/ # 集成测试
├── Makefile # 开发命令
├── pyproject.toml # 项目配置
└── README.md # 项目文档
示例
搜索文档
reportify-cli search query \
--input '{"query": "茅台", "limit": 10}'
获取股票数据
# 公司概览
reportify-cli stock overview --input '{"symbol": "600519"}'
# 财务报表
reportify-cli stock income_statement \
--input '{"symbol": "600519", "period": "annual"}'
# 股价数据
reportify-cli stock prices \
--input '{"symbol": "600519", "start_date": "2024-01-01", "end_date": "2024-12-31"}'
量化分析
# 计算技术指标
reportify-cli quant indicators_compute \
--input '{"symbols": ["600519"], "formula": "RSI(14)"}' \
--format table
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
reportify_cli-0.1.0.tar.gz
(42.1 kB
view details)
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 reportify_cli-0.1.0.tar.gz.
File metadata
- Download URL: reportify_cli-0.1.0.tar.gz
- Upload date:
- Size: 42.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ac3fce409726db3becf2d34e488724ed1cc808eb8e509aaa693e49de976244f
|
|
| MD5 |
b1df5cad5ec9b9cde85b32121c31efe1
|
|
| BLAKE2b-256 |
060803a925f25f67027436d8da94a5d5778571376f2f35f49b2c10473ed1a236
|
File details
Details for the file reportify_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: reportify_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adb8a815789a0a61be8bbb34cd765399b496f2d6e9599793a1c6c193934fed8e
|
|
| MD5 |
8d885c105c6fcf4e98337178d08828be
|
|
| BLAKE2b-256 |
0044411b7679a26b6c407865dfe1da15a76800fa34f5a4fbd559a08f7b39f885
|