OpenBB 简介
OpenBB 是一个免费且完全开源的金融平台,提供股票、期权、加密货币、外汇、宏观经济、固定收益等多种金融工具的访问权限。
- 官方仓库: GitHub
- 文档手册: Quickstart
- AI Agent: Agents for OpenBB
1. 安装
OpenBB 平台可以通过运行 pip install openbb 作为 PyPI 包安装,或直接克隆仓库。
OpenBB 平台 CLI 安装
OpenBB 平台 CLI 允许您直接从终端访问 OpenBB 平台。
pip install openbb-cli
或克隆仓库:
git clone https://github.com/OpenBB-finance/OpenBB.git
2. 实践
安装 OpenBB 平台
pip install openbb
安装命令行界面
pip install openbb-cli
测试
Python 脚本示例
from openbb import obb
output = obb.equity.price.historical("AAPL")
df = output.to_dataframe()
print(df.head())
输出示例
open high low close volume date
0 0.390000 0.39000 0.38000 0.38000 2024993600 2004-01-02
1 0.380000 0.40000
...


