akshare 1.14.78__py3-none-any.whl → 1.14.79__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of akshare might be problematic. Click here for more details.

akshare/__init__.py CHANGED
@@ -2889,9 +2889,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2889
2889
  1.14.76 fix: fix stock_sy_em interface
2890
2890
  1.14.77 fix: fix stock_zh_b_daily interface
2891
2891
  1.14.78 fix: fix stock_analyst_rank_em interface
2892
+ 1.14.79 add: add stock_zcfz_bj_em interface
2892
2893
  """
2893
2894
 
2894
- __version__ = "1.14.78"
2895
+ __version__ = "1.14.79"
2895
2896
  __author__ = "AKFamily"
2896
2897
 
2897
2898
  import sys
@@ -4112,6 +4113,7 @@ from akshare.stock_fundamental.stock_ipo_declare import stock_ipo_declare
4112
4113
  """
4113
4114
  from akshare.stock_feature.stock_report_em import (
4114
4115
  stock_zcfz_em,
4116
+ stock_zcfz_bj_em,
4115
4117
  stock_lrb_em,
4116
4118
  stock_xjll_em,
4117
4119
  )
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/4/2 21:30
4
+ Date: 2024/9/20 15:30
5
5
  Desc: 东方财富-数据中心-年报季报-业绩快报-三大报表
6
6
  资产负债表
7
7
  https://data.eastmoney.com/bbsj/202003/zcfz.html
@@ -17,7 +17,7 @@ import requests
17
17
  from akshare.utils.tqdm import get_tqdm
18
18
 
19
19
 
20
- def stock_zcfz_em(date: str = "20220331") -> pd.DataFrame:
20
+ def stock_zcfz_em(date: str = "20240331") -> pd.DataFrame:
21
21
  """
22
22
  东方财富-数据中心-年报季报-业绩快报-资产负债表
23
23
  https://data.eastmoney.com/bbsj/202003/zcfz.html
@@ -158,6 +158,147 @@ def stock_zcfz_em(date: str = "20220331") -> pd.DataFrame:
158
158
  return big_df
159
159
 
160
160
 
161
+ def stock_zcfz_bj_em(date: str = "20240331") -> pd.DataFrame:
162
+ """
163
+ 东方财富-数据中心-年报季报-业绩快报-资产负债表
164
+ https://data.eastmoney.com/bbsj/202003/zcfz.html
165
+ :param date: choice of {"20200331", "20200630", "20200930", "20201231", "..."}; 从 20100331 开始
166
+ :type date: str
167
+ :return: 资产负债表
168
+ :rtype: pandas.DataFrame
169
+ """
170
+ import warnings
171
+
172
+ warnings.filterwarnings(action="ignore", category=FutureWarning)
173
+ url = "https://datacenter-web.eastmoney.com/api/data/v1/get"
174
+ params = {
175
+ "sortColumns": "NOTICE_DATE,SECURITY_CODE",
176
+ "sortTypes": "-1,-1",
177
+ "pageSize": "500",
178
+ "pageNumber": "1",
179
+ "reportName": "RPT_DMSK_FN_BALANCE",
180
+ "columns": "ALL",
181
+ "filter": f"""(TRADE_MARKET_CODE="069001017")
182
+ (REPORT_DATE='{'-'.join([date[:4], date[4:6], date[6:]])}')""",
183
+ }
184
+ r = requests.get(url, params=params)
185
+ data_json = r.json()
186
+ page_num = data_json["result"]["pages"]
187
+ big_df = pd.DataFrame()
188
+ tqdm = get_tqdm()
189
+ for page in tqdm(range(1, page_num + 1), leave=False):
190
+ params.update(
191
+ {
192
+ "pageNumber": page,
193
+ }
194
+ )
195
+ r = requests.get(url, params=params)
196
+ data_json = r.json()
197
+ temp_df = pd.DataFrame(data_json["result"]["data"])
198
+ big_df = pd.concat(objs=[big_df, temp_df], join="outer", ignore_index=True)
199
+
200
+ big_df.reset_index(inplace=True)
201
+ big_df["index"] = big_df.index + 1
202
+ big_df.columns = [
203
+ "序号",
204
+ "_",
205
+ "股票代码",
206
+ "_",
207
+ "_",
208
+ "股票简称",
209
+ "_",
210
+ "_",
211
+ "_",
212
+ "_",
213
+ "_",
214
+ "_",
215
+ "_",
216
+ "公告日期",
217
+ "_",
218
+ "资产-总资产",
219
+ "_",
220
+ "资产-货币资金",
221
+ "_",
222
+ "资产-应收账款",
223
+ "_",
224
+ "资产-存货",
225
+ "_",
226
+ "负债-总负债",
227
+ "负债-应付账款",
228
+ "_",
229
+ "负债-预收账款",
230
+ "_",
231
+ "股东权益合计",
232
+ "_",
233
+ "资产-总资产同比",
234
+ "负债-总负债同比",
235
+ "_",
236
+ "资产负债率",
237
+ "_",
238
+ "_",
239
+ "_",
240
+ "_",
241
+ "_",
242
+ "_",
243
+ "_",
244
+ "_",
245
+ "_",
246
+ "_",
247
+ "_",
248
+ "_",
249
+ "_",
250
+ "_",
251
+ "_",
252
+ "_",
253
+ "_",
254
+ "_",
255
+ "_",
256
+ "_",
257
+ "_",
258
+ "_",
259
+ "_",
260
+ "_",
261
+ ]
262
+ big_df = big_df[
263
+ [
264
+ "序号",
265
+ "股票代码",
266
+ "股票简称",
267
+ "资产-货币资金",
268
+ "资产-应收账款",
269
+ "资产-存货",
270
+ "资产-总资产",
271
+ "资产-总资产同比",
272
+ "负债-应付账款",
273
+ "负债-预收账款",
274
+ "负债-总负债",
275
+ "负债-总负债同比",
276
+ "资产负债率",
277
+ "股东权益合计",
278
+ "公告日期",
279
+ ]
280
+ ]
281
+
282
+ big_df["资产-货币资金"] = pd.to_numeric(big_df["资产-货币资金"], errors="coerce")
283
+ big_df["资产-应收账款"] = pd.to_numeric(big_df["资产-应收账款"], errors="coerce")
284
+ big_df["资产-存货"] = pd.to_numeric(big_df["资产-存货"], errors="coerce")
285
+ big_df["资产-总资产"] = pd.to_numeric(big_df["资产-总资产"], errors="coerce")
286
+ big_df["资产-总资产同比"] = pd.to_numeric(
287
+ big_df["资产-总资产同比"], errors="coerce"
288
+ )
289
+ big_df["负债-应付账款"] = pd.to_numeric(big_df["负债-应付账款"], errors="coerce")
290
+ big_df["负债-预收账款"] = pd.to_numeric(big_df["负债-预收账款"], errors="coerce")
291
+ big_df["负债-总负债"] = pd.to_numeric(big_df["负债-总负债"], errors="coerce")
292
+ big_df["负债-总负债同比"] = pd.to_numeric(
293
+ big_df["负债-总负债同比"], errors="coerce"
294
+ )
295
+ big_df["资产负债率"] = pd.to_numeric(big_df["资产负债率"], errors="coerce")
296
+ big_df["股东权益合计"] = pd.to_numeric(big_df["股东权益合计"], errors="coerce")
297
+ big_df["股东权益合计"] = pd.to_numeric(big_df["股东权益合计"], errors="coerce")
298
+ big_df["公告日期"] = pd.to_datetime(big_df["公告日期"], errors="coerce").dt.date
299
+ return big_df
300
+
301
+
161
302
  def stock_lrb_em(date: str = "20081231") -> pd.DataFrame:
162
303
  """
163
304
  东方财富-数据中心-年报季报-业绩快报-利润表
@@ -432,9 +573,12 @@ def stock_xjll_em(date: str = "20220331") -> pd.DataFrame:
432
573
 
433
574
 
434
575
  if __name__ == "__main__":
435
- stock_zcfz_em_df = stock_zcfz_em(date="20220331")
576
+ stock_zcfz_em_df = stock_zcfz_em(date="20240331")
436
577
  print(stock_zcfz_em_df)
437
578
 
579
+ stock_zcfz_bj_em_df = stock_zcfz_bj_em(date="20240331")
580
+ print(stock_zcfz_bj_em_df)
581
+
438
582
  stock_lrb_em_df = stock_lrb_em(date="20220331")
439
583
  print(stock_lrb_em_df)
440
584
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.14.78
3
+ Version: 1.14.79
4
4
  Summary: AKShare is an elegant and simple financial data interface library for Python, built for human beings!
5
5
  Home-page: https://github.com/akfamily/akshare
6
6
  Author: AKFamily
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=1hhjgDgUkwJJy4jo3abzWUtq08ur-7KLqzhHNQsysNc,181693
1
+ akshare/__init__.py,sha256=jTI2FOcVnJMp3lEtuyUTSE6vt4JZdEw_MsdW-jLVGHc,181759
2
2
  akshare/datasets.py,sha256=-qdwaQjgBlftX84uM74KJqCYJYkQ50PV416_neA4uls,995
3
3
  akshare/air/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
4
4
  akshare/air/air_hebei.py,sha256=xIXNGLK7IGYqrkteM9fxnHAwWqk6PCQs6D9-ggZ7byY,4442
@@ -333,7 +333,7 @@ akshare/stock_feature/stock_margin_szse.py,sha256=KUxJ4lsLKi_pp934RAKWgJskfkVk4n
333
333
  akshare/stock_feature/stock_market_legu.py,sha256=_LeyGUGyZFeD-1fnJPc4eIQkeoWAmoc92aikwYW7EdU,1897
334
334
  akshare/stock_feature/stock_pankou_em.py,sha256=HEQJAp9bx6i0SlERl_klp6Tp2PCPgR-J_fKU4i277Bc,5285
335
335
  akshare/stock_feature/stock_qsjy_em.py,sha256=7EHroLZC3-X_3WNhb7GV9MPQHbxjtkfKI_YEbTvnSb0,3913
336
- akshare/stock_feature/stock_report_em.py,sha256=L_4alI4Rl14deGioCvF5BB34yvfWCpdmlrIVtuNSxec,13648
336
+ akshare/stock_feature/stock_report_em.py,sha256=3qABnvXSi_dBl8PZc3DPvVlVyH0i3P2966PjH-ll9dM,18075
337
337
  akshare/stock_feature/stock_research_report_em.py,sha256=XFQadpUI2l0-Ik8BQWf-eCC4uFC1xxt9VNiZ9NU2zp0,4888
338
338
  akshare/stock_feature/stock_sns_sseinfo.py,sha256=TGGLw5P77Hh-sSHgw_KKoK29d1m_V_2GDQXe9m_XFew,4556
339
339
  akshare/stock_feature/stock_sy_em.py,sha256=GdqjWH8uVy_8st2sYENgzNlJRQxkTajDkaHBwX31pjc,17721
@@ -380,8 +380,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
380
380
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
381
381
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
382
382
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
383
- akshare-1.14.78.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.14.78.dist-info/METADATA,sha256=8BPp0KkoBJHt9tfu04cd05-zoeUQD9ihwC28xZGbhGI,14112
385
- akshare-1.14.78.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
386
- akshare-1.14.78.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.14.78.dist-info/RECORD,,
383
+ akshare-1.14.79.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
+ akshare-1.14.79.dist-info/METADATA,sha256=m78fAlOPBmwPkKMAkcUxP39ku44AgQCI4hGQKif2P6w,14112
385
+ akshare-1.14.79.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
386
+ akshare-1.14.79.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
+ akshare-1.14.79.dist-info/RECORD,,