Skip to content

Commit

Permalink
fix(futures_zh_sina.py): fix futures_zh_daily_sina interface
Browse files Browse the repository at this point in the history
fix futures_zh_daily_sina interface
  • Loading branch information
albertandking committed Apr 30, 2023
1 parent 0955f0a commit 9d0184e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion akshare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,9 +2382,10 @@
1.9.64 fix: fix stock_a_indicator_lg interface
1.9.65 fix: fix stock_hot_search_baidu interface
1.9.66 fix: fix match_main_contract interface
1.9.67 fix: fix futures_zh_daily_sina interface
"""

__version__ = "1.9.66"
__version__ = "1.9.67"
__author__ = "AKFamily"

import sys
Expand Down
2 changes: 1 addition & 1 deletion akshare/futures/futures_zh_sina.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2022/6/2 15:20
Date: 2023/4/30 20:20
Desc: 新浪财经-国内期货-实时数据获取
http://vip.stock.finance.sina.com.cn/quotes_service/view/qihuohangqing.html#titlePos_3
P.S. 注意采集速度, 容易封禁 IP, 如果不能访问请稍后再试
Expand Down
11 changes: 7 additions & 4 deletions akshare/futures_derivative/sina_futures_index.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2021/12/22 15:41
Date: 2023/4/30 20:41
Desc: 新浪财经-期货的主力合约数据
https://finance.sina.com.cn/futuremarket/index.shtml
"""
Expand All @@ -20,7 +20,7 @@ def zh_subscribe_exchange_symbol(symbol: str = "dce") -> pd.DataFrame:
"""
订阅指定交易所品种的代码
https://finance.sina.com.cn/futuremarket/index.shtml
:param symbol: choice of {"dce", "czce", "shfe", "cffex"}
:param symbol: choice of {"dce", "czce", "shfe", "cffex", "gfex"}
:type symbol: str
:return: 订阅指定交易所品种的代码
:rtype: pandas.DataFrame
Expand All @@ -42,13 +42,16 @@ def zh_subscribe_exchange_symbol(symbol: str = "dce") -> pd.DataFrame:
if symbol == "cffex":
data_json["cffex"].remove("中国金融期货交易所")
return pd.DataFrame(data_json["cffex"])
if symbol == "gfex":
data_json["gfex"].remove("广期所")
return pd.DataFrame(data_json["gfex"])


def match_main_contract(symbol: str = "shfe") -> pd.DataFrame:
"""
指定交易所的所有可以提供数据的合约
https://finance.sina.com.cn/futuremarket/index.shtml
:param symbol: choice of {"dce", "czce", "shfe", "cffex"}
:param symbol: choice of {"dce", "czce", "shfe", "cffex", "gfex"}
:type symbol: str
:return: 指定交易所的所有可以提供数据的合约
:rtype: pandas.DataFrame
Expand Down Expand Up @@ -89,7 +92,7 @@ def futures_display_main_sina() -> pd.DataFrame:
:rtype: pandas.DataFrame
"""
temp_df = pd.DataFrame()
for item in ["dce", "czce", "shfe", "cffex"]:
for item in ["dce", "czce", "shfe", "cffex", "gfex"]:
temp_df = pd.concat([temp_df, match_main_contract(symbol=item)])
temp_df.reset_index(inplace=True, drop=True)
return temp_df
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@

## 更新说明

1.9.67 fix: fix futures_zh_daily_sina interface

1. 修复 futures_zh_daily_sina 接口

1.9.66 fix: fix match_main_contract interface

1. 修复 match_main_contract 接口
Expand Down Expand Up @@ -2243,6 +2247,8 @@

## 版本更新说明

1.9.67 fix: fix futures_zh_daily_sina interface

1.9.66 fix: fix match_main_contract interface

1.9.65 fix: fix stock_hot_search_baidu interface
Expand Down

0 comments on commit 9d0184e

Please sign in to comment.