Skip to content

Commit

Permalink
Date (#4484)
Browse files Browse the repository at this point in the history
* add version 1.12.48

* fix futures_main_sina

* fix option_current_em

* fix option_finance_minute_sina

* update date

* add version 1.12.49

* fix option_minute_em

* fix stock_dxsyl_em

* update date
  • Loading branch information
albertandking authored Feb 1, 2024
1 parent d285a42 commit 54e6742
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
3 changes: 2 additions & 1 deletion akshare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2661,9 +2661,10 @@
1.12.46 fix: fix futures_contract_detail interface
1.12.47 fix: fix stock_zh_ah_daily interface
1.12.48 fix: fix option_minute_em interface
1.12.49 fix: fix stock_dxsyl_em interface
"""

__version__ = "1.12.48"
__version__ = "1.12.49"
__author__ = "AKFamily"

import sys
Expand Down
2 changes: 1 addition & 1 deletion akshare/option/option_finance_sina.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ def option_finance_minute_sina(symbol: str = "10002530") -> pd.DataFrame:
def option_minute_em(symbol: str = "MO2402-C-5400") -> pd.DataFrame:
"""
东方财富网-行情中心-期权市场-分时行情
https://stock.finance.sina.com.cn/option/quotes.html
https://wap.eastmoney.com/quote/stock/151.cu2404P61000.html
:param symbol: 期权代码; 通过调用 ak.option_current_em() 获取
:type symbol: str
:return: 指定期权的分钟频率数据
Expand Down
12 changes: 8 additions & 4 deletions akshare/stock_feature/stock_dxsyl_em.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2023/12/2 19:30
Date: 2024/2/1 16:20
Desc: 东方财富网-数据中心-新股数据-打新收益率
东方财富网-数据中心-新股申购-打新收益率
https://data.eastmoney.com/xg/xg/dxsyl.html
Expand All @@ -10,7 +10,8 @@
"""
import pandas as pd
import requests
from tqdm import tqdm

from akshare.utils.tqdm import get_tqdm


def stock_dxsyl_em() -> pd.DataFrame:
Expand Down Expand Up @@ -38,6 +39,7 @@ def stock_dxsyl_em() -> pd.DataFrame:
data_json = r.json()
total_page = data_json["result"]["pages"]
big_df = pd.DataFrame()
tqdm = get_tqdm()
for page in tqdm(range(1, total_page + 1), leave=False):
params.update({"pageNumber": page})
r = requests.get(url, params=params)
Expand Down Expand Up @@ -102,7 +104,7 @@ def stock_dxsyl_em() -> pd.DataFrame:
big_df["总发行数量"] = pd.to_numeric(big_df["总发行数量"], errors="coerce")
big_df["开盘溢价"] = pd.to_numeric(big_df["开盘溢价"], errors="coerce")
big_df["首日涨幅"] = pd.to_numeric(big_df["首日涨幅"], errors="coerce")
big_df["上市日期"] = pd.to_datetime(big_df["上市日期"]).dt.date
big_df["上市日期"] = pd.to_datetime(big_df["上市日期"], errors="coerce").dt.date
return big_df


Expand Down Expand Up @@ -139,6 +141,7 @@ def stock_xgsglb_em(symbol: str = "全部股票") -> pd.DataFrame:
data_json = r.json()
total_page = data_json["result"]["pages"]
big_df = pd.DataFrame()
tqdm = get_tqdm()
for page in tqdm(range(1, 1 + int(total_page)), leave=False):
params.update({"pageNumber": page})
r = requests.get(url, params=params)
Expand Down Expand Up @@ -252,6 +255,7 @@ def stock_xgsglb_em(symbol: str = "全部股票") -> pd.DataFrame:
data_json = r.json()
total_page = data_json["result"]["pages"]
big_df = pd.DataFrame()
tqdm = get_tqdm()
for page in tqdm(range(1, total_page + 1), leave=False):
params.update({"pageNumber": page})
r = requests.get(url, params=params)
Expand Down Expand Up @@ -338,7 +342,7 @@ def stock_xgsglb_em(symbol: str = "全部股票") -> pd.DataFrame:
]
]

big_df["申购日期"] = pd.to_datetime(big_df["申购日期"]).dt.date
big_df["申购日期"] = pd.to_datetime(big_df["申购日期"], errors="coerce").dt.date
big_df["中签号公布日"] = pd.to_datetime(big_df["中签号公布日"]).dt.date
big_df["中签缴款日期"] = pd.to_datetime(big_df["中签缴款日期"]).dt.date
big_df["发行总数"] = pd.to_numeric(big_df["发行总数"], errors="coerce")
Expand Down
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@

## 更新说明详情

1.12.49 fix: fix stock_dxsyl_em interface

1. 修复 stock_dxsyl_em 接口
2. 修复 option_minute_em 接口

1.12.48 fix: fix option_minute_em interface

1. 修复 option_minute_em 接口
Expand Down Expand Up @@ -3491,6 +3496,10 @@

## 版本更新说明

1.12.49 fix: fix stock_dxsyl_em interface

1.12.48 fix: fix option_minute_em interface

1.12.47 fix: fix stock_zh_ah_daily interface

1.12.46 fix: fix futures_contract_detail interface
Expand Down
2 changes: 1 addition & 1 deletion docs/data/option/option.md
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ print(option_finance_minute_sina_df)

接口: option_minute_em

目标地址: https://stock.finance.sina.com.cn/option/quotes.html
目标地址: https://wap.eastmoney.com/quote/stock/151.cu2404P61000.html

描述: 东方财富网-行情中心-期权市场-分时行情

Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**风险提示:[AKShare](https://github.com/akfamily/akshare) 开源财经数据接口库所采集的数据皆来自公开的数据源,不涉及任何个人隐私数据和非公开数据。
同时本项目提供的数据接口及相关数据仅用于学术研究,任何个人、机构及团体使用本项目的数据接口及相关数据请注意商业风险。**

1. 本文档更新时间:**2024-01-31**
1. 本文档更新时间:**2024-02-01**
2. 如有 [AKShare](https://github.com/akfamily/akshare) 库、文档及数据的相关问题,请在 [AKShare Issues](https://github.com/akfamily/akshare/issues) 中提 Issues;
3. 欢迎关注 **数据科学实战** 微信公众号:<div><img src="https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/qrcode/ds.png"></div>;
4. 如果您的问题未能在文档中找到答案,您也可以加入 **AKShare-VIP QQ 群**: 为了提高问答质量,此群为收费群(一杯咖啡钱即可入群,赠送[《AKShare-初阶-使用教学》](https://zmj.xet.tech/s/wck86)视频课),可以添加 **AKShare-小助手** QQ:1254836886,由小助手邀请入群! ![](https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/qrcode/qr_code_1254836886.jpg)
Expand Down

0 comments on commit 54e6742

Please sign in to comment.