akshare 1.16.64__py3-none-any.whl → 1.16.66__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.
Files changed (176) hide show
  1. akshare/__init__.py +3 -1
  2. akshare/air/cons.py +1 -0
  3. akshare/air/crypto.js +1 -1
  4. akshare/air/outcrypto.js +1 -1
  5. akshare/article/cons.py +1 -0
  6. akshare/article/epu_index.py +4 -3
  7. akshare/article/ff_factor.py +19 -8
  8. akshare/article/fred_md.py +4 -1
  9. akshare/article/risk_rv.py +3 -8
  10. akshare/bond/bond_cb_sina.py +1 -0
  11. akshare/bond/bond_cbond.py +19 -14
  12. akshare/bond/bond_em.py +34 -15
  13. akshare/bond/bond_summary.py +38 -37
  14. akshare/bond/bond_zh_cov.py +0 -6
  15. akshare/bond/cons.py +14 -11
  16. akshare/crypto/__init__.py +1 -1
  17. akshare/crypto/crypto_bitcoin_cme.py +7 -7
  18. akshare/crypto/crypto_hold.py +4 -1
  19. akshare/currency/currency.py +1 -0
  20. akshare/currency/currency_china_bank_sina.py +6 -3
  21. akshare/data/__init__.py +1 -1
  22. akshare/data/cninfo.js +1 -1
  23. akshare/economic/cons.py +10 -3
  24. akshare/economic/macro_australia.py +0 -7
  25. akshare/economic/macro_canada.py +92 -81
  26. akshare/economic/macro_china.py +0 -34
  27. akshare/economic/macro_china_hk.py +0 -1
  28. akshare/economic/macro_euro.py +103 -56
  29. akshare/economic/macro_germany.py +1 -1
  30. akshare/economic/macro_japan.py +0 -1
  31. akshare/economic/macro_other.py +1 -6
  32. akshare/economic/macro_swiss.py +2 -3
  33. akshare/economic/macro_uk.py +1 -1
  34. akshare/economic/macro_usa.py +0 -2
  35. akshare/energy/energy_carbon.py +0 -1
  36. akshare/energy/energy_oil_em.py +1 -2
  37. akshare/event/cons.py +1 -0
  38. akshare/forex/forex_em.py +0 -1
  39. akshare/fortune/fortune_bloomberg.py +6 -3
  40. akshare/fortune/fortune_forbes_500.py +3 -6
  41. akshare/fortune/fortune_hurun.py +2 -1
  42. akshare/fortune/fortune_xincaifu_500.py +17 -14
  43. akshare/fund/fund_announcement.py +1 -0
  44. akshare/fund/fund_aum_em.py +47 -35
  45. akshare/fund/fund_em.py +0 -7
  46. akshare/fund/fund_etf_em.py +0 -5
  47. akshare/fund/fund_fhsp_em.py +27 -20
  48. akshare/fund/fund_init_em.py +8 -5
  49. akshare/fund/fund_lof_em.py +0 -5
  50. akshare/fund/fund_manager.py +18 -7
  51. akshare/fund/fund_portfolio_em.py +0 -1
  52. akshare/fund/fund_position_lg.py +19 -8
  53. akshare/fund/fund_rank_em.py +0 -3
  54. akshare/fund/fund_rating.py +28 -9
  55. akshare/fund/fund_scale_em.py +24 -13
  56. akshare/futures/futures_comex_em.py +1 -0
  57. akshare/futures/futures_contract_detail.py +11 -8
  58. akshare/futures/futures_inventory_em.py +0 -2
  59. akshare/futures/futures_rule.py +5 -1
  60. akshare/futures/futures_settlement_price_sgx.py +21 -6
  61. akshare/futures/futures_stock_js.py +0 -1
  62. akshare/futures/receipt.py +279 -153
  63. akshare/futures/requests_fun.py +16 -3
  64. akshare/futures_derivative/cons.py +100 -103
  65. akshare/futures_derivative/futures_contract_info_cffex.py +53 -39
  66. akshare/futures_derivative/futures_contract_info_dce.py +16 -9
  67. akshare/futures_derivative/futures_contract_info_gfex.py +43 -31
  68. akshare/futures_derivative/futures_index_sina.py +25 -13
  69. akshare/fx/cons.py +12 -7
  70. akshare/fx/fx_quote.py +1 -0
  71. akshare/fx/fx_quote_baidu.py +2 -1
  72. akshare/hf/__init__.py +1 -1
  73. akshare/hf/hf_sp500.py +8 -7
  74. akshare/index/index_eri.py +1 -0
  75. akshare/index/index_global_em.py +0 -1
  76. akshare/index/index_kq_fz.py +17 -14
  77. akshare/index/index_kq_ss.py +1 -0
  78. akshare/index/index_stock_hk.py +0 -1
  79. akshare/index/index_stock_zh.py +0 -3
  80. akshare/index/index_sugar.py +18 -4
  81. akshare/index/index_zh_em.py +0 -15
  82. akshare/interest_rate/interbank_rate_em.py +0 -1
  83. akshare/movie/jm.js +0 -1
  84. akshare/news/__init__.py +1 -1
  85. akshare/news/news_stock.py +0 -1
  86. akshare/option/option_commodity_sina.py +22 -26
  87. akshare/option/option_daily_stats_sse_szse.py +0 -1
  88. akshare/option/option_em.py +0 -1
  89. akshare/option/option_lhb_em.py +0 -1
  90. akshare/option/option_risk_indicator_sse.py +0 -1
  91. akshare/other/__init__.py +1 -1
  92. akshare/pro/__init__.py +0 -1
  93. akshare/pro/client.py +6 -4
  94. akshare/pro/cons.py +3 -2
  95. akshare/pro/data_pro.py +6 -5
  96. akshare/qhkc/qhkc_api.py +63 -21
  97. akshare/qhkc_web/qhkc_fund.py +1 -0
  98. akshare/qhkc_web/qhkc_index.py +1 -0
  99. akshare/qhkc_web/qhkc_tool.py +55 -54
  100. akshare/rate/__init__.py +1 -1
  101. akshare/rate/repo_rate.py +36 -32
  102. akshare/reits/__init__.py +1 -1
  103. akshare/reits/reits_basic.py +44 -2
  104. akshare/sport/__init__.py +1 -1
  105. akshare/sport/sport_olympic.py +1 -0
  106. akshare/spot/__init__.py +1 -1
  107. akshare/stock/cons.py +19 -12
  108. akshare/stock/stock_board_concept_em.py +0 -6
  109. akshare/stock/stock_board_industry_em.py +0 -6
  110. akshare/stock/stock_dzjy_em.py +1 -1
  111. akshare/stock/stock_fund_em.py +0 -2
  112. akshare/stock/stock_fund_hold.py +1 -2
  113. akshare/stock/stock_gsrl_em.py +1 -0
  114. akshare/stock/stock_hk_famous.py +0 -1
  115. akshare/stock/stock_hk_fhpx_ths.py +2 -1
  116. akshare/stock/stock_hk_hot_rank_em.py +1 -0
  117. akshare/stock/stock_hold_control_em.py +0 -2
  118. akshare/stock/stock_hot_up_em.py +4 -1
  119. akshare/stock/stock_hsgt_em.py +0 -2
  120. akshare/stock/stock_industry.py +1 -0
  121. akshare/stock/stock_info.py +0 -2
  122. akshare/stock/stock_info_em.py +0 -1
  123. akshare/stock/stock_repurchase_em.py +7 -2
  124. akshare/stock/stock_share_hold.py +0 -1
  125. akshare/stock/stock_stop.py +0 -1
  126. akshare/stock/stock_summary.py +0 -2
  127. akshare/stock/stock_us_famous.py +0 -1
  128. akshare/stock/stock_us_js.py +3 -2
  129. akshare/stock/stock_us_pink.py +0 -1
  130. akshare/stock/stock_weibo_nlp.py +18 -20
  131. akshare/stock/stock_zh_a_special.py +0 -3
  132. akshare/stock/stock_zh_a_tick_tx.py +11 -3
  133. akshare/stock_a/stock_board_concept_name_em.py +0 -1
  134. akshare/stock_a/stock_zh_a_spot.py +0 -1
  135. akshare/stock_feature/cons.py +1 -0
  136. akshare/stock_feature/stock_account_em.py +0 -1
  137. akshare/stock_feature/stock_all_pb.py +2 -1
  138. akshare/stock_feature/stock_analyst_em.py +0 -3
  139. akshare/stock_feature/stock_buffett_index_lg.py +7 -6
  140. akshare/stock_feature/stock_classify_sina.py +3 -6
  141. akshare/stock_feature/stock_comment_em.py +0 -2
  142. akshare/stock_feature/stock_congestion_lg.py +2 -1
  143. akshare/stock_feature/stock_dxsyl_em.py +116 -71
  144. akshare/stock_feature/stock_gdzjc_em.py +16 -5
  145. akshare/stock_feature/stock_gxl_lg.py +3 -2
  146. akshare/stock_feature/stock_hist_em.py +0 -20
  147. akshare/stock_feature/stock_hist_tx.py +10 -8
  148. akshare/stock_feature/stock_hot_xq.py +4 -6
  149. akshare/stock_feature/stock_hsgt_em.py +0 -2
  150. akshare/stock_feature/stock_hsgt_exchange_rate.py +0 -2
  151. akshare/stock_feature/stock_hsgt_min_em.py +13 -16
  152. akshare/stock_feature/stock_inner_trade_xq.py +0 -1
  153. akshare/stock_feature/stock_lhb_em.py +0 -1
  154. akshare/stock_feature/stock_margin_em.py +0 -1
  155. akshare/stock_feature/stock_margin_sse.py +0 -2
  156. akshare/stock_feature/stock_pankou_em.py +0 -2
  157. akshare/stock_feature/stock_qsjy_em.py +13 -4
  158. akshare/stock_feature/stock_research_report_em.py +0 -1
  159. akshare/stock_feature/stock_yjyg_cninfo.py +4 -1
  160. akshare/stock_feature/stock_yjyg_em.py +1 -1
  161. akshare/stock_feature/stock_zh_vote_baidu.py +4 -1
  162. akshare/stock_feature/stock_ztb_em.py +0 -6
  163. akshare/stock_fundamental/__init__.py +1 -1
  164. akshare/stock_fundamental/stock_hold.py +26 -17
  165. akshare/stock_fundamental/stock_ipo_declare.py +1 -0
  166. akshare/stock_fundamental/stock_kcb_detail_sse.py +10 -10
  167. akshare/stock_fundamental/stock_kcb_sse.py +26 -25
  168. akshare/stock_fundamental/stock_profit_forecast_hk_etnet.py +64 -41
  169. akshare/stock_fundamental/stock_recommend.py +20 -4
  170. akshare/utils/demjson.py +2007 -1336
  171. akshare/utils/token_process.py +6 -5
  172. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/METADATA +12 -35
  173. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/RECORD +176 -176
  174. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/WHEEL +0 -0
  175. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/licenses/LICENSE +0 -0
  176. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/top_level.txt +0 -0
@@ -5,6 +5,7 @@ Date: 2023/9/5 15:41
5
5
  Desc: 芝加哥商业交易所-比特币成交量报告
6
6
  https://datacenter.jin10.com/reportType/dc_cme_btc_report
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -21,7 +22,6 @@ def crypto_bitcoin_cme(date: str = "20230830") -> pd.DataFrame:
21
22
  "category": "cme",
22
23
  "date": "-".join([date[:4], date[4:6], date[6:]]),
23
24
  "attr_id": "4",
24
- "_": "1624354777843",
25
25
  }
26
26
  headers = {
27
27
  "accept": "*/*",
@@ -47,12 +47,12 @@ def crypto_bitcoin_cme(date: str = "20230830") -> pd.DataFrame:
47
47
  [item for item in data_json["data"]["values"]],
48
48
  columns=[item["name"] for item in data_json["data"]["keys"]],
49
49
  )
50
- temp_df['电子交易合约'] = pd.to_numeric(temp_df['电子交易合约'], errors="coerce")
51
- temp_df['场内成交合约'] = pd.to_numeric(temp_df['场内成交合约'], errors="coerce")
52
- temp_df['场外成交合约'] = pd.to_numeric(temp_df['场外成交合约'], errors="coerce")
53
- temp_df['成交量'] = pd.to_numeric(temp_df['成交量'], errors="coerce")
54
- temp_df['未平仓合约'] = pd.to_numeric(temp_df['未平仓合约'], errors="coerce")
55
- temp_df['持仓变化'] = pd.to_numeric(temp_df['持仓变化'], errors="coerce")
50
+ temp_df["电子交易合约"] = pd.to_numeric(temp_df["电子交易合约"], errors="coerce")
51
+ temp_df["场内成交合约"] = pd.to_numeric(temp_df["场内成交合约"], errors="coerce")
52
+ temp_df["场外成交合约"] = pd.to_numeric(temp_df["场外成交合约"], errors="coerce")
53
+ temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce")
54
+ temp_df["未平仓合约"] = pd.to_numeric(temp_df["未平仓合约"], errors="coerce")
55
+ temp_df["持仓变化"] = pd.to_numeric(temp_df["持仓变化"], errors="coerce")
56
56
  return temp_df
57
57
 
58
58
 
@@ -5,6 +5,7 @@ Date: 2023/8/31 23:00
5
5
  Desc: 金十数据-比特币持仓报告
6
6
  https://datacenter.jin10.com/dc_report?name=bitcoint
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -62,7 +63,9 @@ def crypto_bitcoin_hold_report():
62
63
  ]
63
64
  ]
64
65
  temp_df["市值"] = pd.to_numeric(temp_df["市值"], errors="coerce")
65
- temp_df["比特币占市值比重"] = pd.to_numeric(temp_df["比特币占市值比重"], errors="coerce")
66
+ temp_df["比特币占市值比重"] = pd.to_numeric(
67
+ temp_df["比特币占市值比重"], errors="coerce"
68
+ )
66
69
  temp_df["持仓成本"] = pd.to_numeric(temp_df["持仓成本"], errors="coerce")
67
70
  temp_df["持仓占比"] = pd.to_numeric(temp_df["持仓占比"], errors="coerce")
68
71
  temp_df["持仓量"] = pd.to_numeric(temp_df["持仓量"], errors="coerce")
@@ -6,6 +6,7 @@ Desc: currencybeacon 提供的外汇数据
6
6
  该网站需要先注册后获取 API 使用
7
7
  https://currencyscoop.com/
8
8
  """
9
+
9
10
  import pandas as pd
10
11
  import requests
11
12
 
@@ -5,6 +5,7 @@ Date: 2023/11/10 15:20
5
5
  Desc: 新浪财经-中行人民币牌价历史数据查询
6
6
  https://biz.finance.sina.com.cn/forex/forex.php?startdate=2012-01-01&enddate=2021-06-14&money_code=EUR&type=0
7
7
  """
8
+
8
9
  from functools import lru_cache
9
10
  from io import StringIO
10
11
 
@@ -16,7 +17,7 @@ from tqdm import tqdm
16
17
 
17
18
  @lru_cache()
18
19
  def _currency_boc_sina_map(
19
- start_date: str = "20210614", end_date: str = "20230810"
20
+ start_date: str = "20210614", end_date: str = "20230810"
20
21
  ) -> dict:
21
22
  """
22
23
  外汇 symbol 和代码映射
@@ -54,7 +55,7 @@ def _currency_boc_sina_map(
54
55
 
55
56
 
56
57
  def currency_boc_sina(
57
- symbol: str = "美元", start_date: str = "20230304", end_date: str = "20231110"
58
+ symbol: str = "美元", start_date: str = "20230304", end_date: str = "20231110"
58
59
  ) -> pd.DataFrame:
59
60
  """
60
61
  新浪财经-中行人民币牌价历史数据查询
@@ -99,7 +100,9 @@ def currency_boc_sina(
99
100
  big_df["日期"] = pd.to_datetime(big_df["日期"], errors="coerce").dt.date
100
101
  big_df["中行汇买价"] = pd.to_numeric(big_df["中行汇买价"], errors="coerce")
101
102
  big_df["中行钞买价"] = pd.to_numeric(big_df["中行钞买价"], errors="coerce")
102
- big_df["中行钞卖价/汇卖价"] = pd.to_numeric(big_df["中行钞卖价/汇卖价"], errors="coerce")
103
+ big_df["中行钞卖价/汇卖价"] = pd.to_numeric(
104
+ big_df["中行钞卖价/汇卖价"], errors="coerce"
105
+ )
103
106
  big_df["央行中间价"] = pd.to_numeric(big_df["央行中间价"], errors="coerce")
104
107
  big_df.sort_values(by=["日期"], inplace=True, ignore_index=True)
105
108
  return big_df
akshare/data/__init__.py CHANGED
@@ -2,5 +2,5 @@
2
2
  # !/usr/bin/env python
3
3
  """
4
4
  Date: 2022/5/9 18:08
5
- Desc:
5
+ Desc:
6
6
  """
akshare/data/cninfo.js CHANGED
@@ -6013,4 +6013,4 @@ function new_my_decode(data) {
6013
6013
  }
6014
6014
  );
6015
6015
  return decrypted.toString(CryptoJS.enc.Utf8);
6016
- }
6016
+ }
akshare/economic/cons.py CHANGED
@@ -4,6 +4,7 @@
4
4
  Date: 2019/10/21 21:11
5
5
  Desc: 宏观经济配置文件
6
6
  """
7
+
7
8
  # urls-china
8
9
  JS_CHINA_CPI_YEARLY_URL = (
9
10
  "https://cdn.jin10.com/dc/reports/dc_chinese_cpi_yoy_all.js?v={}&_={}"
@@ -24,7 +25,9 @@ JS_CHINA_GDP_YEARLY_URL = (
24
25
  "https://cdn.jin10.com/dc/reports/dc_chinese_gdp_yoy_all.js?v={}&_={}"
25
26
  )
26
27
  JS_CHINA_CX_PMI_YEARLY_URL = "https://cdn.jin10.com/dc/reports/dc_chinese_caixin_manufacturing_pmi_all.js?v={}&_={}"
27
- JS_CHINA_CX_SERVICE_PMI_YEARLY_URL = "https://cdn.jin10.com/dc/reports/dc_chinese_caixin_services_pmi_all.js?v={}&_={}"
28
+ JS_CHINA_CX_SERVICE_PMI_YEARLY_URL = (
29
+ "https://cdn.jin10.com/dc/reports/dc_chinese_caixin_services_pmi_all.js?v={}&_={}"
30
+ )
28
31
  JS_CHINA_FX_RESERVES_YEARLY_URL = (
29
32
  "https://cdn.jin10.com/dc/reports/dc_chinese_fx_reserves_all.js?v={}&_={}"
30
33
  )
@@ -35,8 +38,12 @@ JS_CHINA_NON_MAN_PMI_MONTHLY_URL = (
35
38
  "https://cdn.jin10.com/dc/reports/dc_chinese_non_manufacturing_pmi_all.js?v={}&_={}"
36
39
  )
37
40
  JS_CHINA_RMB_DAILY_URL = "https://cdn.jin10.com/dc/reports/dc_rmb_data_all.js?v={}&_={}"
38
- JS_CHINA_MARKET_MARGIN_SZ_URL = "https://cdn.jin10.com/dc/reports/dc_market_margin_sz_all.js?v={}&_={}"
39
- JS_CHINA_MARKET_MARGIN_SH_URL = "https://cdn.jin10.com/dc/reports/dc_market_margin_sse_all.js?v={}&_={}"
41
+ JS_CHINA_MARKET_MARGIN_SZ_URL = (
42
+ "https://cdn.jin10.com/dc/reports/dc_market_margin_sz_all.js?v={}&_={}"
43
+ )
44
+ JS_CHINA_MARKET_MARGIN_SH_URL = (
45
+ "https://cdn.jin10.com/dc/reports/dc_market_margin_sse_all.js?v={}&_={}"
46
+ )
40
47
  JS_CHINA_REPORT_URL = "https://cdn.jin10.com/dc/reports/dc_sge_report_all.js?v={}&_={}"
41
48
 
42
49
  # urls-usa
@@ -32,7 +32,6 @@ def macro_australia_retail_rate_monthly() -> pd.DataFrame:
32
32
  "p": "1",
33
33
  "pageNo": "1",
34
34
  "pageNum": "1",
35
- "_": "1669047266881",
36
35
  }
37
36
  r = requests.get(url, params=params)
38
37
  data_json = r.json()
@@ -84,7 +83,6 @@ def macro_australia_trade() -> pd.DataFrame:
84
83
  "p": "1",
85
84
  "pageNo": "1",
86
85
  "pageNum": "1",
87
- "_": "1669047266881",
88
86
  }
89
87
  r = requests.get(url, params=params)
90
88
  data_json = r.json()
@@ -136,7 +134,6 @@ def macro_australia_unemployment_rate() -> pd.DataFrame:
136
134
  "p": "1",
137
135
  "pageNo": "1",
138
136
  "pageNum": "1",
139
- "_": "1669047266881",
140
137
  }
141
138
  r = requests.get(url, params=params)
142
139
  data_json = r.json()
@@ -188,7 +185,6 @@ def macro_australia_ppi_quarterly() -> pd.DataFrame:
188
185
  "p": "1",
189
186
  "pageNo": "1",
190
187
  "pageNum": "1",
191
- "_": "1669047266881",
192
188
  }
193
189
  r = requests.get(url, params=params)
194
190
  data_json = r.json()
@@ -240,7 +236,6 @@ def macro_australia_cpi_quarterly() -> pd.DataFrame:
240
236
  "p": "1",
241
237
  "pageNo": "1",
242
238
  "pageNum": "1",
243
- "_": "1669047266881",
244
239
  }
245
240
  r = requests.get(url, params=params)
246
241
  data_json = r.json()
@@ -292,7 +287,6 @@ def macro_australia_cpi_yearly() -> pd.DataFrame:
292
287
  "p": "1",
293
288
  "pageNo": "1",
294
289
  "pageNum": "1",
295
- "_": "1669047266881",
296
290
  }
297
291
  r = requests.get(url, params=params)
298
292
  data_json = r.json()
@@ -344,7 +338,6 @@ def macro_australia_bank_rate() -> pd.DataFrame:
344
338
  "p": "1",
345
339
  "pageNo": "1",
346
340
  "pageNum": "1",
347
- "_": "1669047266881",
348
341
  }
349
342
  r = requests.get(url, params=params)
350
343
  data_json = r.json()
@@ -5,6 +5,7 @@ Date: 2022/11/27 20:30
5
5
  Desc: 东方财富-经济数据-加拿大
6
6
  https://data.eastmoney.com/cjsj/foreign_5_0.html
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -31,7 +32,6 @@ def macro_canada_new_house_rate() -> pd.DataFrame:
31
32
  "p": "1",
32
33
  "pageNo": "1",
33
34
  "pageNum": "1",
34
- "_": "1669047266881",
35
35
  }
36
36
  r = requests.get(url, params=params)
37
37
  data_json = r.json()
@@ -47,15 +47,17 @@ def macro_canada_new_house_rate() -> pd.DataFrame:
47
47
  "现值",
48
48
  "前值",
49
49
  ]
50
- temp_df = temp_df[[
51
- "时间",
52
- "前值",
53
- "现值",
54
- "发布日期",
55
- ]]
50
+ temp_df = temp_df[
51
+ [
52
+ "时间",
53
+ "前值",
54
+ "现值",
55
+ "发布日期",
56
+ ]
57
+ ]
56
58
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
57
59
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
58
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
60
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
59
61
  return temp_df
60
62
 
61
63
 
@@ -81,7 +83,6 @@ def macro_canada_unemployment_rate() -> pd.DataFrame:
81
83
  "p": "1",
82
84
  "pageNo": "1",
83
85
  "pageNum": "1",
84
- "_": "1669047266881",
85
86
  }
86
87
  r = requests.get(url, params=params)
87
88
  data_json = r.json()
@@ -97,15 +98,17 @@ def macro_canada_unemployment_rate() -> pd.DataFrame:
97
98
  "现值",
98
99
  "前值",
99
100
  ]
100
- temp_df = temp_df[[
101
- "时间",
102
- "前值",
103
- "现值",
104
- "发布日期",
105
- ]]
101
+ temp_df = temp_df[
102
+ [
103
+ "时间",
104
+ "前值",
105
+ "现值",
106
+ "发布日期",
107
+ ]
108
+ ]
106
109
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
107
110
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
108
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
111
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
109
112
  return temp_df
110
113
 
111
114
 
@@ -131,7 +134,6 @@ def macro_canada_trade() -> pd.DataFrame:
131
134
  "p": "1",
132
135
  "pageNo": "1",
133
136
  "pageNum": "1",
134
- "_": "1669047266881",
135
137
  }
136
138
  r = requests.get(url, params=params)
137
139
  data_json = r.json()
@@ -147,15 +149,17 @@ def macro_canada_trade() -> pd.DataFrame:
147
149
  "现值",
148
150
  "前值",
149
151
  ]
150
- temp_df = temp_df[[
151
- "时间",
152
- "前值",
153
- "现值",
154
- "发布日期",
155
- ]]
152
+ temp_df = temp_df[
153
+ [
154
+ "时间",
155
+ "前值",
156
+ "现值",
157
+ "发布日期",
158
+ ]
159
+ ]
156
160
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
157
161
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
158
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
162
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
159
163
  return temp_df
160
164
 
161
165
 
@@ -181,7 +185,6 @@ def macro_canada_retail_rate_monthly() -> pd.DataFrame:
181
185
  "p": "1",
182
186
  "pageNo": "1",
183
187
  "pageNum": "1",
184
- "_": "1669047266881",
185
188
  }
186
189
  r = requests.get(url, params=params)
187
190
  data_json = r.json()
@@ -197,15 +200,17 @@ def macro_canada_retail_rate_monthly() -> pd.DataFrame:
197
200
  "现值",
198
201
  "前值",
199
202
  ]
200
- temp_df = temp_df[[
201
- "时间",
202
- "前值",
203
- "现值",
204
- "发布日期",
205
- ]]
203
+ temp_df = temp_df[
204
+ [
205
+ "时间",
206
+ "前值",
207
+ "现值",
208
+ "发布日期",
209
+ ]
210
+ ]
206
211
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
207
212
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
208
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
213
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
209
214
  return temp_df
210
215
 
211
216
 
@@ -231,7 +236,6 @@ def macro_canada_bank_rate() -> pd.DataFrame:
231
236
  "p": "1",
232
237
  "pageNo": "1",
233
238
  "pageNum": "1",
234
- "_": "1669047266881",
235
239
  }
236
240
  r = requests.get(url, params=params)
237
241
  data_json = r.json()
@@ -247,15 +251,17 @@ def macro_canada_bank_rate() -> pd.DataFrame:
247
251
  "现值",
248
252
  "前值",
249
253
  ]
250
- temp_df = temp_df[[
251
- "时间",
252
- "前值",
253
- "现值",
254
- "发布日期",
255
- ]]
254
+ temp_df = temp_df[
255
+ [
256
+ "时间",
257
+ "前值",
258
+ "现值",
259
+ "发布日期",
260
+ ]
261
+ ]
256
262
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
257
263
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
258
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
264
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
259
265
  return temp_df
260
266
 
261
267
 
@@ -281,7 +287,6 @@ def macro_canada_core_cpi_yearly() -> pd.DataFrame:
281
287
  "p": "1",
282
288
  "pageNo": "1",
283
289
  "pageNum": "1",
284
- "_": "1669047266881",
285
290
  }
286
291
  r = requests.get(url, params=params)
287
292
  data_json = r.json()
@@ -297,15 +302,17 @@ def macro_canada_core_cpi_yearly() -> pd.DataFrame:
297
302
  "现值",
298
303
  "前值",
299
304
  ]
300
- temp_df = temp_df[[
301
- "时间",
302
- "前值",
303
- "现值",
304
- "发布日期",
305
- ]]
305
+ temp_df = temp_df[
306
+ [
307
+ "时间",
308
+ "前值",
309
+ "现值",
310
+ "发布日期",
311
+ ]
312
+ ]
306
313
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
307
314
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
308
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
315
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
309
316
  return temp_df
310
317
 
311
318
 
@@ -331,7 +338,6 @@ def macro_canada_core_cpi_monthly() -> pd.DataFrame:
331
338
  "p": "1",
332
339
  "pageNo": "1",
333
340
  "pageNum": "1",
334
- "_": "1669047266881",
335
341
  }
336
342
  r = requests.get(url, params=params)
337
343
  data_json = r.json()
@@ -347,15 +353,17 @@ def macro_canada_core_cpi_monthly() -> pd.DataFrame:
347
353
  "现值",
348
354
  "前值",
349
355
  ]
350
- temp_df = temp_df[[
351
- "时间",
352
- "前值",
353
- "现值",
354
- "发布日期",
355
- ]]
356
+ temp_df = temp_df[
357
+ [
358
+ "时间",
359
+ "前值",
360
+ "现值",
361
+ "发布日期",
362
+ ]
363
+ ]
356
364
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
357
365
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
358
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
366
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
359
367
  return temp_df
360
368
 
361
369
 
@@ -381,7 +389,6 @@ def macro_canada_cpi_yearly() -> pd.DataFrame:
381
389
  "p": "1",
382
390
  "pageNo": "1",
383
391
  "pageNum": "1",
384
- "_": "1669047266881",
385
392
  }
386
393
  r = requests.get(url, params=params)
387
394
  data_json = r.json()
@@ -397,15 +404,17 @@ def macro_canada_cpi_yearly() -> pd.DataFrame:
397
404
  "现值",
398
405
  "前值",
399
406
  ]
400
- temp_df = temp_df[[
401
- "时间",
402
- "前值",
403
- "现值",
404
- "发布日期",
405
- ]]
407
+ temp_df = temp_df[
408
+ [
409
+ "时间",
410
+ "前值",
411
+ "现值",
412
+ "发布日期",
413
+ ]
414
+ ]
406
415
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
407
416
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
408
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
417
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
409
418
  return temp_df
410
419
 
411
420
 
@@ -431,7 +440,6 @@ def macro_canada_cpi_monthly() -> pd.DataFrame:
431
440
  "p": "1",
432
441
  "pageNo": "1",
433
442
  "pageNum": "1",
434
- "_": "1669047266881",
435
443
  }
436
444
  r = requests.get(url, params=params)
437
445
  data_json = r.json()
@@ -447,15 +455,17 @@ def macro_canada_cpi_monthly() -> pd.DataFrame:
447
455
  "现值",
448
456
  "前值",
449
457
  ]
450
- temp_df = temp_df[[
451
- "时间",
452
- "前值",
453
- "现值",
454
- "发布日期",
455
- ]]
458
+ temp_df = temp_df[
459
+ [
460
+ "时间",
461
+ "前值",
462
+ "现值",
463
+ "发布日期",
464
+ ]
465
+ ]
456
466
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
457
467
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
458
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
468
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
459
469
  return temp_df
460
470
 
461
471
 
@@ -481,7 +491,6 @@ def macro_canada_gdp_monthly() -> pd.DataFrame:
481
491
  "p": "1",
482
492
  "pageNo": "1",
483
493
  "pageNum": "1",
484
- "_": "1669047266881",
485
494
  }
486
495
  r = requests.get(url, params=params)
487
496
  data_json = r.json()
@@ -497,19 +506,21 @@ def macro_canada_gdp_monthly() -> pd.DataFrame:
497
506
  "现值",
498
507
  "前值",
499
508
  ]
500
- temp_df = temp_df[[
501
- "时间",
502
- "前值",
503
- "现值",
504
- "发布日期",
505
- ]]
509
+ temp_df = temp_df[
510
+ [
511
+ "时间",
512
+ "前值",
513
+ "现值",
514
+ "发布日期",
515
+ ]
516
+ ]
506
517
  temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
507
518
  temp_df["现值"] = pd.to_numeric(temp_df["现值"], errors="coerce")
508
- temp_df['发布日期'] = pd.to_datetime(temp_df['发布日期']).dt.date
519
+ temp_df["发布日期"] = pd.to_datetime(temp_df["发布日期"]).dt.date
509
520
  return temp_df
510
521
 
511
522
 
512
- if __name__ == '__main__':
523
+ if __name__ == "__main__":
513
524
  macro_canada_new_house_rate_df = macro_canada_new_house_rate()
514
525
  print(macro_canada_new_house_rate_df)
515
526