OpenFinClaw SDK — Python client & CLI for the DeepAgent API
Project description
OpenFinClaw SDK
AI-powered financial analysis agent. Ask questions in natural language, get professional research reports.
Install
# Recommended (uv)
uv tool install "openfinclaw[cli]"
# Or pip (Python 3.10+, quote the brackets in zsh)
pip install "openfinclaw[cli]"
Update to latest version:
uv cache clean openfinclaw && uv tool install --force "openfinclaw[cli]"
Don't have uv? Install it first:
curl -LsSf https://astral.sh/uv/install.sh | sh
Quick Start
CLI (Interactive Terminal)
openfinclaw-cli
Or ask a single question:
openfinclaw-cli "分析宁德时代的投资价值"
Python SDK (Programmatic)
pip install openfinclaw
from openfinclaw import OpenFinClawClient
client = OpenFinClawClient()
# Create a conversation thread
thread = client.create_thread()
# Stream the response
for event in client.stream(thread.id, "分析宁德时代的投资价值"):
if event.type == "TEXT_DELTA":
print(event.text, end="", flush=True)
Features
- Multi-turn conversations — context is preserved across messages
- Real-time streaming — see the response as it's generated (SSE)
- 58+ financial skills — stock analysis, macro, crypto, derivatives, backtesting, and more
- Multi-agent architecture — specialized agents (analyst, researcher, risk manager, strategist) collaborate on your query
CLI Commands
| Command | Description |
|---|---|
/new |
Create a new conversation thread |
/threads |
List all threads |
/history |
Show message history |
/runs |
Show run history |
/cancel |
Cancel the active run |
/help |
Show available commands |
/quit |
Exit |
SDK API Reference
client = OpenFinClawClient(api_key="your-key", base_url="https://api.openfinclaw.ai/agent")
# Thread management
thread = client.create_thread(title="My Analysis")
threads = client.list_threads()
# Messages & Runs
messages = client.list_messages(thread.id)
runs = client.list_runs(thread.id)
client.cancel_run(thread.id, run.id)
# Streaming (returns Iterator[Event])
for event in client.stream(thread.id, "your question"):
match event.type:
case "TEXT_DELTA": print(event.text) # response text chunk
case "TOOL_START": print(event.tool_name) # tool being called
case "TOOL_DONE": ... # tool finished
case "AGENT_HANDOFF": print(event.agent_name) # agent delegation
case "RUN_FINISHED": ... # done
case "ERROR": print(event.error) # error occurred
Error Handling
from openfinclaw import OpenFinClawClient, RateLimitError, AuthError
client = OpenFinClawClient()
try:
for event in client.stream(thread.id, "question"):
...
except RateLimitError:
print("Daily limit reached (30/day)")
except AuthError:
print("Invalid API key")
Example Use Cases
A-share
You: 300750 宁德时代深度分析 — 固态电池进展和估值
You: 今天A股有哪些热门板块和涨停股?龙虎榜有什么异动?
You: 人形机器人概念还能追吗?当前处于炒作周期的什么阶段?
You: 用双均线策略回测沪深300,过去一年表现如何?
US Stock
You: NVDA 英伟达 Q4 财报分析,AI 算力需求是否见顶?
You: 对比 TSLA vs BYD,谁的估值更有吸引力?
You: 美联储降息周期下,哪些美股板块最受益?
Crypto & Macro
You: BTC 当前处于减半周期的什么阶段?山寨季来了吗?
You: 当前中国宏观经济形势如何?CPI/PPI/PMI 趋势
You: 帮我构建一个攻守兼备的A股ETF组合
Limits
- 30 requests/day per API key
- Beta access expires on the date specified by your key
Links
- Issues & Feedback: GitHub Issues
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 openfinclaw-0.2.3.tar.gz.
File metadata
- Download URL: openfinclaw-0.2.3.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f1114e87e112dc4191652505ea3bb9b48cd0af93abf636e2bdc008a8c1fd156
|
|
| MD5 |
e706742b59b24371050ee8fd8b80e5cd
|
|
| BLAKE2b-256 |
397d733e214388085312797330fffcebb68a3dc3364b5b469533e2d3e34c7b7d
|
File details
Details for the file openfinclaw-0.2.3-py3-none-any.whl.
File metadata
- Download URL: openfinclaw-0.2.3-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c853b4145312ff4c1487c8f3e8df594cd88de20e7d9d859aa5508fe5b8e5df85
|
|
| MD5 |
57b3def9fc9dc2d94a289007280b00b2
|
|
| BLAKE2b-256 |
e2ae6e80741cafaacd4afcf5cc2d19a7d195497673e0ed3a5e9eefa7a8c3044b
|