Skip to content

Commit

Permalink
Dev (#4863)
Browse files Browse the repository at this point in the history
* docs: update date

* fix: fix stock_fhps_detail_ths

* docs: update date

* feat: add version 1.13.71
  • Loading branch information
albertandking committed May 13, 2024
1 parent 901bc0d commit 84ca36b
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 26 deletions.
3 changes: 2 additions & 1 deletion akshare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2782,9 +2782,10 @@
1.13.68 fix: fix rate_interbank interface
1.13.69 fix: fix get_shfe_rank_table interface
1.13.70 fix: fix stock_irm_cninfo interface
1.13.71 fix: fix stock_fhps_detail_ths interface
"""

__version__ = "1.13.70"
__version__ = "1.13.71"
__author__ = "AKFamily"

import sys
Expand Down
31 changes: 25 additions & 6 deletions akshare/stock_feature/stock_fhps_ths.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2023/4/9 21:44
Desc: 同花顺-分红融资
Date: 2024/5/13 10:30
Desc: 同花顺-分红情况
https://basic.10jqka.com.cn/new/603444/bonus.html
"""

from io import StringIO

import pandas as pd
import requests


def stock_fhps_detail_ths(symbol: str = "603444") -> pd.DataFrame:
"""
同花顺-分红融资
同花顺-分红情况
https://basic.10jqka.com.cn/new/603444/bonus.html
:param symbol: 股票代码
:type symbol: str
Expand All @@ -21,12 +24,28 @@ def stock_fhps_detail_ths(symbol: str = "603444") -> pd.DataFrame:
url = f"https://basic.10jqka.com.cn/new/{symbol}/bonus.html"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/89.0.4389.90 Safari/537.36",
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/89.0.4389.90 Safari/537.36",
}
r = requests.get(url, headers=headers)
r.encoding = "gbk"
temp_df = pd.read_html(r.text)[0]
temp_df = pd.read_html(StringIO(r.text))[0]
temp_df["董事会日期"] = pd.to_datetime(
temp_df["董事会日期"], format="%Y-%m-%d", errors="coerce"
).dt.date
temp_df["股东大会预案公告日期"] = pd.to_datetime(
temp_df["股东大会预案公告日期"], format="%Y-%m-%d", errors="coerce"
).dt.date
temp_df["实施公告日"] = pd.to_datetime(
temp_df["实施公告日"], format="%Y-%m-%d", errors="coerce"
).dt.date
temp_df["A股股权登记日"] = pd.to_datetime(
temp_df["A股股权登记日"], format="%Y-%m-%d", errors="coerce"
).dt.date
temp_df["A股除权除息日"] = pd.to_datetime(
temp_df["A股除权除息日"], format="%Y-%m-%d", errors="coerce"
).dt.date
temp_df.sort_values(by=["董事会日期"], ignore_index=True, inplace=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 @@ -78,6 +78,10 @@

## 更新说明详情

1.13.71 fix: fix stock_fhps_detail_ths interface

1. 修复 stock_fhps_detail_ths 接口

1.13.70 fix: fix stock_irm_cninfo interface

1. 修复 stock_irm_cninfo 接口
Expand Down Expand Up @@ -4073,6 +4077,8 @@

## 版本更新说明

1.13.71 fix: fix stock_fhps_detail_ths interface

1.13.70 fix: fix stock_irm_cninfo interface

1.13.69 fix: fix get_shfe_rank_table interface
Expand Down
39 changes: 21 additions & 18 deletions docs/data/stock/stock.md
Original file line number Diff line number Diff line change
Expand Up @@ -8681,15 +8681,15 @@ print(stock_fhps_detail_em_df)
8 2010-12-31 2011-03-31 10.0 ... 2011-05-20 实施分配 2011-05-16
```

#### 分红配送详情-同花顺
#### 分红情况-同花顺

接口: stock_fhps_detail_ths

目标地址: https://basic.10jqka.com.cn/new/603444/bonus.html

描述: 同花顺-分红融资
描述: 同花顺-分红情况

限量: 单次获取指定股票的分红融资数据
限量: 单次获取指定 symbol 的分红情况数据

输入参数

Expand Down Expand Up @@ -8725,21 +8725,24 @@ print(stock_fhps_detail_ths_df)
数据示例

```
报告期 董事会日期 股东大会预案公告日期 实施公告日 ... 分红总额 方案进度 股利支付率 税前分红率
0 2022年报 2023-03-31 -- -- ... 2.16亿 董事会预案 14.76% --
1 2022三季报 2022-10-27 2022-11-16 2022-12-22 ... 10.06亿 实施方案 99.43% 4.41%
2 2022中报 2022-08-16 -- -- ... -- 董事会预案 -- --
3 2021年报 2022-04-08 2022-04-30 2022-05-13 ... 11.50亿 实施方案 78.32% 4.78%
4 2021中报 2021-08-13 -- -- ... -- 董事会预案 -- --
5 2020年报 2021-03-31 2021-05-13 2021-05-31 ... 8.62亿 实施方案 82.3% 2.08%
6 2020中报 2020-08-18 -- -- ... -- 董事会预案 -- --
7 2019年报 2020-04-09 2020-04-30 2020-05-14 ... 3.59亿 实施方案 44.33% 1.17%
8 2019中报 2019-08-13 -- -- ... -- 董事会预案 -- --
9 2018年报 2019-04-10 2019-05-01 2019-05-16 ... 7.19亿 实施方案 98.81% 4.47%
10 2018中报 2018-08-14 -- -- ... -- 董事会预案 -- --
11 2017年报 2018-04-03 2018-04-25 2018-05-07 ... 1.87亿 实施方案 30.48% 1.66%
12 2017中报 2017-08-15 -- -- ... -- 董事会预案 -- --
13 2016年报 2017-03-28 2017-04-18 2017-04-28 ... 2.94亿 实施方案 37.37% 1.52%
报告期 董事会日期 股东大会预案公告日期 实施公告日 ... 分红总额 方案进度 股利支付率 税前分红率
0 2016年报 2017-03-28 2017-04-18 2017-04-28 ... 2.94亿 实施方案 37.37% 1.52%
1 2017中报 2017-08-15 NaT NaT ... -- 董事会预案 -- --
2 2017年报 2018-04-03 2018-04-25 2018-05-07 ... 1.87亿 实施方案 30.48% 1.66%
3 2018中报 2018-08-14 NaT NaT ... -- 董事会预案 -- --
4 2018年报 2019-04-10 2019-05-01 2019-05-16 ... 7.19亿 实施方案 98.81% 4.47%
5 2019中报 2019-08-13 NaT NaT ... -- 董事会预案 -- --
6 2019年报 2020-04-09 2020-04-30 2020-05-14 ... 3.59亿 实施方案 44.33% 1.17%
7 2020中报 2020-08-18 NaT NaT ... -- 董事会预案 -- --
8 2020年报 2021-03-31 2021-05-13 2021-05-31 ... 8.62亿 实施方案 82.3% 2.08%
9 2021中报 2021-08-13 NaT NaT ... -- 董事会预案 -- --
10 2021年报 2022-04-08 2022-04-30 2022-05-13 ... 11.50亿 实施方案 78.32% 4.78%
11 2022中报 2022-08-16 NaT NaT ... -- 董事会预案 -- --
12 2022三季报 2022-10-27 2022-11-16 2022-12-22 ... 10.06亿 实施方案 99.43% 4.41%
13 2022年报 2023-03-31 2023-04-22 2023-05-05 ... 2.16亿 实施方案 14.76% 0.61%
14 2023中报 2023-08-16 2023-09-09 2023-09-21 ... 5.04亿 实施方案 74.47% 1.88%
15 2023年报 2024-03-29 2024-04-19 NaT ... -- 股东大会预案 -- --
[16 rows x 11 columns]
```

#### 分红配送详情-港股-同花顺
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-05-12**
1. 本文档更新时间:**2024-05-13**
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. **知识星球【数据科学实战】** 2024 全新改版,聚焦于量化投资内容,欢迎加入 **知识星球【数据科学实战】** 高质量社区,里面有丰富的视频课程、问答、文章、书籍及代码等内容:
Expand Down

0 comments on commit 84ca36b

Please sign in to comment.