Skip to content

Commit

Permalink
version
Browse files Browse the repository at this point in the history
2.0.0
  • Loading branch information
1nchaos committed Apr 24, 2024
1 parent a88ba02 commit d92a66e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ master

专注股票量化数据,为Ai(爱)发电,向阳而生。

2.0.xb0 (2024-04-17)
2.0.0 (2024-04-24)
------------------
1. 新增:基金ETF行情接口。

2. 新增:股票股东信息接口。

1.2.4 (2024-02-02)
------------------
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ print(res_df)
| 数据 | API | 说明 | 备注 |
| ---------------- | ------------------------------------- | -------------------------------------- | ------------------------------------------------------------ |
| A股代码 | stock.info.all_code() | 所有A股代码信息 | |
| 股本信息 | stock.info.get_stock_shares() | 获取单只股票的股本信息 | 来源:东方财富 |
| **概念** | | | |
| 来源:同花顺 | | | |
| 概念代码 | stock.info.all_concept_code_ths() | 所有A股概念代码信息(同花顺) | 来源:同花顺公开数据 |
Expand Down
7 changes: 4 additions & 3 deletions adata/stock/info/stock_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pandas as pd

from adata.common import requests

from adata.common.utils.code_utils import compile_exchange_by_stock_code


Expand Down Expand Up @@ -36,13 +35,15 @@ def get_stock_shares(self, stock_code: str = '000033', is_history=True):
for _ in res_data:
data.append({'stock_code': _['SECURITY_CODE'], 'change_date': _['END_DATE'],
'total_shares': _['TOTAL_SHARES'],
'limit_shares': _['LIMITED_SHARES'], 'list_a_shares': _['LISTED_A_SHARES'],
'limit_shares': _['LIMITED_SHARES'],
'list_a_shares': int(_['LISTED_A_SHARES']) if _['LISTED_A_SHARES'] else _['LISTED_A_SHARES'],
'change_reason': _['CHANGE_REASON']})
result_df = pd.DataFrame(data=data, columns=self.__STOCK_SHARES_COLUMNS)
if not is_history:
result_df = result_df.iloc[0:1]
result_df['change_date'] = pd.to_datetime(result_df['change_date']).dt.strftime('%Y-%m-%d')
return result_df


if __name__ == '__main__':
print(StockInfo().get_stock_shares(stock_code='688192', is_history=False))
print(StockInfo().get_stock_shares(stock_code='600001', is_history=True))

0 comments on commit d92a66e

Please sign in to comment.