## Introduction
[![Python Version](https://img.shields.io/badge/python-3.6+-blue.svg?style=flat)](https://pypi.python.org/pypi/efinance)
[![Pypi Package](https://img.shields.io/pypi/v/efinance.svg?maxAge=60)](https://pypi.python.org/pypi/efinance)
[![Pypi-Install](https://img.shields.io/pypi/dm/efinance.svg?maxAge=2592000&label=installs&color=%2327B1FF)](https://pypi.python.org/pypi/efinance)
[![Docs](https://readthedocs.org/projects/efinance/badge/?version=latest)](https://efinance.readthedocs.io)
[![CodeFactor](https://www.codefactor.io/repository/github/micro-sheep/efinance/badge)](https://www.codefactor.io/repository/github/micro-sheep/efinance/overview/main)
[![Github Stars](https://img.shields.io/github/stars/Micro-sheep/efinance.svg?style=social&label=Star&maxAge=60)](https://github.com/Micro-sheep/efinance)
[`efinance`](https://github.com/Micro-sheep/efinance) 是由个人打造的用于获取股票、基金、期货数据的免费开源 Python 库,你可以使用它很方便地获取数据以便更好地服务于个人的交易系统需求。
- [`Source Code`](https://github.com/Micro-sheep/efinance)
- [`Docs`](https://efinance.readthedocs.io)
- [`Changelog`](https://github.com/Micro-sheep/efinance/blob/main/changelog.md)
---
## Installation
- 通过 `pip` 安装
```bash
pip install efinance
```
- 通过 `pip` 更新
```bash
pip install efinance --upgrade
```
- 通过 `docker` 安装
```bash
# 克隆代码
git clone https://github.com/Micro-sheep/efinance
# 切换工作目录为该项目的根目录
cd efinance
# 构建镜像(-t 指定构建后生成的镜像名称 . 指定 build 的对象是当前工作目录下的 dockerfile)
docker build -t efinance . --no-cache
# 以交互的方式运行镜像(运行之后自动删除容器,如不想删除 则可去掉 --rm)
docker run --rm -it efinance
```
- 源码安装(用于开发)
```bash
git clone https://github.com/Micro-sheep/efinance
cd efinance
pip install -e .
```
---
## Examples
### Stock
- 获取股票历史日 K 线数据
```python
>>> import efinance as ef
>>> # 股票代码
>>> stock_code = '600519'
>>> ef.stock.get_quote_history(stock_code)
股票名称 股票代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 贵州茅台 600519 2001-08-27 -89.74 -89.53 -89.08 -90.07 406318.0 1.410347e+09 -1.10 0.92 0.83 56.83
1 贵州茅台 600519 2001-08-28 -89.64 -89.27 -89.24 -89.72 129647.0 4.634630e+08 -0.54 0.29 0.26 18.13
2 贵州茅台 600519 2001-08-29 -89.24 -89.36 -89.24 -89.42 53252.0 1.946890e+08 -0.20 -0.10 -0.09 7.45
3 贵州茅台 600519 2001-08-30 -89.38 -89.22 -89.14 -89.44 48013.0 1.775580e+08 -0.34 0.16 0.14 6.72
4 贵州茅台 600519 2001-08-31 -89.21 -89.24 -89.12 -89.28 23231.0 8.623100e+07 -0.18 -0.02 -0.02 3.25
... ... ... ... ... ... ... ... ... ... ... ... ... ...
4756 贵州茅台 600519 2021-07-23 1937.82 1900.00 1937.82 1895.09 47585.0 9.057762e+09 2.20 -2.06 -40.01 0.38
4757 贵州茅台 600519 2021-07-26 1879.00 1804.11 1879.00 1780.00 98619.0 1.789436e+10 5.21 -5.05 -95.89 0.79
4758 贵州茅台 600519 2021-07-27 1803.00 1712.89 1810.00 1703.00 86577.0 1.523081e+10 5.93 -5.06 -91.22 0.69
4759 贵州茅台 600519 2021-07-28 1703.00 1768.90 1788.20 1682.12 85369.0 1.479247e+10 6.19 3.27 56.01 0.68
4760 贵州茅台 600519 2021-07-29 1810.01 1740.00 1823.00 1734.34 51035.0 9.067345e+09 5.01 -1.63 -28.90 0.41
[4761 rows x 13 columns]
```
- 获取非 A 股的股票 K 线数据(支持输入股票名称以及代码)
```python
>>> import efinance as ef
>>> # 股票代码
>>> stock_code = 'AAPL'
>>> ef.stock.get_quote_history(stock_code)
股票名称 股票代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 苹果 AAPL 1984-09-07 -5.37 -5.37 -5.36 -5.37 2981600.0 0.000000e+00 0.00 0.00 0.00 0.02
1 苹果 AAPL 1984-09-10 -5.37 -5.37 -5.36 -5.37 2346400.0 0.000000e+00 -0.19 0.00 0.00 0.01
2 苹果 AAPL 1984-09-11 -5.36 -5.36 -5.36 -5.36 5444000.0 0.000000e+00 0.00 0.19 0.01 0.03
3 苹果 AAPL 1984-09-12 -5.36 -5.37 -5.36 -5.37 4773600.0 0.000000e+00 -0.19 -0.19 -0.01 0.03
4 苹果 AAPL 1984-09-13 -5.36 -5.36 -5.36 -5.36 7429600.0 0.000000e+00 0.00 0.19 0.01 0.04
... ... ... ... ... ... ... ... ... ... ... ... ... ...
8739 苹果 AAPL 2021-07-22 145.94 146.80 148.19 145.81 77338156.0 1.137623e+10 1.64 0.96 1.40 0.47
8740 苹果 AAPL 2021-07-23 147.55 148.56 148.72 146.92 71447416.0 1.058233e+10 1.23 1.20 1.76 0.43
8741 苹果 AAPL 2021-07-26 148.27 148.99 149.83 147.70 72434089.0 1.080774e+10 1.43 0.29 0.43 0.44
8742 苹果 AAPL 2021-07-27 149.12 146.77 149.21 145.55 104818578.0 1.540140e+10 2.46 -1.49 -2.22 0.63
8743 苹果 AAPL 2021-07-28 144.81 144.98 146.97 142.54 118931191.0 1.723188e+10 3.02 -1.22 -1.79 0.72
[8744 rows x 13 columns]
>>> # 股票名称
>>> stock_name = '微软'
>>> ef.stock.get_quote_history(stock_name)
股票名称 股票代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 微软 MSFT 1986-03-13 -20.74 -20.73 -20.73 -20.74 1.031789e+09 0.000000e+00 0.00 0.00 0.00 13.72
1 微软 MSFT 1986-03-14 -20.73 -20.73 -20.73 -20.73 3.081600e+08 0.000000e+00 0.00 0.00 0.00 4.10
2 微软 MSFT 1986-03-17 -20.73 -20.73 -20.73 -20.73 1.331712e+08 0.000000e+00 0.00 0.00 0.00 1.77
3 微软 MSFT 1986-03-18 -20.73 -20.73 -20.73 -20.73 6.776640e+07 0.000000e+00 0.00 0.00 0.00 0.90
4 微软 MSFT 1986-03-19 -20.73 -20.73 -20.73 -20.73 4.789440e+07 0.000000e+00 0.00 0.00 0.00 0.64
... ... ... ... ... ... ... ... ... ... ... ... ... ...
8357 微软 MSFT 2021-07-22 283.84 286.14 286.42 283.42 2.338406e+07 6.677062e+09 1.07 1.68 4.74 0.31
8358 微软 MSFT 2021-07-23 287.37 289.67 289.99 286.50 2.276807e+07 6.578686e+09 1.22 1.23 3.53 0.30
8359 微软 MSFT 2021-07-26 289.00 289.05 289.69 286.64 2.317607e+07 6.685868e+09 1.05 -0.21 -0.62 0.31
8360 微软 MSFT 2021-07-27 289.43 286.54 289.58 282.95 3.360407e+07 9.599993e+09 2.29 -0.87 -2.51 0.45
8361 微软 MSFT 2021-07-28 288.99 286.22 290.15 283.83 3.356685e+07 9.638499e+09 2.21 -0.11 -0.32 0.45
[8362 rows x 13 columns]
```
- 获取 ETF K 线数据
```python
>>> import efinance as ef
>>> # ETF 代码(以中概互联网 ETF 为例)
>>> etf_code = '513050'
>>> ef.stock.get_quote_history(etf_code)
股票名称 股票代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 中概互联网ETF 513050 2017-01-18 0.989 0.977 0.989 0.969 345605.0 3.381795e+07 0.00 0.00 0.000 0.26
1 中概互联网ETF 513050 2017-01-19 0.978 0.989 0.990 0.978 257716.0 2.542553e+07 1.23 1.23 0.012 0.19
2 中概互联网ETF 513050 2017-01-20 0.989 0.988 0.990 0.986 50980.0 5.043289e+06 0.40 -0.10 -0.001 0.04
3 中概互联网ETF 513050 2017-01-23 0.988 0.988 0.989 0.986 13739.0 1.356129e+06 0.30 0.00 0.000 0.01
4 中概互联网ETF 513050 2017-01-24 0.989 0.989 0.992 0.987 17937.0 1.774398e+06 0.51 0.10 0.001 0.01
... ... ... ... ... ... ... ... ... ... ... ... ... ...
1097 中概互联网ETF 513050 2021-07-23 1.789 1.760 1.789 1.758 4427623.0 7.836530e+08 1.73 -1.51 -0.027 3.32
1098 中概互联网ETF 513050 2021-07-26 1.679 1.645 1.698 1.642 13035366.0 2.182816e+09 3.18 -6.53 -0.115 9.78
1099 中概互联网ETF 513050 2021-07-27 1.600 1.547 1.620 1.546 14269546.0 2.257610e+09 4.50 -5.96 -0.098 10.70
1100 中概互联网ETF 513050 2021-07-28 1.545 1.552 1.578 1.506 13141023.0 2.024106e+09 4.65 0.32 0.005 9.85
1101 中概互联网ETF 513050 2021-07-29 1.615 1.641 1.651 1.606 10658041.0 1.734404e+09 2.90 5.73 0.089 7.99
[1102 rows x 13 columns]
```
- 获取单只股票 5 分钟 K 线数据
```python
>>> import efinance as ef
>>> # 股票代码
>>> stock_code = '600519'
>>> # 5 分钟
>>> frequency = 5
>>> ef.stock.get_quote_history(stock_code, klt=frequency)
股票名称 股票代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 贵州茅台 600519 2021-06-16 09:35 2172.71 2159.71 2175.71 2150.74 1885.0 411159309.0 1.15 -0.64 -14.00 0.02
1 贵州茅台 600519 2021-06-16 09:40 2156.69 2148.71 2160.48 2143.37 1238.0 268790684.0 0.79 -0.51 -11.00 0.01
2 贵州茅台 600519 2021-06-16 09:45 2149.79 2159.71 2160.69 2149.79 706.0 153631002.0 0.51 0.51 11.00 0.01
3 贵州茅台 600519 2021-06-16 09:50 2159.61 2148.87 2159.71 2148.87 586.0 127346502.0 0.50 -0.50 -10.84 0.00
4 贵州茅台 600519 2021-06-16 09:55 2148.87 2161.04 2163.71 2148.72 788.0 171491075.0 0.70 0.57 12.17 0.01
... ... ... ... ... ... ... ... ... ... ... ... ... ...
1521 贵州茅台 600519 2021-07-29 13:50 1746.51 1746.09 1748.95 1746.01 738.0 128889575.0 0.17 -0.09 -1.49 0.01
1522 贵州茅台 600519 2021-07-29 13:55 1746.08 1742.01 1746.09 1741.96 831.0 144968679.0 0.24 -0.23 -4.08 0.01
1523 贵州茅台 600519 2021-07-29 14:00 1742.00 1739.58 1742.00 1739.58 864.0 150446840.0 0.14 -0.14 -2.43 0.01
1524 贵州茅台 600519 2021-07-29 14:05 1741.87 1740.00 1745.00 1738.88 1083.0 188427970.0 0.35 0.02 0.42 0.01
1525 贵州茅台 600519 2021-07-29 14:10 1740.00 1740.02 1740.10 1740.00 59.0 10315488.0 0.01 0.00 0.02 0.00
[1526 rows x 13 columns]
```
- 沪深市场 A 股最新状况
```python
>>> import efinance as ef
>>> ef.stock.get_realtime_quotes()
股票代码 股票名称 涨跌幅 最新价 最高 最低 今开 涨跌额 换手率 量比 动态市盈率 成交量 成交额 昨日收盘 总市值 流通市值 行情ID 市场类型
0 688787 N海天 277.59 139.48 172.39 139.25 171.66 102.54 85.62 - 78.93 74519 1110318832.0 36.94 5969744000 1213908667 1.688787 沪A
1 301045 N天禄 149.34 39.42 48.95 39.2 48.95 23.61 66.66 - 37.81 163061 683878656.0 15.81 4066344240 964237089 0.301045 深A
2 300532 今天国际 20.04 12.16 12.16 10.69 10.69 2.03 8.85 3.02 -22.72 144795 171535181.0 10.13 3322510580 1989333440 0.300532 深A
3 300600 国瑞科技 20.02 13.19 13.19 11.11 11.41 2.2 18.61 2.82 218.75 423779 541164432.0 10.99 3915421427 3003665117 0.300600 深A
4 300985 致远新能 20.01 47.08 47.08 36.8 39.4 7.85 66.65 2.17 58.37 210697 897370992.0 39.23 6277336472 1488300116 0.300985 深A
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
4598 603186 华正新材 -10.0 43.27 44.09 43.27 43.99 -4.81 1.98 0.48 25.24 27697 120486294.0 48.08 6146300650 6063519472 1.603186 沪A
4599 688185 康希诺-U -10.11 476.4 534.94 460.13 530.0 -53.6 6.02 2.74 -2088.07 40239 1960540832.0 530.0 117885131884 31831479215 1.688185 沪A
4600 688148 芳源股份 -10.57 31.3 34.39 31.3 33.9 -3.7 26.07 0.56 220.01 188415 620632512.0 35.0 15923562000 2261706043 1.688148 沪A
4601 300034 钢研高纳 -10.96 43.12 46.81 42.88 46.5 -5.31 7.45 1.77 59.49 323226 1441101824.0 48.43 20959281094 18706911861 0.300034 深A
4602 300712 永福股份 -13.71 96.9 110.94 95.4 109.0 -15.4 6.96 1.26 511.21 126705 1265152928.0 112.3 17645877600 17645877600 0.300712 深A
[4603 rows x 18 columns]
```
- 股票龙虎榜
```python
>>> import efinance as ef
>>> # 获取最新一个公开的龙虎榜数据(后面还有获取指定日期区间的示例代码)
>>> ef.stock.get_daily_billboard()
股票代码 股票名称 上榜日期 解读 收盘价 涨跌幅 换手率 龙虎榜净买额 龙虎榜买入额 龙虎榜卖出额 龙虎榜成交额 市场总成交额 净买额占总成交比 成交额占总成交比 流通市值 上榜原因
0 000608 阳光股份 2021-08-27 卖一主卖,成功率48.36% 3.73 -9.9034 3.8430 -8.709942e+06 1.422786e+07 2.293780e+07 3.716565e+07 110838793 -7.858208 33.531268 2.796761e+09 日跌幅偏离值达到7%的前5只证券
1 000751 锌业股份 2021-08-27 主力做T,成功率18.84% 5.32 -2.9197 19.6505 -1.079219e+08 5.638899e+07 1.643109e+08 2.206999e+08 1462953973 -7.376984 15.085906 7.500502e+09 日振幅值达到15%的前5只证券
2 000762 西藏矿业 2021-08-27 北京资金买入,成功率39.42% 63.99 1.0741 15.6463 2.938758e+07 4.675541e+08 4.381665e+08 9.057206e+08 4959962598 0.592496 18.260633 3.332571e+10 日振幅值达到15%的前5只证券
3 000833 粤桂股份 2021-08-27 实力游资买入,成功率44.55% 8.87 10.0496 8.8263 4.993555e+07 1.292967e+08 7.936120e+07 2.086580e+08 895910429 5.573721 23.290046 3.353614e+09 连续三个交易日内,涨幅偏离值累计达到20%的证券
4 001208 华菱线缆 2021-08-27 1家机构买入,成功率40.43% 19.72 4.3386 46.1985 4.055258e+07 1.537821e+08 1.132295e+08 2.670117e+08 1203913048 3.368398 22.178651 2.634710e+09 日换手率达到20%的前5只证券
.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
70 688558 国盛智科 2021-08-27 买一主买,成功率38.71% 60.72 1.6064 34.0104 1.835494e+07 1.057779e+08 8.742293e+07 1.932008e+08 802569300 2.287023 24.072789 2.321743e+09 有价格涨跌幅限制的日换手率达到30%的前五只证券
71 688596 正帆科技 2021-08-27 1家机构买入,成功率57.67% 26.72 3.1660 3.9065 -1.371039e+07 8.409046e+07 9.780085e+07 1.818913e+08 745137400 -1.839982 24.410438 4.630550e+09 有价格涨跌幅限制的连续3个交易日内收盘价格涨幅偏离值累计达到30%的证券
72 688663 新风光 2021-08-27 卖一主卖,成功率37.18% 28.17 -17.6316 32.2409 1.036460e+07 5.416901e+07 4.380440e+07 9.797341e+07 274732700 3.772613 35.661358 8.492507e+08 有价格涨跌幅限制的日收盘价格跌幅达到15%的前五只证券
73 688663 新风光 2021-08-27 卖一主卖,成功率37.18% 28.17 -17.6316 32.2409 1.036460e+07 5.416901e+07 4.380440e+07 9.797341e+07 274732700 3.772613 35.661358 8.492507e+08 有价格涨跌幅限制的日换手率达到30%的前五只证券
74 688667 菱电电控 2021-08-27 1家机构卖出,成功率49.69% 123.37 -18.8996 17.7701 -2.079877e+06 4.611216e+07 4.819204e+07 9.430420e+07 268503400 -0.774618 35.122163 1.461225e+09 有价格涨跌幅限制的日收盘价格跌幅达到15%的前五只证券
[75 rows x 16 columns]
>>> # 获取指定日期区间的龙虎榜数据
>>> start_date = '2021-08-20' # 开始日期
>>> end_date = '2021-08-27' # 结束日期
>>> ef.stock.get_daily_billboard(start_date = start_date,end_date = end_date)
股票代码 股票名称 上榜日期 解读 收盘价 涨跌幅 换手率 龙虎榜净买额 龙虎榜买入额 龙虎榜卖出额 龙虎榜成交额 市场总成交额 净买额占总成交比 成交额占总成交比 流通市值 上榜原因
0 000608 阳光股份 2021-08-27 卖一主卖,成功率48.36% 3.73 -9.9034 3.8430 -8.709942e+06 1.422786e+07 2.293780e+07 3.716565e+07 110838793 -7.858208 33.531268 2.796761e+09 日跌幅偏离值达到7%的前5只证券
1 000751 锌业股份 2021-08-27 主力做T,成功率18.84% 5.32 -2.9197 19.6505 -1.079219e+08 5.638899e+07 1.643109e+08 2.206999e+08 1462953973 -7.376984 15.085906 7.500502e+09 日振幅值达到15%的前5只证券
2 000762 西藏矿业 2021-08-27 北京资金买入,成功率39.42% 63.99 1.0741 15.6463 2.938758e+07 4.675541e+08 4.381665e+08 9.057206e+08 4959962598 0.592496 18.260633 3.332571e+10 日振幅值达到15%的前5只证券
3 000833 粤桂股份 2021-08-27 实力游资买入,成功率44.55% 8.87 10.0496 8.8263 4.993555e+07 1.292967e+08 7.936120e+07 2.086580e+08 895910429 5.573721 23.290046 3.353614e+09 连续三个交易日内,涨幅偏离值累计达到20%的证券
4 001208 华菱线缆 2021-08-27 1家机构买入,成功率40.43% 19.72 4.3386 46.1985 4.055258e+07 1.537821e+08 1.132295e+08 2.670117e+08 1203913048 3.368398 22.178651 2.634710e+09 日换手率达到20%的前5只证券
.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
414 605580 恒盛能源 2021-08-20 买一主买,成功率33.33% 13.28 10.0249 0.4086 2.413149e+06 2.713051e+06 2.999022e+05 3.012953e+06 2713051 88.945937 111.054054 6.640000e+08 有价格涨跌幅限制的日收盘价格涨幅偏离值达到7%的前三只证券
415 688029 南微医学 2021-08-20 4家机构卖出,成功率55.82% 204.61 -18.5340 8.1809 -1.412053e+08 1.883342e+08 3.295394e+08 5.178736e+08 762045800 -18.529760 67.958326 9.001510e+09 有价格涨跌幅限制的日收盘价格跌幅达到15%的前五只证券
416 688408 中信博 2021-08-20 4家机构卖出,成功率47.86% 179.98 -0.0666 15.3723 -4.336304e+07 3.750919e+08 4.184550e+08 7.935469e+08 846547400 -5.122340 93.739221 5.695886e+09 有价格涨跌幅限制的日价格振幅达到30%的前五只证券
417 688556 高测股份 2021-08-20 上海资金买入,成功率60.21% 51.97 17.0495 10.6452 -3.940045e+07 1.642095e+08 2.036099e+08 3.678194e+08 575411600 -6.847351 63.922831 5.739089e+09 有价格涨跌幅限制的日收盘价格涨幅达到15%的前五只证券
418 688636 智明达 2021-08-20 2家机构买入,成功率47.37% 161.90 15.8332 11.9578 2.922406e+07 6.598126e+07 3.675721e+07 1.027385e+08 188330100 15.517464 54.552336 1.647410e+09 有价格涨跌幅限制的日收盘价格涨幅达到15%的前五只证券
[418 rows x 16 columns]
```
- 沪深 A 股股票季度表现
```python
>>> import efinance as ef
>>> ef.stock.get_all_company_performance() # 默认为最新季度,亦可指定季度
股票代码 股票简称 公告日期 营业收入 营业收入同比增长 营业收入季度环比 净利润 净利润同比增长 净利润季度环比 每股收益 每股净资产 净资产收益率 销售毛利率 每股经营现金流量
0 688981 中芯国际 2021-08-28 00:00:00 1.609039e+10 22.253453 20.6593 5.241321e+09 278.100000 307.8042 0.6600 11.949525 5.20 26.665642 1.182556
1 688819 天能股份 2021-08-28 00:00:00 1.625468e+10 9.343279 23.9092 6.719446e+08 -14.890000 -36.8779 0.7100 11.902912 6.15 17.323263 -1.562187
2 688789 宏华数科 2021-08-28 00:00:00 4.555604e+08 56.418441 6.5505 1.076986e+08 49.360000 -7.3013 1.8900 14.926761 13.51 43.011243 1.421272
3 688681 科汇股份 2021-08-28 00:00:00 1.503343e+08 17.706987 121.9407 1.664509e+07 -13.100000 383.3331 0.2100 5.232517 4.84 47.455511 -0.232395
4 688670 金迪克 2021-08-28 00:00:00 3.209423e+07 -63.282413 -93.1788 -2.330505e+07 -242.275001 -240.1554 -0.3500 3.332254 -10.10 85.308531 1.050348
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
3720 600131 国网信通 2021-07-16 00:00:00 2.880378e+09 6.787087 69.5794 2.171389e+08 29.570000 296.2051 0.1800 4.063260 4.57 19.137437 -0.798689
3721 600644 乐山电力 2021-07-15 00:00:00 1.257030e+09 18.079648 5.7300 8.379727e+07 -14.300000 25.0007 0.1556 3.112413 5.13 23.645137 0.200906
3722 002261 拓维信息 2021-07-15 00:00:00 8.901777e+08 47.505282 24.0732 6.071063e+07 68.320000 30.0596 0.0550 2.351598 2.37 37.047968 -0.131873
3723 601952 苏垦农发 2021-07-13 00:00:00 4.544138e+09 11.754570 47.8758 3.288132e+08 1.460000 83.1486 0.2400 3.888046 6.05 15.491684 -0.173772
3724 601568 北元集团 2021-07-09 00:00:00 6.031506e+09 32.543303 30.6352 1.167989e+09 61.050000 40.8165 0.3200 3.541533 9.01 27.879243 0.389860
[3725 rows x 14 columns]
```
- 股票历史单子流入数据(日级)
```python
>>> import efinance as ef
>>> ef.stock.get_history_bill('300750')
股票名称 股票代码 日期 主力净流入 小单净流入 中单净流入 大单净流入 超大单净流入 主力净流入占比 小单流入净占比 中单流入净占比 大单流入净占比 超大单流入净占比 收盘价 涨跌幅
0 宁德时代 300750 2021-03-18 4.453786e+07 51241536.0 -9.577939e+07 -26680704.0 71218560.0 1.16 1.33 -2.49 -0.69 1.85 335.56 0.84
1 宁德时代 300750 2021-03-19 -6.129661e+08 423235296.0 1.897308e+08 -244136864.0 -368829200.0 -10.13 6.99 3.14 -4.03 -6.09 316.26 -5.75
2 宁德时代 300750 2021-03-22 -5.674665e+08 473253808.0 9.421272e+07 -255868192.0 -311598336.0 -7.95 6.63 1.32 -3.58 -4.37 307.56 -2.75
3 宁德时代 300750 2021-03-23 -3.168412e+08 131142880.0 1.856984e+08 -349417168.0 32575936.0 -6.88 2.85 4.03 -7.59 0.71 303.67 -1.26
4 宁德时代 300750 2021-03-24 -5.999049e+08 371268928.0 2.286360e+08 -6849616.0 -593055328.0 -8.18 5.06 3.12 -0.09 -8.09 288.55 -4.98
.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
97 宁德时代 300750 2021-08-09 -1.152779e+09 -596512.0 1.153376e+09 -370189552.0 -782589456.0 -12.09 -0.01 12.10 -3.88 -8.21 516.00 -5.13
98 宁德时代 300750 2021-08-10 -1.009431e+09 -358999.0 1.009790e+09 -392670720.0 -616759952.0 -11.03 -0.00 11.03 -4.29 -6.74 510.50 -1.07
99 宁德时代 300750 2021-08-11 1.305631e+08 -475792.0 -1.300873e+08 -204097776.0 334660864.0 2.25 -0.01 -2.25 -3.52 5.78 517.25 1.32
100 宁德时代 300750 2021-08-12 -1.425337e+09 -488240.0 1.425825e+09 -454688192.0 -970648896.0 -16.58 -0.01 16.58 -5.29 -11.29 502.00 -2.95
101 宁德时代 300750 2021-08-13 -3.111439e+08 -895641.0 3.120392e+08 -145200128.0 -165943808.0 -2.21 -0.01 2.22 -1.03 -1.18 502.05 0.01
[102 rows x 15 columns]
```
- 股票最新一个交易日单子流入数据(分钟级)
```python
>>> import efinance as ef
>>> ef.stock.get_today_bill('300750')
股票名称 股票代码 时间 主力净流入 小单净流入 中单净流入 大单净流入 超大单净流入
0 宁德时代 300750 2021-08-13 09:31 -58855676.0 -171274.0 59026945.0 22025460.0 -80881136.0
1 宁德时代 300750 2021-08-13 09:32 -50671227.0 -190312.0 50861534.0 8927176.0 -59598403.0
2 宁德时代 300750 2021-08-13 09:33 -67833979.0 -190312.0 68024288.0 34170593.0 -102004572.0
3 宁德时代 300750 2021-08-13 09:34 -28890553.0 -220312.0 29110861.0 16373829.0 -45264382.0
4 宁德时代 300750 2021-08-13 09:35 -14955904.0 -482660.0 15438561.0 14601153.0 -29557057.0
.. ... ... ... ... ... ... ... ...
235 宁德时代 300750 2021-08-13 14:56 -311695708.0 -895633.0 312591337.0 -144447542.0 -167248166.0
236 宁德时代 300750 2021-08-13 14:57 -310641455.0 -895633.0 311537085.0 -144697852.0 -165943603.0
237 宁德时代 300750 2021-08-13 14:58 -311143584.0 -895633.0 312039214.0 -145199981.0 -165943603.0
238 宁德时代 300750 2021-08-13 14:59 -311143584.0 -895633.0 312039214.0 -145199981.0 -165943603.0
239 宁德时代 300750 2021-08-13 15:00 -311143584.0 -895633.0 312039214.0 -145199981.0 -165943603.0
[240 rows x 8 columns]
```
### Fund
- 获取基金历史净值信息
```python
>>> import efinance as ef
>>> ef.fund.get_quote_history('161725')
日期 单位净值 累计净值 涨跌幅
0 2021-07-29 1.2726 2.9037 -1.52
1 2021-07-28 1.2922 2.9233 0.85
2 2021-07-27 1.2813 2.9124 -3.6
3 2021-07-26 1.3292 2.9603 -7.24
4 2021-07-23 1.4329 3.0640 -2.29
... ... ... ... ...
1502 2015-06-08 1.0380 1.0380 2.5692
1503 2015-06-05 1.0120 1.0120 1.5045
1504 2015-06-04 0.9970 0.9970 --
1505 2015-05-29 0.9950 0.9950 --
1506 2015-05-27 1.0000 1.0000 --
[1507 rows x 4 columns]
```
- 获取基金公开持仓信息
```python
>>> import efinance as ef
>>> # 获取最新公开的持仓数据
>>> ef.fund.get_invest_position('161725')
基金代码 股票代码 股票简称 持仓占比 较上期变化 公开日期
0 161725 600519 贵州茅台 16.78 1.36 2022-03-31
1 161725 600809 山西汾酒 15.20 0.52 2022-03-31
2 161725 000568 泸州老窖 14.57 -0.89 2022-03-31
3 161725 000858 五粮液 12.83 -1.26 2022-03-31
4 161725 002304 洋河股份 11.58 0.91 2022-03-31
5 161725 603369 今世缘 3.75 -0.04 2022-03-31
6 161725 000799 酒鬼酒 3.40 -0.91 2022-03-31
7 161725 000596 古井贡酒 3.27 -0.24 2022-03-31
8 161725 600779 水井坊 2.59 -0.26 2022-03-31
9 161725 603589 口子窖 2.30 -0.38 2022-03-31
```
- 多只基金信息
```python
>>> import efinance as ef
>>> # 获取多只基金基本信息
>>> ef.fund.get_base_info(['161725','005827'])
0 161725 招商中证白酒指数(LOF)A 2015-05-27 -6.03 1.1959 招商基金 2021-07-30 产品特色:布局白酒领域的指数基金,历史业绩优秀,外资偏爱白酒板块。
1 005827 易方达蓝筹精选混合 2018-09-05 -2.98 2.4967 易方达基金 2021-07-30 明星消费基金经理另一力作,A+H股同步布局,价值投资典范,适合长期持有。
```
### Bond
- 可转债整体行情
```python
>>> import efinance as ef
>>> ef.bond.get_realtime_quotes()
债券代码 债券名称 涨跌幅 最新价 最高 最低 涨跌额 换手率 动态市盈率 成交量 成交额 昨日收盘 总市值 流通市值 行情ID 市场类型
0 123015 蓝盾转债 13.49 198.613 205.0 175.5 23.613 315.36 - 316062 613480512.0 175.0 199056701 199056701 0.123015 深A
1 123077 汉得转债 9.59 115.51 122.971 105.401 10.11 32.59 - 305380 358093216.0 105.4 1082332396 1082332396 0.123077 深A
2 123066 赛意转债 8.08 232.377 245.8 225.0 17.377 470.3 - 454204 1081363632.0 215.0 224423665 224423665 0.123066 深A
3 128093 百川转债 7.69 360.751 367.9 335.5 25.751 343.84 - 558874 1984944768.0 335.0 586364315 586364315 0.128093 深A
4 128082 华锋转债 7.41 158.507 163.769 147.089 10.935 103.16 - 226444 355827984.0 147.572 347931900 347931900 0.128082 深A
.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
383 123087 明电转债 -4.34 151.75 169.0 150.302 -6.879 117.66 - 520370 817884784.0 158.629 671147760 671147760 0.123087 深A
384 123070 鹏辉转债 -4.63 175.001 179.799 174.471 -8.499 18.46 - 144998 257005833.0 183.5 1374730681 1374730681 0.123070 深A
385 123027 蓝晓转债 -4.67 338.413 352.825 338.015 -16.586 44.23 - 47356 162870853.0 354.999 362300558 362300558 0.123027 深A
386 113621 彤程转债 -5.03 215.61 222.5 214.41 -11.41 11.46 - 91710 200327611.0 227.02 1725268098 1725268098 1.113621 沪A
387 123047 久吾转债 -5.7 305.5 319.52 305.382 -18.47 122.41 - 193587 600277600.0 323.97 483119533 483119533 0.123047 深A
[388 rows x 16 columns]
```
- 全部可转债信息
```python
>>> import efinance as ef
>>> ef.bond.get_all_base_info()
债券代码 债券名称 正股代码 正股名称 债券评级 申购日期 发行规模(亿) 网上发行中签率(%) 上市日期 到期日期 期限(年) 利率说明
0 123120 隆华转债 300263 隆华科技 AA- 2021-07-30 00:00:00 7.989283 NaN None 2027-07-30 00:00:00 6 第一年为0.40%、第二年为0.70%、第三年为1.00%、第四年为1.60%、第五年为2....
1 110081 闻泰转债 600745 闻泰科技 AA+ 2021-07-28 00:00:00 86.000000 0.044030 None 2027-07-28 00:00:00 6 第一年0.10%、第二年0.20%、第三年0.30%、第四年1.50%、第五年1.80%、第...
2 118001 金博转债 688598 金博股份 A+ 2021-07-23 00:00:00 5.999010 0.001771 None 2027-07-23 00:00:00 6 第一年0.50%、第二年0.70%、第三年1.20%、第四年1.80%、第五年2.40%、第...
3 123119 康泰转2 300601 康泰生物 AA 2021-07-15 00:00:00 20.000000 0.014182 None 2027-07-15 00:00:00 6 第一年为0.30%、第二年为0.50%、第三年为1.00%、第四年为1.50%、第五年为1....
4 113627 太平转债 603877 太平鸟 AA 2021-07-15 00:00:00 8.000000 0.000542 None 2027-07-15 00:00:00 6 第一年0.30%、第二年0.50%、第三年1.00%、第四年1.50%、第五年1.80%、第...
.. ... ... ... ... ... ... ... ... ... ... ... ...
80 110227 赤化转债 600227 圣济堂 AAA 2007-10-10 00:00:00 4.500000 0.158854 2007-10-23 00:00:00 2009-05-25 00:00:00 1.6192 票面利率和付息日期:本次发行的可转债票面利率第一年为1.5%、第二年为1.8%、第三年为2....
81 126006 07深高债 600548 深高速 AAA 2007-10-09 00:00:00 15.000000 0.290304 2007-10-30 00:00:00 2013-10-09 00:00:00 6 None
82 110971 恒源转债 600971 恒源煤电 AAA 2007-09-24 00:00:00 4.000000 5.311774 2007-10-12 00:00:00 2009-12-21 00:00:00 2.2484 票面利率为:第一年年利率1.5%,第二年年利率1.8%,第三年年利率2.1%,第四年年利率2...
83 110567 山鹰转债 600567 山鹰国际 AA 2007-09-05 00:00:00 4.700000 0.496391 2007-09-17 00:00:00 2010-02-01 00:00:00 2.4055 票面利率和付息日期:本次发行的可转债票面利率第一年为1.4%,第二年为1.7%,第三年为2....
84 110026 中海转债 600026 中远海能 AAA 2007-07-02 00:00:00 20.000000 1.333453 2007-07-12 00:00:00 2008-03-27 00:00:00 0.737 票面利率:第一年为1.84%,第二年为2.05%,第三年为2.26%,第四年为2.47%,第...
[585 rows x 12 columns]
```
- 指定可转债 K 线数据
```python
>>> import efinance as ef
>>> # 可转债代码(以 东财转3 为例)
>>> bond_code = '123111'
>>> ef.bond.get_quote_history(bond_code)
债券名称 债券代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 东财转3 123111 2021-04-23 130.000 130.000 130.000 130.000 1836427 2.387355e+09 0.00 30.00 30.000 11.62
1 东财转3 123111 2021-04-26 130.353 130.010 133.880 125.110 8610944 1.126033e+10 6.75 0.01 0.010 54.50
2 东财转3 123111 2021-04-27 129.000 129.600 130.846 128.400 1820766 2.357472e+09 1.88 -0.32 -0.410 11.52
3 东财转3 123111 2021-04-28 129.100 130.770 131.663 128.903 1467727 1.921641e+09 2.13 0.90 1.170 9.29
4 东财转3 123111 2021-04-29 130.690 131.208 133.150 130.560 1156934 1.525974e+09 1.98 0.33 0.438 7.32
.. ... ... ... ... ... ... ... ... ... ... ... ... ...
72 东财转3 123111 2021-08-09 159.600 159.300 162.990 158.690 596124 9.585751e+08 2.69 -0.34 -0.550 3.77
73 东财转3 123111 2021-08-10 159.190 160.950 161.450 157.000 517237 8.234596e+08 2.79 1.04 1.650 3.27
74 东财转3 123111 2021-08-11 161.110 159.850 162.300 159.400 298906 4.800711e+08 1.80 -0.68 -1.100 1.89
75 东财转3 123111 2021-08-12 159.110 158.290 160.368 158.010 270641 4.298100e+08 1.48 -0.98 -1.560 1.71
76 东财转3 123111 2021-08-13 158.000 158.358 160.290 157.850 250059 3.975513e+08 1.54 0.04 0.068 1.58
[77 rows x 13 columns]
```
### Futures
- 获取交易所期货基本信息
```python
>>> import efinance as ef
>>> ef.futures.get_futures_base_info()
期货代码 期货名称 行情ID 市场类型
0 ZCM 动力煤主力 115.ZCM 郑商所
1 ZC201 动力煤201 115.ZC201 郑商所
2 jm 焦炭主力 114.jm 大商所
3 j2201 焦炭2201 114.j2201 大商所
4 jmm 焦煤主力 114.jmm 大商所
.. ... ... ... ...
846 jm2109 焦煤2109 114.jm2109 大商所
847 071108 IH2108 8.071108 中金所
848 070131 IH次主力合约 8.070131 中金所
849 070120 IH当月连续 8.07012 中金所
850 lu2109 低硫燃油2109 142.lu2109 上海能源期货交易所
[851 rows x 4 columns]
```
- 获取期货历史行情
```python
>>> import efinance as ef
>>> # 获取全部期货行情ID列表
>>> quote_ids = ef.futures.get_realtime_quotes()['行情ID']
>>> # 指定单个期货的行情ID(以上面获得到的行情ID列表为例)
>>> quote_id = quote_ids[0]
>>> # 查看第一个行情ID
>>> quote_ids[0]
'115.ZCM'
>>> # 获取第行情ID为第一个的期货日 K 线数据
>>> ef.futures.get_quote_history(quote_id)
期货名称 期货代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 动力煤主力 ZCM 2015-05-18 440.0 437.6 440.2 437.6 64 2.806300e+06 0.00 0.00 0.0 0.0
1 动力煤主力 ZCM 2015-05-19 436.0 437.0 437.6 436.0 6 2.621000e+05 0.36 -0.32 -1.4 0.0
2 动力煤主力 ZCM 2015-05-20 436.8 435.8 437.0 434.8 8 3.487500e+05 0.50 -0.23 -1.0 0.0
3 动力煤主力 ZCM 2015-05-21 438.0 443.2 446.8 437.8 37 1.631850e+06 2.06 1.65 7.2 0.0
4 动力煤主力 ZCM 2015-05-22 439.2 441.4 443.8 439.2 34 1.502500e+06 1.04 0.09 0.4 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ...
1524 动力煤主力 ZCM 2021-08-17 755.0 770.8 776.0 750.6 82373 6.288355e+09 3.25 -1.26 -9.8 0.0
1525 动力煤主力 ZCM 2021-08-18 770.8 776.8 785.8 766.0 77392 6.016454e+09 2.59 1.76 13.4 0.0
1526 动力煤主力 ZCM 2021-08-19 776.8 777.6 798.0 764.6 97229 7.597474e+09 4.30 0.03 0.2 0.0
1527 动力煤主力 ZCM 2021-08-20 778.0 793.0 795.0 775.2 70549 5.553617e+09 2.53 1.48 11.6 0.0
1528 动力煤主力 ZCM 2021-08-23 796.8 836.6 843.8 796.8 82954 6.850341e+09 5.97 6.28 49.4 0.0
[1529 rows x 13 columns]
>>> # 指定多个期货的 行情ID
>>> quote_ids = ['115.ZCM','115.ZC109']
>>> futures_df = ef.futures.get_quote_history(quote_ids)
>>> type(futures_df)
<class 'dict'>
>>> futures_df['115.ZCM']
期货名称 期货代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 动力煤主力 ZCM 2015-05-18 440.0 437.6 440.2 437.6 64 2.806300e+06 0.00 0.00 0.0 0.0
1 动力煤主力 ZCM 2015-05-19 436.0 437.0 437.6 436.0 6 2.621000e+05 0.36 -0.32 -1.4 0.0
2 动力煤主力 ZCM 2015-05-20 436.8 435.8 437.0 434.8 8 3.487500e+05 0.50 -0.23 -1.0 0.0
3 动力煤主力 ZCM 2015-05-21 438.0 443.2 446.8 437.8 37 1.631850e+06 2.06 1.65 7.2 0.0
4 动力煤主力 ZCM 2015-05-22 439.2 441.4 443.8 439.2 34 1.502500e+06 1.04 0.09 0.4 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ...
1524 动力煤主力 ZCM 2021-08-17 755.0 770.8 776.0 750.6 82373 6.288355e+09 3.25 -1.26 -9.8 0.0
1525 动力煤主力 ZCM 2021-08-18 770.8 776.8 785.8 766.0 77392 6.016454e+09 2.59 1.76 13.4 0.0
1526 动力煤主力 ZCM 2021-08-19 776.8 777.6 798.0 764.6 97229 7.597474e+09 4.30 0.03 0.2 0.0
1527 动力煤主力 ZCM 2021-08-20 778.0 793.0 795.0 775.2 70549 5.553617e+09 2.53 1.48 11.6 0.0
1528 动力煤主力 ZCM 2021-08-23 796.8 836.6 843.8 796.8 82954 6.850341e+09 5.97 6.28 49.4 0.0
[1529 rows x 13 columns]
```
---
## Docs
在线 API 文档 => [`Docs`](https://efinance.readthedocs.io)
如果需要本地使用,则可以使用 `sphinx` 来构建 `efinance` 的文档
步骤如下
- 克隆本仓库到本地
```bash
git clone https://github.com/Micro-sheep/efinance
```
- 生成文档
```bash
cd efinance/docs
pip install -r requirements.txt --upgrade
sphinx-build . ./build -b html
```
以上默认构建英文文档,如需构建中文文档,则最后一行代码改为
```bash
sphinx-build . ./build -b html -D language=zh
```
经过以上步骤,你将会在 `docs/build` 下看的生成的 `html` 文档
同时,你也可以使用 `pdoc` 来构建 `efinance` 的文档
步骤如下
- 安装必要依赖
```bash
pip install pdoc
git clone https://github.com/Micro-sheep/efinance
```
- 生成文档
```bash
cd efinance
pdoc . -d numpy
```
进行以上步骤之后,你将可以在弹出的浏览器界面看到 `efinance` 的文档。
## Contact
[![zhihu](https://img.shields.io/badge/知乎-blue)](https://www.zhihu.com/people/la-ge-lang-ri-96-69)
[![Github](https://img.shields.io/badge/Github-blue?style=social&logo=github)](https://github.com/Micro-sheep)
[![Email](https://img.shields.io/badge/Email-blue)](mailto:micro-sheep@outlook.com)
Raw data
{
"_id": null,
"home_page": "https://github.com/Micro-sheep/efinance",
"name": "efinance",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "finance, quant, stock, fund, futures",
"author": "micro sheep",
"author_email": "micro-sheep@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/fc/9e/42d0fc3ea01fb1732ce93a5d8aaeb8b048f7cc3ccb9471716d11af9674ff/efinance-0.5.2.tar.gz",
"platform": "any",
"description": "## Introduction\n\n[![Python Version](https://img.shields.io/badge/python-3.6+-blue.svg?style=flat)](https://pypi.python.org/pypi/efinance)\n[![Pypi Package](https://img.shields.io/pypi/v/efinance.svg?maxAge=60)](https://pypi.python.org/pypi/efinance)\n[![Pypi-Install](https://img.shields.io/pypi/dm/efinance.svg?maxAge=2592000&label=installs&color=%2327B1FF)](https://pypi.python.org/pypi/efinance)\n[![Docs](https://readthedocs.org/projects/efinance/badge/?version=latest)](https://efinance.readthedocs.io)\n[![CodeFactor](https://www.codefactor.io/repository/github/micro-sheep/efinance/badge)](https://www.codefactor.io/repository/github/micro-sheep/efinance/overview/main)\n[![Github Stars](https://img.shields.io/github/stars/Micro-sheep/efinance.svg?style=social&label=Star&maxAge=60)](https://github.com/Micro-sheep/efinance)\n\n[`efinance`](https://github.com/Micro-sheep/efinance) \u662f\u7531\u4e2a\u4eba\u6253\u9020\u7684\u7528\u4e8e\u83b7\u53d6\u80a1\u7968\u3001\u57fa\u91d1\u3001\u671f\u8d27\u6570\u636e\u7684\u514d\u8d39\u5f00\u6e90 Python \u5e93\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5b83\u5f88\u65b9\u4fbf\u5730\u83b7\u53d6\u6570\u636e\u4ee5\u4fbf\u66f4\u597d\u5730\u670d\u52a1\u4e8e\u4e2a\u4eba\u7684\u4ea4\u6613\u7cfb\u7edf\u9700\u6c42\u3002\n\n- [`Source Code`](https://github.com/Micro-sheep/efinance)\n- [`Docs`](https://efinance.readthedocs.io)\n- [`Changelog`](https://github.com/Micro-sheep/efinance/blob/main/changelog.md)\n\n---\n\n## Installation\n\n- \u901a\u8fc7 `pip` \u5b89\u88c5\n\n```bash\npip install efinance\n```\n\n- \u901a\u8fc7 `pip` \u66f4\u65b0\n\n```bash\npip install efinance --upgrade\n```\n\n- \u901a\u8fc7 `docker` \u5b89\u88c5\n\n```bash\n# \u514b\u9686\u4ee3\u7801\ngit clone https://github.com/Micro-sheep/efinance\n# \u5207\u6362\u5de5\u4f5c\u76ee\u5f55\u4e3a\u8be5\u9879\u76ee\u7684\u6839\u76ee\u5f55\ncd efinance\n# \u6784\u5efa\u955c\u50cf(-t \u6307\u5b9a\u6784\u5efa\u540e\u751f\u6210\u7684\u955c\u50cf\u540d\u79f0 . \u6307\u5b9a build \u7684\u5bf9\u8c61\u662f\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e0b\u7684 dockerfile)\ndocker build -t efinance . --no-cache\n# \u4ee5\u4ea4\u4e92\u7684\u65b9\u5f0f\u8fd0\u884c\u955c\u50cf(\u8fd0\u884c\u4e4b\u540e\u81ea\u52a8\u5220\u9664\u5bb9\u5668,\u5982\u4e0d\u60f3\u5220\u9664 \u5219\u53ef\u53bb\u6389 --rm)\ndocker run --rm -it efinance\n```\n\n- \u6e90\u7801\u5b89\u88c5\uff08\u7528\u4e8e\u5f00\u53d1\uff09\n\n```bash\ngit clone https://github.com/Micro-sheep/efinance\ncd efinance\npip install -e .\n```\n\n---\n\n## Examples\n\n### Stock\n\n- \u83b7\u53d6\u80a1\u7968\u5386\u53f2\u65e5 K \u7ebf\u6570\u636e\n\n```python\n>>> import efinance as ef\n>>> # \u80a1\u7968\u4ee3\u7801\n>>> stock_code = '600519'\n>>> ef.stock.get_quote_history(stock_code)\n \u80a1\u7968\u540d\u79f0 \u80a1\u7968\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u8d35\u5dde\u8305\u53f0 600519 2001-08-27 -89.74 -89.53 -89.08 -90.07 406318.0 1.410347e+09 -1.10 0.92 0.83 56.83\n1 \u8d35\u5dde\u8305\u53f0 600519 2001-08-28 -89.64 -89.27 -89.24 -89.72 129647.0 4.634630e+08 -0.54 0.29 0.26 18.13\n2 \u8d35\u5dde\u8305\u53f0 600519 2001-08-29 -89.24 -89.36 -89.24 -89.42 53252.0 1.946890e+08 -0.20 -0.10 -0.09 7.45\n3 \u8d35\u5dde\u8305\u53f0 600519 2001-08-30 -89.38 -89.22 -89.14 -89.44 48013.0 1.775580e+08 -0.34 0.16 0.14 6.72\n4 \u8d35\u5dde\u8305\u53f0 600519 2001-08-31 -89.21 -89.24 -89.12 -89.28 23231.0 8.623100e+07 -0.18 -0.02 -0.02 3.25\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n4756 \u8d35\u5dde\u8305\u53f0 600519 2021-07-23 1937.82 1900.00 1937.82 1895.09 47585.0 9.057762e+09 2.20 -2.06 -40.01 0.38\n4757 \u8d35\u5dde\u8305\u53f0 600519 2021-07-26 1879.00 1804.11 1879.00 1780.00 98619.0 1.789436e+10 5.21 -5.05 -95.89 0.79\n4758 \u8d35\u5dde\u8305\u53f0 600519 2021-07-27 1803.00 1712.89 1810.00 1703.00 86577.0 1.523081e+10 5.93 -5.06 -91.22 0.69\n4759 \u8d35\u5dde\u8305\u53f0 600519 2021-07-28 1703.00 1768.90 1788.20 1682.12 85369.0 1.479247e+10 6.19 3.27 56.01 0.68\n4760 \u8d35\u5dde\u8305\u53f0 600519 2021-07-29 1810.01 1740.00 1823.00 1734.34 51035.0 9.067345e+09 5.01 -1.63 -28.90 0.41\n\n[4761 rows x 13 columns]\n```\n\n- \u83b7\u53d6\u975e A \u80a1\u7684\u80a1\u7968 K \u7ebf\u6570\u636e\uff08\u652f\u6301\u8f93\u5165\u80a1\u7968\u540d\u79f0\u4ee5\u53ca\u4ee3\u7801\uff09\n\n```python\n>>> import efinance as ef\n>>> # \u80a1\u7968\u4ee3\u7801\n>>> stock_code = 'AAPL'\n>>> ef.stock.get_quote_history(stock_code)\n \u80a1\u7968\u540d\u79f0 \u80a1\u7968\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u82f9\u679c AAPL 1984-09-07 -5.37 -5.37 -5.36 -5.37 2981600.0 0.000000e+00 0.00 0.00 0.00 0.02\n1 \u82f9\u679c AAPL 1984-09-10 -5.37 -5.37 -5.36 -5.37 2346400.0 0.000000e+00 -0.19 0.00 0.00 0.01\n2 \u82f9\u679c AAPL 1984-09-11 -5.36 -5.36 -5.36 -5.36 5444000.0 0.000000e+00 0.00 0.19 0.01 0.03\n3 \u82f9\u679c AAPL 1984-09-12 -5.36 -5.37 -5.36 -5.37 4773600.0 0.000000e+00 -0.19 -0.19 -0.01 0.03\n4 \u82f9\u679c AAPL 1984-09-13 -5.36 -5.36 -5.36 -5.36 7429600.0 0.000000e+00 0.00 0.19 0.01 0.04\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n8739 \u82f9\u679c AAPL 2021-07-22 145.94 146.80 148.19 145.81 77338156.0 1.137623e+10 1.64 0.96 1.40 0.47\n8740 \u82f9\u679c AAPL 2021-07-23 147.55 148.56 148.72 146.92 71447416.0 1.058233e+10 1.23 1.20 1.76 0.43\n8741 \u82f9\u679c AAPL 2021-07-26 148.27 148.99 149.83 147.70 72434089.0 1.080774e+10 1.43 0.29 0.43 0.44\n8742 \u82f9\u679c AAPL 2021-07-27 149.12 146.77 149.21 145.55 104818578.0 1.540140e+10 2.46 -1.49 -2.22 0.63\n8743 \u82f9\u679c AAPL 2021-07-28 144.81 144.98 146.97 142.54 118931191.0 1.723188e+10 3.02 -1.22 -1.79 0.72\n\n[8744 rows x 13 columns]\n\n>>> # \u80a1\u7968\u540d\u79f0\n>>> stock_name = '\u5fae\u8f6f'\n>>> ef.stock.get_quote_history(stock_name)\n \u80a1\u7968\u540d\u79f0 \u80a1\u7968\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u5fae\u8f6f MSFT 1986-03-13 -20.74 -20.73 -20.73 -20.74 1.031789e+09 0.000000e+00 0.00 0.00 0.00 13.72\n1 \u5fae\u8f6f MSFT 1986-03-14 -20.73 -20.73 -20.73 -20.73 3.081600e+08 0.000000e+00 0.00 0.00 0.00 4.10\n2 \u5fae\u8f6f MSFT 1986-03-17 -20.73 -20.73 -20.73 -20.73 1.331712e+08 0.000000e+00 0.00 0.00 0.00 1.77\n3 \u5fae\u8f6f MSFT 1986-03-18 -20.73 -20.73 -20.73 -20.73 6.776640e+07 0.000000e+00 0.00 0.00 0.00 0.90\n4 \u5fae\u8f6f MSFT 1986-03-19 -20.73 -20.73 -20.73 -20.73 4.789440e+07 0.000000e+00 0.00 0.00 0.00 0.64\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n8357 \u5fae\u8f6f MSFT 2021-07-22 283.84 286.14 286.42 283.42 2.338406e+07 6.677062e+09 1.07 1.68 4.74 0.31\n8358 \u5fae\u8f6f MSFT 2021-07-23 287.37 289.67 289.99 286.50 2.276807e+07 6.578686e+09 1.22 1.23 3.53 0.30\n8359 \u5fae\u8f6f MSFT 2021-07-26 289.00 289.05 289.69 286.64 2.317607e+07 6.685868e+09 1.05 -0.21 -0.62 0.31\n8360 \u5fae\u8f6f MSFT 2021-07-27 289.43 286.54 289.58 282.95 3.360407e+07 9.599993e+09 2.29 -0.87 -2.51 0.45\n8361 \u5fae\u8f6f MSFT 2021-07-28 288.99 286.22 290.15 283.83 3.356685e+07 9.638499e+09 2.21 -0.11 -0.32 0.45\n\n[8362 rows x 13 columns]\n```\n\n- \u83b7\u53d6 ETF K \u7ebf\u6570\u636e\n\n```python\n>>> import efinance as ef\n>>> # ETF \u4ee3\u7801\uff08\u4ee5\u4e2d\u6982\u4e92\u8054\u7f51 ETF \u4e3a\u4f8b\uff09\n>>> etf_code = '513050'\n>>> ef.stock.get_quote_history(etf_code)\n \u80a1\u7968\u540d\u79f0 \u80a1\u7968\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2017-01-18 0.989 0.977 0.989 0.969 345605.0 3.381795e+07 0.00 0.00 0.000 0.26\n1 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2017-01-19 0.978 0.989 0.990 0.978 257716.0 2.542553e+07 1.23 1.23 0.012 0.19\n2 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2017-01-20 0.989 0.988 0.990 0.986 50980.0 5.043289e+06 0.40 -0.10 -0.001 0.04\n3 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2017-01-23 0.988 0.988 0.989 0.986 13739.0 1.356129e+06 0.30 0.00 0.000 0.01\n4 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2017-01-24 0.989 0.989 0.992 0.987 17937.0 1.774398e+06 0.51 0.10 0.001 0.01\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n1097 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2021-07-23 1.789 1.760 1.789 1.758 4427623.0 7.836530e+08 1.73 -1.51 -0.027 3.32\n1098 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2021-07-26 1.679 1.645 1.698 1.642 13035366.0 2.182816e+09 3.18 -6.53 -0.115 9.78\n1099 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2021-07-27 1.600 1.547 1.620 1.546 14269546.0 2.257610e+09 4.50 -5.96 -0.098 10.70\n1100 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2021-07-28 1.545 1.552 1.578 1.506 13141023.0 2.024106e+09 4.65 0.32 0.005 9.85\n1101 \u4e2d\u6982\u4e92\u8054\u7f51ETF 513050 2021-07-29 1.615 1.641 1.651 1.606 10658041.0 1.734404e+09 2.90 5.73 0.089 7.99\n\n[1102 rows x 13 columns]\n```\n\n- \u83b7\u53d6\u5355\u53ea\u80a1\u7968 5 \u5206\u949f K \u7ebf\u6570\u636e\n\n```python\n>>> import efinance as ef\n>>> # \u80a1\u7968\u4ee3\u7801\n>>> stock_code = '600519'\n>>> # 5 \u5206\u949f\n>>> frequency = 5\n>>> ef.stock.get_quote_history(stock_code, klt=frequency)\n \u80a1\u7968\u540d\u79f0 \u80a1\u7968\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u8d35\u5dde\u8305\u53f0 600519 2021-06-16 09:35 2172.71 2159.71 2175.71 2150.74 1885.0 411159309.0 1.15 -0.64 -14.00 0.02\n1 \u8d35\u5dde\u8305\u53f0 600519 2021-06-16 09:40 2156.69 2148.71 2160.48 2143.37 1238.0 268790684.0 0.79 -0.51 -11.00 0.01\n2 \u8d35\u5dde\u8305\u53f0 600519 2021-06-16 09:45 2149.79 2159.71 2160.69 2149.79 706.0 153631002.0 0.51 0.51 11.00 0.01\n3 \u8d35\u5dde\u8305\u53f0 600519 2021-06-16 09:50 2159.61 2148.87 2159.71 2148.87 586.0 127346502.0 0.50 -0.50 -10.84 0.00\n4 \u8d35\u5dde\u8305\u53f0 600519 2021-06-16 09:55 2148.87 2161.04 2163.71 2148.72 788.0 171491075.0 0.70 0.57 12.17 0.01\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n1521 \u8d35\u5dde\u8305\u53f0 600519 2021-07-29 13:50 1746.51 1746.09 1748.95 1746.01 738.0 128889575.0 0.17 -0.09 -1.49 0.01\n1522 \u8d35\u5dde\u8305\u53f0 600519 2021-07-29 13:55 1746.08 1742.01 1746.09 1741.96 831.0 144968679.0 0.24 -0.23 -4.08 0.01\n1523 \u8d35\u5dde\u8305\u53f0 600519 2021-07-29 14:00 1742.00 1739.58 1742.00 1739.58 864.0 150446840.0 0.14 -0.14 -2.43 0.01\n1524 \u8d35\u5dde\u8305\u53f0 600519 2021-07-29 14:05 1741.87 1740.00 1745.00 1738.88 1083.0 188427970.0 0.35 0.02 0.42 0.01\n1525 \u8d35\u5dde\u8305\u53f0 600519 2021-07-29 14:10 1740.00 1740.02 1740.10 1740.00 59.0 10315488.0 0.01 0.00 0.02 0.00\n\n[1526 rows x 13 columns]\n```\n\n- \u6caa\u6df1\u5e02\u573a A \u80a1\u6700\u65b0\u72b6\u51b5\n\n```python\n>>> import efinance as ef\n>>> ef.stock.get_realtime_quotes()\n \u80a1\u7968\u4ee3\u7801 \u80a1\u7968\u540d\u79f0 \u6da8\u8dcc\u5e45 \u6700\u65b0\u4ef7 \u6700\u9ad8 \u6700\u4f4e \u4eca\u5f00 \u6da8\u8dcc\u989d \u6362\u624b\u7387 \u91cf\u6bd4 \u52a8\u6001\u5e02\u76c8\u7387 \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u6628\u65e5\u6536\u76d8 \u603b\u5e02\u503c \u6d41\u901a\u5e02\u503c \u884c\u60c5ID \u5e02\u573a\u7c7b\u578b\n0 688787 N\u6d77\u5929 277.59 139.48 172.39 139.25 171.66 102.54 85.62 - 78.93 74519 1110318832.0 36.94 5969744000 1213908667 1.688787 \u6caaA\n1 301045 N\u5929\u7984 149.34 39.42 48.95 39.2 48.95 23.61 66.66 - 37.81 163061 683878656.0 15.81 4066344240 964237089 0.301045 \u6df1A\n2 300532 \u4eca\u5929\u56fd\u9645 20.04 12.16 12.16 10.69 10.69 2.03 8.85 3.02 -22.72 144795 171535181.0 10.13 3322510580 1989333440 0.300532 \u6df1A\n3 300600 \u56fd\u745e\u79d1\u6280 20.02 13.19 13.19 11.11 11.41 2.2 18.61 2.82 218.75 423779 541164432.0 10.99 3915421427 3003665117 0.300600 \u6df1A\n4 300985 \u81f4\u8fdc\u65b0\u80fd 20.01 47.08 47.08 36.8 39.4 7.85 66.65 2.17 58.37 210697 897370992.0 39.23 6277336472 1488300116 0.300985 \u6df1A\n... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...\n4598 603186 \u534e\u6b63\u65b0\u6750 -10.0 43.27 44.09 43.27 43.99 -4.81 1.98 0.48 25.24 27697 120486294.0 48.08 6146300650 6063519472 1.603186 \u6caaA\n4599 688185 \u5eb7\u5e0c\u8bfa-U -10.11 476.4 534.94 460.13 530.0 -53.6 6.02 2.74 -2088.07 40239 1960540832.0 530.0 117885131884 31831479215 1.688185 \u6caaA\n4600 688148 \u82b3\u6e90\u80a1\u4efd -10.57 31.3 34.39 31.3 33.9 -3.7 26.07 0.56 220.01 188415 620632512.0 35.0 15923562000 2261706043 1.688148 \u6caaA\n4601 300034 \u94a2\u7814\u9ad8\u7eb3 -10.96 43.12 46.81 42.88 46.5 -5.31 7.45 1.77 59.49 323226 1441101824.0 48.43 20959281094 18706911861 0.300034 \u6df1A\n4602 300712 \u6c38\u798f\u80a1\u4efd -13.71 96.9 110.94 95.4 109.0 -15.4 6.96 1.26 511.21 126705 1265152928.0 112.3 17645877600 17645877600 0.300712 \u6df1A\n\n[4603 rows x 18 columns]\n```\n\n- \u80a1\u7968\u9f99\u864e\u699c\n\n```python\n>>> import efinance as ef\n>>> # \u83b7\u53d6\u6700\u65b0\u4e00\u4e2a\u516c\u5f00\u7684\u9f99\u864e\u699c\u6570\u636e(\u540e\u9762\u8fd8\u6709\u83b7\u53d6\u6307\u5b9a\u65e5\u671f\u533a\u95f4\u7684\u793a\u4f8b\u4ee3\u7801)\n>>> ef.stock.get_daily_billboard()\n \u80a1\u7968\u4ee3\u7801 \u80a1\u7968\u540d\u79f0 \u4e0a\u699c\u65e5\u671f \u89e3\u8bfb \u6536\u76d8\u4ef7 \u6da8\u8dcc\u5e45 \u6362\u624b\u7387 \u9f99\u864e\u699c\u51c0\u4e70\u989d \u9f99\u864e\u699c\u4e70\u5165\u989d \u9f99\u864e\u699c\u5356\u51fa\u989d \u9f99\u864e\u699c\u6210\u4ea4\u989d \u5e02\u573a\u603b\u6210\u4ea4\u989d \u51c0\u4e70\u989d\u5360\u603b\u6210\u4ea4\u6bd4 \u6210\u4ea4\u989d\u5360\u603b\u6210\u4ea4\u6bd4 \u6d41\u901a\u5e02\u503c \u4e0a\u699c\u539f\u56e0\n0 000608 \u9633\u5149\u80a1\u4efd 2021-08-27 \u5356\u4e00\u4e3b\u5356\uff0c\u6210\u529f\u738748.36% 3.73 -9.9034 3.8430 -8.709942e+06 1.422786e+07 2.293780e+07 3.716565e+07 110838793 -7.858208 33.531268 2.796761e+09 \u65e5\u8dcc\u5e45\u504f\u79bb\u503c\u8fbe\u52307%\u7684\u524d5\u53ea\u8bc1\u5238\n1 000751 \u950c\u4e1a\u80a1\u4efd 2021-08-27 \u4e3b\u529b\u505aT\uff0c\u6210\u529f\u738718.84% 5.32 -2.9197 19.6505 -1.079219e+08 5.638899e+07 1.643109e+08 2.206999e+08 1462953973 -7.376984 15.085906 7.500502e+09 \u65e5\u632f\u5e45\u503c\u8fbe\u523015%\u7684\u524d5\u53ea\u8bc1\u5238\n2 000762 \u897f\u85cf\u77ff\u4e1a 2021-08-27 \u5317\u4eac\u8d44\u91d1\u4e70\u5165\uff0c\u6210\u529f\u738739.42% 63.99 1.0741 15.6463 2.938758e+07 4.675541e+08 4.381665e+08 9.057206e+08 4959962598 0.592496 18.260633 3.332571e+10 \u65e5\u632f\u5e45\u503c\u8fbe\u523015%\u7684\u524d5\u53ea\u8bc1\u5238\n3 000833 \u7ca4\u6842\u80a1\u4efd 2021-08-27 \u5b9e\u529b\u6e38\u8d44\u4e70\u5165\uff0c\u6210\u529f\u738744.55% 8.87 10.0496 8.8263 4.993555e+07 1.292967e+08 7.936120e+07 2.086580e+08 895910429 5.573721 23.290046 3.353614e+09 \u8fde\u7eed\u4e09\u4e2a\u4ea4\u6613\u65e5\u5185\uff0c\u6da8\u5e45\u504f\u79bb\u503c\u7d2f\u8ba1\u8fbe\u523020%\u7684\u8bc1\u5238\n4 001208 \u534e\u83f1\u7ebf\u7f06 2021-08-27 1\u5bb6\u673a\u6784\u4e70\u5165\uff0c\u6210\u529f\u738740.43% 19.72 4.3386 46.1985 4.055258e+07 1.537821e+08 1.132295e+08 2.670117e+08 1203913048 3.368398 22.178651 2.634710e+09 \u65e5\u6362\u624b\u7387\u8fbe\u523020%\u7684\u524d5\u53ea\u8bc1\u5238\n.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...\n70 688558 \u56fd\u76db\u667a\u79d1 2021-08-27 \u4e70\u4e00\u4e3b\u4e70\uff0c\u6210\u529f\u738738.71% 60.72 1.6064 34.0104 1.835494e+07 1.057779e+08 8.742293e+07 1.932008e+08 802569300 2.287023 24.072789 2.321743e+09 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6362\u624b\u7387\u8fbe\u523030%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n71 688596 \u6b63\u5e06\u79d1\u6280 2021-08-27 1\u5bb6\u673a\u6784\u4e70\u5165\uff0c\u6210\u529f\u738757.67% 26.72 3.1660 3.9065 -1.371039e+07 8.409046e+07 9.780085e+07 1.818913e+08 745137400 -1.839982 24.410438 4.630550e+09 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u8fde\u7eed3\u4e2a\u4ea4\u6613\u65e5\u5185\u6536\u76d8\u4ef7\u683c\u6da8\u5e45\u504f\u79bb\u503c\u7d2f\u8ba1\u8fbe\u523030%\u7684\u8bc1\u5238\n72 688663 \u65b0\u98ce\u5149 2021-08-27 \u5356\u4e00\u4e3b\u5356\uff0c\u6210\u529f\u738737.18% 28.17 -17.6316 32.2409 1.036460e+07 5.416901e+07 4.380440e+07 9.797341e+07 274732700 3.772613 35.661358 8.492507e+08 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6536\u76d8\u4ef7\u683c\u8dcc\u5e45\u8fbe\u523015%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n73 688663 \u65b0\u98ce\u5149 2021-08-27 \u5356\u4e00\u4e3b\u5356\uff0c\u6210\u529f\u738737.18% 28.17 -17.6316 32.2409 1.036460e+07 5.416901e+07 4.380440e+07 9.797341e+07 274732700 3.772613 35.661358 8.492507e+08 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6362\u624b\u7387\u8fbe\u523030%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n74 688667 \u83f1\u7535\u7535\u63a7 2021-08-27 1\u5bb6\u673a\u6784\u5356\u51fa\uff0c\u6210\u529f\u738749.69% 123.37 -18.8996 17.7701 -2.079877e+06 4.611216e+07 4.819204e+07 9.430420e+07 268503400 -0.774618 35.122163 1.461225e+09 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6536\u76d8\u4ef7\u683c\u8dcc\u5e45\u8fbe\u523015%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n\n[75 rows x 16 columns]\n\n>>> # \u83b7\u53d6\u6307\u5b9a\u65e5\u671f\u533a\u95f4\u7684\u9f99\u864e\u699c\u6570\u636e\n>>> start_date = '2021-08-20' # \u5f00\u59cb\u65e5\u671f\n>>> end_date = '2021-08-27' # \u7ed3\u675f\u65e5\u671f\n>>> ef.stock.get_daily_billboard(start_date = start_date,end_date = end_date)\n \u80a1\u7968\u4ee3\u7801 \u80a1\u7968\u540d\u79f0 \u4e0a\u699c\u65e5\u671f \u89e3\u8bfb \u6536\u76d8\u4ef7 \u6da8\u8dcc\u5e45 \u6362\u624b\u7387 \u9f99\u864e\u699c\u51c0\u4e70\u989d \u9f99\u864e\u699c\u4e70\u5165\u989d \u9f99\u864e\u699c\u5356\u51fa\u989d \u9f99\u864e\u699c\u6210\u4ea4\u989d \u5e02\u573a\u603b\u6210\u4ea4\u989d \u51c0\u4e70\u989d\u5360\u603b\u6210\u4ea4\u6bd4 \u6210\u4ea4\u989d\u5360\u603b\u6210\u4ea4\u6bd4 \u6d41\u901a\u5e02\u503c \u4e0a\u699c\u539f\u56e0\n0 000608 \u9633\u5149\u80a1\u4efd 2021-08-27 \u5356\u4e00\u4e3b\u5356\uff0c\u6210\u529f\u738748.36% 3.73 -9.9034 3.8430 -8.709942e+06 1.422786e+07 2.293780e+07 3.716565e+07 110838793 -7.858208 33.531268 2.796761e+09 \u65e5\u8dcc\u5e45\u504f\u79bb\u503c\u8fbe\u52307%\u7684\u524d5\u53ea\u8bc1\u5238\n1 000751 \u950c\u4e1a\u80a1\u4efd 2021-08-27 \u4e3b\u529b\u505aT\uff0c\u6210\u529f\u738718.84% 5.32 -2.9197 19.6505 -1.079219e+08 5.638899e+07 1.643109e+08 2.206999e+08 1462953973 -7.376984 15.085906 7.500502e+09 \u65e5\u632f\u5e45\u503c\u8fbe\u523015%\u7684\u524d5\u53ea\u8bc1\u5238\n2 000762 \u897f\u85cf\u77ff\u4e1a 2021-08-27 \u5317\u4eac\u8d44\u91d1\u4e70\u5165\uff0c\u6210\u529f\u738739.42% 63.99 1.0741 15.6463 2.938758e+07 4.675541e+08 4.381665e+08 9.057206e+08 4959962598 0.592496 18.260633 3.332571e+10 \u65e5\u632f\u5e45\u503c\u8fbe\u523015%\u7684\u524d5\u53ea\u8bc1\u5238\n3 000833 \u7ca4\u6842\u80a1\u4efd 2021-08-27 \u5b9e\u529b\u6e38\u8d44\u4e70\u5165\uff0c\u6210\u529f\u738744.55% 8.87 10.0496 8.8263 4.993555e+07 1.292967e+08 7.936120e+07 2.086580e+08 895910429 5.573721 23.290046 3.353614e+09 \u8fde\u7eed\u4e09\u4e2a\u4ea4\u6613\u65e5\u5185\uff0c\u6da8\u5e45\u504f\u79bb\u503c\u7d2f\u8ba1\u8fbe\u523020%\u7684\u8bc1\u5238\n4 001208 \u534e\u83f1\u7ebf\u7f06 2021-08-27 1\u5bb6\u673a\u6784\u4e70\u5165\uff0c\u6210\u529f\u738740.43% 19.72 4.3386 46.1985 4.055258e+07 1.537821e+08 1.132295e+08 2.670117e+08 1203913048 3.368398 22.178651 2.634710e+09 \u65e5\u6362\u624b\u7387\u8fbe\u523020%\u7684\u524d5\u53ea\u8bc1\u5238\n.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...\n414 605580 \u6052\u76db\u80fd\u6e90 2021-08-20 \u4e70\u4e00\u4e3b\u4e70\uff0c\u6210\u529f\u738733.33% 13.28 10.0249 0.4086 2.413149e+06 2.713051e+06 2.999022e+05 3.012953e+06 2713051 88.945937 111.054054 6.640000e+08 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6536\u76d8\u4ef7\u683c\u6da8\u5e45\u504f\u79bb\u503c\u8fbe\u52307%\u7684\u524d\u4e09\u53ea\u8bc1\u5238\n415 688029 \u5357\u5fae\u533b\u5b66 2021-08-20 4\u5bb6\u673a\u6784\u5356\u51fa\uff0c\u6210\u529f\u738755.82% 204.61 -18.5340 8.1809 -1.412053e+08 1.883342e+08 3.295394e+08 5.178736e+08 762045800 -18.529760 67.958326 9.001510e+09 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6536\u76d8\u4ef7\u683c\u8dcc\u5e45\u8fbe\u523015%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n416 688408 \u4e2d\u4fe1\u535a 2021-08-20 4\u5bb6\u673a\u6784\u5356\u51fa\uff0c\u6210\u529f\u738747.86% 179.98 -0.0666 15.3723 -4.336304e+07 3.750919e+08 4.184550e+08 7.935469e+08 846547400 -5.122340 93.739221 5.695886e+09 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u4ef7\u683c\u632f\u5e45\u8fbe\u523030%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n417 688556 \u9ad8\u6d4b\u80a1\u4efd 2021-08-20 \u4e0a\u6d77\u8d44\u91d1\u4e70\u5165\uff0c\u6210\u529f\u738760.21% 51.97 17.0495 10.6452 -3.940045e+07 1.642095e+08 2.036099e+08 3.678194e+08 575411600 -6.847351 63.922831 5.739089e+09 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6536\u76d8\u4ef7\u683c\u6da8\u5e45\u8fbe\u523015%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n418 688636 \u667a\u660e\u8fbe 2021-08-20 2\u5bb6\u673a\u6784\u4e70\u5165\uff0c\u6210\u529f\u738747.37% 161.90 15.8332 11.9578 2.922406e+07 6.598126e+07 3.675721e+07 1.027385e+08 188330100 15.517464 54.552336 1.647410e+09 \u6709\u4ef7\u683c\u6da8\u8dcc\u5e45\u9650\u5236\u7684\u65e5\u6536\u76d8\u4ef7\u683c\u6da8\u5e45\u8fbe\u523015%\u7684\u524d\u4e94\u53ea\u8bc1\u5238\n\n[418 rows x 16 columns]\n```\n\n- \u6caa\u6df1 A \u80a1\u80a1\u7968\u5b63\u5ea6\u8868\u73b0\n\n```python\n>>> import efinance as ef\n>>> ef.stock.get_all_company_performance() # \u9ed8\u8ba4\u4e3a\u6700\u65b0\u5b63\u5ea6\uff0c\u4ea6\u53ef\u6307\u5b9a\u5b63\u5ea6\n \u80a1\u7968\u4ee3\u7801 \u80a1\u7968\u7b80\u79f0 \u516c\u544a\u65e5\u671f \u8425\u4e1a\u6536\u5165 \u8425\u4e1a\u6536\u5165\u540c\u6bd4\u589e\u957f \u8425\u4e1a\u6536\u5165\u5b63\u5ea6\u73af\u6bd4 \u51c0\u5229\u6da6 \u51c0\u5229\u6da6\u540c\u6bd4\u589e\u957f \u51c0\u5229\u6da6\u5b63\u5ea6\u73af\u6bd4 \u6bcf\u80a1\u6536\u76ca \u6bcf\u80a1\u51c0\u8d44\u4ea7 \u51c0\u8d44\u4ea7\u6536\u76ca\u7387 \u9500\u552e\u6bdb\u5229\u7387 \u6bcf\u80a1\u7ecf\u8425\u73b0\u91d1\u6d41\u91cf\n0 688981 \u4e2d\u82af\u56fd\u9645 2021-08-28 00:00:00 1.609039e+10 22.253453 20.6593 5.241321e+09 278.100000 307.8042 0.6600 11.949525 5.20 26.665642 1.182556\n1 688819 \u5929\u80fd\u80a1\u4efd 2021-08-28 00:00:00 1.625468e+10 9.343279 23.9092 6.719446e+08 -14.890000 -36.8779 0.7100 11.902912 6.15 17.323263 -1.562187\n2 688789 \u5b8f\u534e\u6570\u79d1 2021-08-28 00:00:00 4.555604e+08 56.418441 6.5505 1.076986e+08 49.360000 -7.3013 1.8900 14.926761 13.51 43.011243 1.421272\n3 688681 \u79d1\u6c47\u80a1\u4efd 2021-08-28 00:00:00 1.503343e+08 17.706987 121.9407 1.664509e+07 -13.100000 383.3331 0.2100 5.232517 4.84 47.455511 -0.232395\n4 688670 \u91d1\u8fea\u514b 2021-08-28 00:00:00 3.209423e+07 -63.282413 -93.1788 -2.330505e+07 -242.275001 -240.1554 -0.3500 3.332254 -10.10 85.308531 1.050348\n... ... ... ... ... ... ... ... ... ... ... ... ... ... ...\n3720 600131 \u56fd\u7f51\u4fe1\u901a 2021-07-16 00:00:00 2.880378e+09 6.787087 69.5794 2.171389e+08 29.570000 296.2051 0.1800 4.063260 4.57 19.137437 -0.798689\n3721 600644 \u4e50\u5c71\u7535\u529b 2021-07-15 00:00:00 1.257030e+09 18.079648 5.7300 8.379727e+07 -14.300000 25.0007 0.1556 3.112413 5.13 23.645137 0.200906\n3722 002261 \u62d3\u7ef4\u4fe1\u606f 2021-07-15 00:00:00 8.901777e+08 47.505282 24.0732 6.071063e+07 68.320000 30.0596 0.0550 2.351598 2.37 37.047968 -0.131873\n3723 601952 \u82cf\u57a6\u519c\u53d1 2021-07-13 00:00:00 4.544138e+09 11.754570 47.8758 3.288132e+08 1.460000 83.1486 0.2400 3.888046 6.05 15.491684 -0.173772\n3724 601568 \u5317\u5143\u96c6\u56e2 2021-07-09 00:00:00 6.031506e+09 32.543303 30.6352 1.167989e+09 61.050000 40.8165 0.3200 3.541533 9.01 27.879243 0.389860\n\n[3725 rows x 14 columns]\n\n```\n\n- \u80a1\u7968\u5386\u53f2\u5355\u5b50\u6d41\u5165\u6570\u636e(\u65e5\u7ea7)\n\n```python\n>>> import efinance as ef\n>>> ef.stock.get_history_bill('300750')\n \u80a1\u7968\u540d\u79f0 \u80a1\u7968\u4ee3\u7801 \u65e5\u671f \u4e3b\u529b\u51c0\u6d41\u5165 \u5c0f\u5355\u51c0\u6d41\u5165 \u4e2d\u5355\u51c0\u6d41\u5165 \u5927\u5355\u51c0\u6d41\u5165 \u8d85\u5927\u5355\u51c0\u6d41\u5165 \u4e3b\u529b\u51c0\u6d41\u5165\u5360\u6bd4 \u5c0f\u5355\u6d41\u5165\u51c0\u5360\u6bd4 \u4e2d\u5355\u6d41\u5165\u51c0\u5360\u6bd4 \u5927\u5355\u6d41\u5165\u51c0\u5360\u6bd4 \u8d85\u5927\u5355\u6d41\u5165\u51c0\u5360\u6bd4 \u6536\u76d8\u4ef7 \u6da8\u8dcc\u5e45\n0 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-03-18 4.453786e+07 51241536.0 -9.577939e+07 -26680704.0 71218560.0 1.16 1.33 -2.49 -0.69 1.85 335.56 0.84\n1 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-03-19 -6.129661e+08 423235296.0 1.897308e+08 -244136864.0 -368829200.0 -10.13 6.99 3.14 -4.03 -6.09 316.26 -5.75\n2 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-03-22 -5.674665e+08 473253808.0 9.421272e+07 -255868192.0 -311598336.0 -7.95 6.63 1.32 -3.58 -4.37 307.56 -2.75\n3 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-03-23 -3.168412e+08 131142880.0 1.856984e+08 -349417168.0 32575936.0 -6.88 2.85 4.03 -7.59 0.71 303.67 -1.26\n4 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-03-24 -5.999049e+08 371268928.0 2.286360e+08 -6849616.0 -593055328.0 -8.18 5.06 3.12 -0.09 -8.09 288.55 -4.98\n.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...\n97 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-09 -1.152779e+09 -596512.0 1.153376e+09 -370189552.0 -782589456.0 -12.09 -0.01 12.10 -3.88 -8.21 516.00 -5.13\n98 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-10 -1.009431e+09 -358999.0 1.009790e+09 -392670720.0 -616759952.0 -11.03 -0.00 11.03 -4.29 -6.74 510.50 -1.07\n99 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-11 1.305631e+08 -475792.0 -1.300873e+08 -204097776.0 334660864.0 2.25 -0.01 -2.25 -3.52 5.78 517.25 1.32\n100 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-12 -1.425337e+09 -488240.0 1.425825e+09 -454688192.0 -970648896.0 -16.58 -0.01 16.58 -5.29 -11.29 502.00 -2.95\n101 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 -3.111439e+08 -895641.0 3.120392e+08 -145200128.0 -165943808.0 -2.21 -0.01 2.22 -1.03 -1.18 502.05 0.01\n\n[102 rows x 15 columns]\n```\n\n- \u80a1\u7968\u6700\u65b0\u4e00\u4e2a\u4ea4\u6613\u65e5\u5355\u5b50\u6d41\u5165\u6570\u636e(\u5206\u949f\u7ea7)\n\n```python\n>>> import efinance as ef\n>>> ef.stock.get_today_bill('300750')\n \u80a1\u7968\u540d\u79f0 \u80a1\u7968\u4ee3\u7801 \u65f6\u95f4 \u4e3b\u529b\u51c0\u6d41\u5165 \u5c0f\u5355\u51c0\u6d41\u5165 \u4e2d\u5355\u51c0\u6d41\u5165 \u5927\u5355\u51c0\u6d41\u5165 \u8d85\u5927\u5355\u51c0\u6d41\u5165\n0 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 09:31 -58855676.0 -171274.0 59026945.0 22025460.0 -80881136.0\n1 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 09:32 -50671227.0 -190312.0 50861534.0 8927176.0 -59598403.0\n2 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 09:33 -67833979.0 -190312.0 68024288.0 34170593.0 -102004572.0\n3 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 09:34 -28890553.0 -220312.0 29110861.0 16373829.0 -45264382.0\n4 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 09:35 -14955904.0 -482660.0 15438561.0 14601153.0 -29557057.0\n.. ... ... ... ... ... ... ... ...\n235 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 14:56 -311695708.0 -895633.0 312591337.0 -144447542.0 -167248166.0\n236 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 14:57 -310641455.0 -895633.0 311537085.0 -144697852.0 -165943603.0\n237 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 14:58 -311143584.0 -895633.0 312039214.0 -145199981.0 -165943603.0\n238 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 14:59 -311143584.0 -895633.0 312039214.0 -145199981.0 -165943603.0\n239 \u5b81\u5fb7\u65f6\u4ee3 300750 2021-08-13 15:00 -311143584.0 -895633.0 312039214.0 -145199981.0 -165943603.0\n\n[240 rows x 8 columns]\n```\n\n### Fund\n\n- \u83b7\u53d6\u57fa\u91d1\u5386\u53f2\u51c0\u503c\u4fe1\u606f\n\n```python\n>>> import efinance as ef\n>>> ef.fund.get_quote_history('161725')\n \u65e5\u671f \u5355\u4f4d\u51c0\u503c \u7d2f\u8ba1\u51c0\u503c \u6da8\u8dcc\u5e45\n0 2021-07-29 1.2726 2.9037 -1.52\n1 2021-07-28 1.2922 2.9233 0.85\n2 2021-07-27 1.2813 2.9124 -3.6\n3 2021-07-26 1.3292 2.9603 -7.24\n4 2021-07-23 1.4329 3.0640 -2.29\n... ... ... ... ...\n1502 2015-06-08 1.0380 1.0380 2.5692\n1503 2015-06-05 1.0120 1.0120 1.5045\n1504 2015-06-04 0.9970 0.9970 --\n1505 2015-05-29 0.9950 0.9950 --\n1506 2015-05-27 1.0000 1.0000 --\n\n[1507 rows x 4 columns]\n```\n\n- \u83b7\u53d6\u57fa\u91d1\u516c\u5f00\u6301\u4ed3\u4fe1\u606f\n\n```python\n>>> import efinance as ef\n>>> # \u83b7\u53d6\u6700\u65b0\u516c\u5f00\u7684\u6301\u4ed3\u6570\u636e\n>>> ef.fund.get_invest_position('161725')\n \u57fa\u91d1\u4ee3\u7801 \u80a1\u7968\u4ee3\u7801 \u80a1\u7968\u7b80\u79f0 \u6301\u4ed3\u5360\u6bd4 \u8f83\u4e0a\u671f\u53d8\u5316 \u516c\u5f00\u65e5\u671f\n0 161725 600519 \u8d35\u5dde\u8305\u53f0 16.78 1.36 2022-03-31\n1 161725 600809 \u5c71\u897f\u6c7e\u9152 15.20 0.52 2022-03-31\n2 161725 000568 \u6cf8\u5dde\u8001\u7a96 14.57 -0.89 2022-03-31\n3 161725 000858 \u4e94\u7cae\u6db2 12.83 -1.26 2022-03-31\n4 161725 002304 \u6d0b\u6cb3\u80a1\u4efd 11.58 0.91 2022-03-31\n5 161725 603369 \u4eca\u4e16\u7f18 3.75 -0.04 2022-03-31\n6 161725 000799 \u9152\u9b3c\u9152 3.40 -0.91 2022-03-31\n7 161725 000596 \u53e4\u4e95\u8d21\u9152 3.27 -0.24 2022-03-31\n8 161725 600779 \u6c34\u4e95\u574a 2.59 -0.26 2022-03-31\n9 161725 603589 \u53e3\u5b50\u7a96 2.30 -0.38 2022-03-31\n```\n\n- \u591a\u53ea\u57fa\u91d1\u4fe1\u606f\n\n```python\n>>> import efinance as ef\n>>> # \u83b7\u53d6\u591a\u53ea\u57fa\u91d1\u57fa\u672c\u4fe1\u606f\n>>> ef.fund.get_base_info(['161725','005827'])\n0 161725 \u62db\u5546\u4e2d\u8bc1\u767d\u9152\u6307\u6570(LOF)A 2015-05-27 -6.03 1.1959 \u62db\u5546\u57fa\u91d1 2021-07-30 \u4ea7\u54c1\u7279\u8272\uff1a\u5e03\u5c40\u767d\u9152\u9886\u57df\u7684\u6307\u6570\u57fa\u91d1\uff0c\u5386\u53f2\u4e1a\u7ee9\u4f18\u79c0\uff0c\u5916\u8d44\u504f\u7231\u767d\u9152\u677f\u5757\u3002\n1 005827 \u6613\u65b9\u8fbe\u84dd\u7b79\u7cbe\u9009\u6df7\u5408 2018-09-05 -2.98 2.4967 \u6613\u65b9\u8fbe\u57fa\u91d1 2021-07-30 \u660e\u661f\u6d88\u8d39\u57fa\u91d1\u7ecf\u7406\u53e6\u4e00\u529b\u4f5c\uff0cA+H\u80a1\u540c\u6b65\u5e03\u5c40\uff0c\u4ef7\u503c\u6295\u8d44\u5178\u8303\uff0c\u9002\u5408\u957f\u671f\u6301\u6709\u3002\n\n```\n\n### Bond\n\n- \u53ef\u8f6c\u503a\u6574\u4f53\u884c\u60c5\n\n```python\n>>> import efinance as ef\n>>> ef.bond.get_realtime_quotes()\n \u503a\u5238\u4ee3\u7801 \u503a\u5238\u540d\u79f0 \u6da8\u8dcc\u5e45 \u6700\u65b0\u4ef7 \u6700\u9ad8 \u6700\u4f4e \u6da8\u8dcc\u989d \u6362\u624b\u7387 \u52a8\u6001\u5e02\u76c8\u7387 \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u6628\u65e5\u6536\u76d8 \u603b\u5e02\u503c \u6d41\u901a\u5e02\u503c \u884c\u60c5ID \u5e02\u573a\u7c7b\u578b\n0 123015 \u84dd\u76fe\u8f6c\u503a 13.49 198.613 205.0 175.5 23.613 315.36 - 316062 613480512.0 175.0 199056701 199056701 0.123015 \u6df1A\n1 123077 \u6c49\u5f97\u8f6c\u503a 9.59 115.51 122.971 105.401 10.11 32.59 - 305380 358093216.0 105.4 1082332396 1082332396 0.123077 \u6df1A\n2 123066 \u8d5b\u610f\u8f6c\u503a 8.08 232.377 245.8 225.0 17.377 470.3 - 454204 1081363632.0 215.0 224423665 224423665 0.123066 \u6df1A\n3 128093 \u767e\u5ddd\u8f6c\u503a 7.69 360.751 367.9 335.5 25.751 343.84 - 558874 1984944768.0 335.0 586364315 586364315 0.128093 \u6df1A\n4 128082 \u534e\u950b\u8f6c\u503a 7.41 158.507 163.769 147.089 10.935 103.16 - 226444 355827984.0 147.572 347931900 347931900 0.128082 \u6df1A\n.. ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...\n383 123087 \u660e\u7535\u8f6c\u503a -4.34 151.75 169.0 150.302 -6.879 117.66 - 520370 817884784.0 158.629 671147760 671147760 0.123087 \u6df1A\n384 123070 \u9e4f\u8f89\u8f6c\u503a -4.63 175.001 179.799 174.471 -8.499 18.46 - 144998 257005833.0 183.5 1374730681 1374730681 0.123070 \u6df1A\n385 123027 \u84dd\u6653\u8f6c\u503a -4.67 338.413 352.825 338.015 -16.586 44.23 - 47356 162870853.0 354.999 362300558 362300558 0.123027 \u6df1A\n386 113621 \u5f64\u7a0b\u8f6c\u503a -5.03 215.61 222.5 214.41 -11.41 11.46 - 91710 200327611.0 227.02 1725268098 1725268098 1.113621 \u6caaA\n387 123047 \u4e45\u543e\u8f6c\u503a -5.7 305.5 319.52 305.382 -18.47 122.41 - 193587 600277600.0 323.97 483119533 483119533 0.123047 \u6df1A\n\n[388 rows x 16 columns]\n```\n\n- \u5168\u90e8\u53ef\u8f6c\u503a\u4fe1\u606f\n\n```python\n>>> import efinance as ef\n>>> ef.bond.get_all_base_info()\n \u503a\u5238\u4ee3\u7801 \u503a\u5238\u540d\u79f0 \u6b63\u80a1\u4ee3\u7801 \u6b63\u80a1\u540d\u79f0 \u503a\u5238\u8bc4\u7ea7 \u7533\u8d2d\u65e5\u671f \u53d1\u884c\u89c4\u6a21(\u4ebf) \u7f51\u4e0a\u53d1\u884c\u4e2d\u7b7e\u7387(%) \u4e0a\u5e02\u65e5\u671f \u5230\u671f\u65e5\u671f \u671f\u9650(\u5e74) \u5229\u7387\u8bf4\u660e\n0 123120 \u9686\u534e\u8f6c\u503a 300263 \u9686\u534e\u79d1\u6280 AA- 2021-07-30 00:00:00 7.989283 NaN None 2027-07-30 00:00:00 6 \u7b2c\u4e00\u5e74\u4e3a0.40%\u3001\u7b2c\u4e8c\u5e74\u4e3a0.70%\u3001\u7b2c\u4e09\u5e74\u4e3a1.00%\u3001\u7b2c\u56db\u5e74\u4e3a1.60%\u3001\u7b2c\u4e94\u5e74\u4e3a2....\n1 110081 \u95fb\u6cf0\u8f6c\u503a 600745 \u95fb\u6cf0\u79d1\u6280 AA+ 2021-07-28 00:00:00 86.000000 0.044030 None 2027-07-28 00:00:00 6 \u7b2c\u4e00\u5e740.10%\u3001\u7b2c\u4e8c\u5e740.20%\u3001\u7b2c\u4e09\u5e740.30%\u3001\u7b2c\u56db\u5e741.50%\u3001\u7b2c\u4e94\u5e741.80%\u3001\u7b2c...\n2 118001 \u91d1\u535a\u8f6c\u503a 688598 \u91d1\u535a\u80a1\u4efd A+ 2021-07-23 00:00:00 5.999010 0.001771 None 2027-07-23 00:00:00 6 \u7b2c\u4e00\u5e740.50%\u3001\u7b2c\u4e8c\u5e740.70%\u3001\u7b2c\u4e09\u5e741.20%\u3001\u7b2c\u56db\u5e741.80%\u3001\u7b2c\u4e94\u5e742.40%\u3001\u7b2c...\n3 123119 \u5eb7\u6cf0\u8f6c2 300601 \u5eb7\u6cf0\u751f\u7269 AA 2021-07-15 00:00:00 20.000000 0.014182 None 2027-07-15 00:00:00 6 \u7b2c\u4e00\u5e74\u4e3a0.30%\u3001\u7b2c\u4e8c\u5e74\u4e3a0.50%\u3001\u7b2c\u4e09\u5e74\u4e3a1.00%\u3001\u7b2c\u56db\u5e74\u4e3a1.50%\u3001\u7b2c\u4e94\u5e74\u4e3a1....\n4 113627 \u592a\u5e73\u8f6c\u503a 603877 \u592a\u5e73\u9e1f AA 2021-07-15 00:00:00 8.000000 0.000542 None 2027-07-15 00:00:00 6 \u7b2c\u4e00\u5e740.30%\u3001\u7b2c\u4e8c\u5e740.50%\u3001\u7b2c\u4e09\u5e741.00%\u3001\u7b2c\u56db\u5e741.50%\u3001\u7b2c\u4e94\u5e741.80%\u3001\u7b2c...\n.. ... ... ... ... ... ... ... ... ... ... ... ...\n80 110227 \u8d64\u5316\u8f6c\u503a 600227 \u5723\u6d4e\u5802 AAA 2007-10-10 00:00:00 4.500000 0.158854 2007-10-23 00:00:00 2009-05-25 00:00:00 1.6192 \u7968\u9762\u5229\u7387\u548c\u4ed8\u606f\u65e5\u671f:\u672c\u6b21\u53d1\u884c\u7684\u53ef\u8f6c\u503a\u7968\u9762\u5229\u7387\u7b2c\u4e00\u5e74\u4e3a1.5%\u3001\u7b2c\u4e8c\u5e74\u4e3a1.8%\u3001\u7b2c\u4e09\u5e74\u4e3a2....\n81 126006 07\u6df1\u9ad8\u503a 600548 \u6df1\u9ad8\u901f AAA 2007-10-09 00:00:00 15.000000 0.290304 2007-10-30 00:00:00 2013-10-09 00:00:00 6 None\n82 110971 \u6052\u6e90\u8f6c\u503a 600971 \u6052\u6e90\u7164\u7535 AAA 2007-09-24 00:00:00 4.000000 5.311774 2007-10-12 00:00:00 2009-12-21 00:00:00 2.2484 \u7968\u9762\u5229\u7387\u4e3a:\u7b2c\u4e00\u5e74\u5e74\u5229\u73871.5%,\u7b2c\u4e8c\u5e74\u5e74\u5229\u73871.8%,\u7b2c\u4e09\u5e74\u5e74\u5229\u73872.1%,\u7b2c\u56db\u5e74\u5e74\u5229\u73872...\n83 110567 \u5c71\u9e70\u8f6c\u503a 600567 \u5c71\u9e70\u56fd\u9645 AA 2007-09-05 00:00:00 4.700000 0.496391 2007-09-17 00:00:00 2010-02-01 00:00:00 2.4055 \u7968\u9762\u5229\u7387\u548c\u4ed8\u606f\u65e5\u671f:\u672c\u6b21\u53d1\u884c\u7684\u53ef\u8f6c\u503a\u7968\u9762\u5229\u7387\u7b2c\u4e00\u5e74\u4e3a1.4%,\u7b2c\u4e8c\u5e74\u4e3a1.7%,\u7b2c\u4e09\u5e74\u4e3a2....\n84 110026 \u4e2d\u6d77\u8f6c\u503a 600026 \u4e2d\u8fdc\u6d77\u80fd AAA 2007-07-02 00:00:00 20.000000 1.333453 2007-07-12 00:00:00 2008-03-27 00:00:00 0.737 \u7968\u9762\u5229\u7387:\u7b2c\u4e00\u5e74\u4e3a1.84%,\u7b2c\u4e8c\u5e74\u4e3a2.05%,\u7b2c\u4e09\u5e74\u4e3a2.26%,\u7b2c\u56db\u5e74\u4e3a2.47%,\u7b2c...\n\n[585 rows x 12 columns]\n```\n\n- \u6307\u5b9a\u53ef\u8f6c\u503a K \u7ebf\u6570\u636e\n\n```python\n>>> import efinance as ef\n>>> # \u53ef\u8f6c\u503a\u4ee3\u7801\uff08\u4ee5 \u4e1c\u8d22\u8f6c3 \u4e3a\u4f8b\uff09\n>>> bond_code = '123111'\n>>> ef.bond.get_quote_history(bond_code)\n \u503a\u5238\u540d\u79f0 \u503a\u5238\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u4e1c\u8d22\u8f6c3 123111 2021-04-23 130.000 130.000 130.000 130.000 1836427 2.387355e+09 0.00 30.00 30.000 11.62\n1 \u4e1c\u8d22\u8f6c3 123111 2021-04-26 130.353 130.010 133.880 125.110 8610944 1.126033e+10 6.75 0.01 0.010 54.50\n2 \u4e1c\u8d22\u8f6c3 123111 2021-04-27 129.000 129.600 130.846 128.400 1820766 2.357472e+09 1.88 -0.32 -0.410 11.52\n3 \u4e1c\u8d22\u8f6c3 123111 2021-04-28 129.100 130.770 131.663 128.903 1467727 1.921641e+09 2.13 0.90 1.170 9.29\n4 \u4e1c\u8d22\u8f6c3 123111 2021-04-29 130.690 131.208 133.150 130.560 1156934 1.525974e+09 1.98 0.33 0.438 7.32\n.. ... ... ... ... ... ... ... ... ... ... ... ... ...\n72 \u4e1c\u8d22\u8f6c3 123111 2021-08-09 159.600 159.300 162.990 158.690 596124 9.585751e+08 2.69 -0.34 -0.550 3.77\n73 \u4e1c\u8d22\u8f6c3 123111 2021-08-10 159.190 160.950 161.450 157.000 517237 8.234596e+08 2.79 1.04 1.650 3.27\n74 \u4e1c\u8d22\u8f6c3 123111 2021-08-11 161.110 159.850 162.300 159.400 298906 4.800711e+08 1.80 -0.68 -1.100 1.89\n75 \u4e1c\u8d22\u8f6c3 123111 2021-08-12 159.110 158.290 160.368 158.010 270641 4.298100e+08 1.48 -0.98 -1.560 1.71\n76 \u4e1c\u8d22\u8f6c3 123111 2021-08-13 158.000 158.358 160.290 157.850 250059 3.975513e+08 1.54 0.04 0.068 1.58\n\n[77 rows x 13 columns]\n```\n\n### Futures\n\n- \u83b7\u53d6\u4ea4\u6613\u6240\u671f\u8d27\u57fa\u672c\u4fe1\u606f\n\n```python\n>>> import efinance as ef\n>>> ef.futures.get_futures_base_info()\n \u671f\u8d27\u4ee3\u7801 \u671f\u8d27\u540d\u79f0 \u884c\u60c5ID \u5e02\u573a\u7c7b\u578b\n0 ZCM \u52a8\u529b\u7164\u4e3b\u529b 115.ZCM \u90d1\u5546\u6240\n1 ZC201 \u52a8\u529b\u7164201 115.ZC201 \u90d1\u5546\u6240\n2 jm \u7126\u70ad\u4e3b\u529b 114.jm \u5927\u5546\u6240\n3 j2201 \u7126\u70ad2201 114.j2201 \u5927\u5546\u6240\n4 jmm \u7126\u7164\u4e3b\u529b 114.jmm \u5927\u5546\u6240\n.. ... ... ... ...\n846 jm2109 \u7126\u71642109 114.jm2109 \u5927\u5546\u6240\n847 071108 IH2108 8.071108 \u4e2d\u91d1\u6240\n848 070131 IH\u6b21\u4e3b\u529b\u5408\u7ea6 8.070131 \u4e2d\u91d1\u6240\n849 070120 IH\u5f53\u6708\u8fde\u7eed 8.07012 \u4e2d\u91d1\u6240\n850 lu2109 \u4f4e\u786b\u71c3\u6cb92109 142.lu2109 \u4e0a\u6d77\u80fd\u6e90\u671f\u8d27\u4ea4\u6613\u6240\n\n[851 rows x 4 columns]\n```\n\n- \u83b7\u53d6\u671f\u8d27\u5386\u53f2\u884c\u60c5\n\n```python\n>>> import efinance as ef\n>>> # \u83b7\u53d6\u5168\u90e8\u671f\u8d27\u884c\u60c5ID\u5217\u8868\n>>> quote_ids = ef.futures.get_realtime_quotes()['\u884c\u60c5ID']\n>>> # \u6307\u5b9a\u5355\u4e2a\u671f\u8d27\u7684\u884c\u60c5ID(\u4ee5\u4e0a\u9762\u83b7\u5f97\u5230\u7684\u884c\u60c5ID\u5217\u8868\u4e3a\u4f8b)\n>>> quote_id = quote_ids[0]\n>>> # \u67e5\u770b\u7b2c\u4e00\u4e2a\u884c\u60c5ID\n>>> quote_ids[0]\n'115.ZCM'\n>>> # \u83b7\u53d6\u7b2c\u884c\u60c5ID\u4e3a\u7b2c\u4e00\u4e2a\u7684\u671f\u8d27\u65e5 K \u7ebf\u6570\u636e\n>>> ef.futures.get_quote_history(quote_id)\n \u671f\u8d27\u540d\u79f0 \u671f\u8d27\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-18 440.0 437.6 440.2 437.6 64 2.806300e+06 0.00 0.00 0.0 0.0\n1 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-19 436.0 437.0 437.6 436.0 6 2.621000e+05 0.36 -0.32 -1.4 0.0\n2 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-20 436.8 435.8 437.0 434.8 8 3.487500e+05 0.50 -0.23 -1.0 0.0\n3 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-21 438.0 443.2 446.8 437.8 37 1.631850e+06 2.06 1.65 7.2 0.0\n4 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-22 439.2 441.4 443.8 439.2 34 1.502500e+06 1.04 0.09 0.4 0.0\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n1524 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-17 755.0 770.8 776.0 750.6 82373 6.288355e+09 3.25 -1.26 -9.8 0.0\n1525 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-18 770.8 776.8 785.8 766.0 77392 6.016454e+09 2.59 1.76 13.4 0.0\n1526 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-19 776.8 777.6 798.0 764.6 97229 7.597474e+09 4.30 0.03 0.2 0.0\n1527 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-20 778.0 793.0 795.0 775.2 70549 5.553617e+09 2.53 1.48 11.6 0.0\n1528 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-23 796.8 836.6 843.8 796.8 82954 6.850341e+09 5.97 6.28 49.4 0.0\n\n[1529 rows x 13 columns]\n\n>>> # \u6307\u5b9a\u591a\u4e2a\u671f\u8d27\u7684 \u884c\u60c5ID\n>>> quote_ids = ['115.ZCM','115.ZC109']\n>>> futures_df = ef.futures.get_quote_history(quote_ids)\n>>> type(futures_df)\n<class 'dict'>\n>>> futures_df['115.ZCM']\n \u671f\u8d27\u540d\u79f0 \u671f\u8d27\u4ee3\u7801 \u65e5\u671f \u5f00\u76d8 \u6536\u76d8 \u6700\u9ad8 \u6700\u4f4e \u6210\u4ea4\u91cf \u6210\u4ea4\u989d \u632f\u5e45 \u6da8\u8dcc\u5e45 \u6da8\u8dcc\u989d \u6362\u624b\u7387\n0 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-18 440.0 437.6 440.2 437.6 64 2.806300e+06 0.00 0.00 0.0 0.0\n1 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-19 436.0 437.0 437.6 436.0 6 2.621000e+05 0.36 -0.32 -1.4 0.0\n2 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-20 436.8 435.8 437.0 434.8 8 3.487500e+05 0.50 -0.23 -1.0 0.0\n3 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-21 438.0 443.2 446.8 437.8 37 1.631850e+06 2.06 1.65 7.2 0.0\n4 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2015-05-22 439.2 441.4 443.8 439.2 34 1.502500e+06 1.04 0.09 0.4 0.0\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n1524 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-17 755.0 770.8 776.0 750.6 82373 6.288355e+09 3.25 -1.26 -9.8 0.0\n1525 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-18 770.8 776.8 785.8 766.0 77392 6.016454e+09 2.59 1.76 13.4 0.0\n1526 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-19 776.8 777.6 798.0 764.6 97229 7.597474e+09 4.30 0.03 0.2 0.0\n1527 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-20 778.0 793.0 795.0 775.2 70549 5.553617e+09 2.53 1.48 11.6 0.0\n1528 \u52a8\u529b\u7164\u4e3b\u529b ZCM 2021-08-23 796.8 836.6 843.8 796.8 82954 6.850341e+09 5.97 6.28 49.4 0.0\n\n[1529 rows x 13 columns]\n```\n\n---\n\n## Docs\n\n\u5728\u7ebf API \u6587\u6863 => [`Docs`](https://efinance.readthedocs.io)\n\n\u5982\u679c\u9700\u8981\u672c\u5730\u4f7f\u7528\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 `sphinx` \u6765\u6784\u5efa `efinance` \u7684\u6587\u6863\n\n\u6b65\u9aa4\u5982\u4e0b\n\n- \u514b\u9686\u672c\u4ed3\u5e93\u5230\u672c\u5730\n\n```bash\ngit clone https://github.com/Micro-sheep/efinance\n\n```\n\n- \u751f\u6210\u6587\u6863\n\n```bash\ncd efinance/docs\npip install -r requirements.txt --upgrade\nsphinx-build . ./build -b html\n```\n\n\u4ee5\u4e0a\u9ed8\u8ba4\u6784\u5efa\u82f1\u6587\u6587\u6863\uff0c\u5982\u9700\u6784\u5efa\u4e2d\u6587\u6587\u6863\uff0c\u5219\u6700\u540e\u4e00\u884c\u4ee3\u7801\u6539\u4e3a\n\n```bash\nsphinx-build . ./build -b html -D language=zh\n```\n\n\u7ecf\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u5c06\u4f1a\u5728 `docs/build` \u4e0b\u770b\u7684\u751f\u6210\u7684 `html` \u6587\u6863\n\n\u540c\u65f6\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528 `pdoc` \u6765\u6784\u5efa `efinance` \u7684\u6587\u6863\n\n\u6b65\u9aa4\u5982\u4e0b\n\n- \u5b89\u88c5\u5fc5\u8981\u4f9d\u8d56\n\n```bash\npip install pdoc\ngit clone https://github.com/Micro-sheep/efinance\n```\n\n- \u751f\u6210\u6587\u6863\n\n```bash\ncd efinance\npdoc . -d numpy\n```\n\n\u8fdb\u884c\u4ee5\u4e0a\u6b65\u9aa4\u4e4b\u540e\uff0c\u4f60\u5c06\u53ef\u4ee5\u5728\u5f39\u51fa\u7684\u6d4f\u89c8\u5668\u754c\u9762\u770b\u5230 `efinance` \u7684\u6587\u6863\u3002\n\n## Contact\n\n[![zhihu](https://img.shields.io/badge/\u77e5\u4e4e-blue)](https://www.zhihu.com/people/la-ge-lang-ri-96-69)\n[![Github](https://img.shields.io/badge/Github-blue?style=social&logo=github)](https://github.com/Micro-sheep)\n[![Email](https://img.shields.io/badge/Email-blue)](mailto:micro-sheep@outlook.com)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A finance tool to get stock,fund and futures data base on eastmoney",
"version": "0.5.2",
"project_urls": {
"Documentation": "https://efinance.readthedocs.io",
"Homepage": "https://github.com/Micro-sheep/efinance",
"Source": "https://github.com/Micro-sheep/efinance"
},
"split_keywords": [
"finance",
" quant",
" stock",
" fund",
" futures"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4db166e910c899ef89e4ef2bf2770b0708b5175b192ccecf740f57ffabab46a8",
"md5": "cbc12a79c123569a015aa28c32a17e47",
"sha256": "ab5dc9c1211744908819f454b48c9dc51638d659fdcc417903003b079d9af112"
},
"downloads": -1,
"filename": "efinance-0.5.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cbc12a79c123569a015aa28c32a17e47",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 72715,
"upload_time": "2024-04-24T12:44:07",
"upload_time_iso_8601": "2024-04-24T12:44:07.691356Z",
"url": "https://files.pythonhosted.org/packages/4d/b1/66e910c899ef89e4ef2bf2770b0708b5175b192ccecf740f57ffabab46a8/efinance-0.5.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fc9e42d0fc3ea01fb1732ce93a5d8aaeb8b048f7cc3ccb9471716d11af9674ff",
"md5": "830227c2342a1afaf8d11cf9448c0674",
"sha256": "a6dba1e28e09ecb5a30da5800475c7c6c12dbd95eb2cdcf0efb758112c2885ef"
},
"downloads": -1,
"filename": "efinance-0.5.2.tar.gz",
"has_sig": false,
"md5_digest": "830227c2342a1afaf8d11cf9448c0674",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 90228,
"upload_time": "2024-04-24T12:44:10",
"upload_time_iso_8601": "2024-04-24T12:44:10.558850Z",
"url": "https://files.pythonhosted.org/packages/fc/9e/42d0fc3ea01fb1732ce93a5d8aaeb8b048f7cc3ccb9471716d11af9674ff/efinance-0.5.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-24 12:44:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Micro-sheep",
"github_project": "efinance",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "efinance"
}