akshare 1.15.51__py3-none-any.whl → 1.15.52__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
@@ -2961,9 +2961,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2961
2961
  1.15.49 fix: fix option_dce_daily interface
2962
2962
  1.15.50 fix: fix stock_gpzy_profile_em interface
2963
2963
  1.15.51 fix: fix stock_gpzy_pledge_ratio_em interface
2964
+ 1.15.52 fix: fix stock_zh_index_hist_csindex interface
2964
2965
  """
2965
2966
 
2966
- __version__ = "1.15.51"
2967
+ __version__ = "1.15.52"
2967
2968
  __author__ = "AKFamily"
2968
2969
 
2969
2970
  import sys
@@ -3147,11 +3148,6 @@ from akshare.stock_feature.stock_hist_tx import stock_zh_a_hist_tx
3147
3148
  """
3148
3149
  from akshare.stock_feature.stock_cyq_em import stock_cyq_em
3149
3150
 
3150
- """
3151
- funddb-工具-估值情绪-恐贪指数
3152
- """
3153
- from akshare.index.index_fear_greed_funddb import index_fear_greed_funddb
3154
-
3155
3151
  """
3156
3152
  东财财富-分时数据
3157
3153
  """
@@ -3728,14 +3724,6 @@ from akshare.stock_feature.stock_hsgt_em import (
3728
3724
  stock_hsgt_fund_flow_summary_em,
3729
3725
  )
3730
3726
 
3731
- """
3732
- 指数估值
3733
- """
3734
- from akshare.index.index_stock_zh_csindex import (
3735
- index_value_hist_funddb,
3736
- index_value_name_funddb,
3737
- )
3738
-
3739
3727
  """
3740
3728
  基金规模
3741
3729
  """
@@ -1,203 +1,15 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/7/6 17:00
4
+ Date: 2024/12/23 17:00
5
5
  Desc: 中证指数-所有指数-历史行情数据
6
6
  https://www.csindex.com.cn/zh-CN/indices/index-detail/H30374#/indices/family/list?index_series=1
7
7
  """
8
8
 
9
- import hashlib
10
- import time
11
- from functools import lru_cache
12
-
13
9
  import pandas as pd
14
10
  import requests
15
11
 
16
12
 
17
- def __get_current_timestamp_ms() -> int:
18
- """
19
- 生成时间戳
20
- :return: 时间戳
21
- :rtype: int
22
- """
23
- timestamp_seconds = time.time()
24
- timestamp_ms = int(timestamp_seconds * 1000)
25
- return timestamp_ms
26
-
27
-
28
- def __md5_hash(input_string) -> str:
29
- """
30
- 生成 md5 加密后的值
31
- :return: 生成 md5 加密后的值
32
- :rtype: str
33
- """
34
- md5 = hashlib.md5()
35
- md5.update(input_string.encode("utf-8"))
36
- return md5.hexdigest()
37
-
38
-
39
- def __create_encode(
40
- act_time="1688635494326",
41
- authtoken="",
42
- gu_code="399808.SZ",
43
- pe_category="pb",
44
- type="pc",
45
- ver="new",
46
- version="2.2.7",
47
- year=-1,
48
- ) -> dict:
49
- """
50
- 生成 post 密文,需要 JS 观察如下文件:
51
- https://funddb.cn/static/js/app.1c429c670c72542fb4fd.js
52
- :return: 生成 post 密文
53
- :rtype: str
54
- """
55
- input_string = f"{act_time}{authtoken}{gu_code}{pe_category}{type}{ver}{version}{year}EWf45rlv#kfsr@k#gfksgkr"
56
- hash_value = __md5_hash(input_string)
57
- l = hash_value # noqa: E741
58
- c = l[29:31]
59
- d = l[2:4]
60
- f = l[5:6]
61
- h = l[26:27]
62
- m = l[6:8]
63
- v = l[1:2]
64
- y = l[0:2]
65
- k = l[6:8]
66
- w = l[8:9]
67
- x = l[30:31]
68
- P = l[11:14]
69
- z = l[11:12]
70
- j = l[2:5]
71
- q = l[9:11]
72
- H = l[23:25]
73
- O = l[31:32] # noqa: E741
74
- C = l[25:27]
75
- E = l[9:11]
76
- A = l[27:29]
77
- T = l[17:19]
78
- F = l[26:27]
79
- U = l[12:14]
80
- S = l[25:26]
81
- R = l[16:19]
82
- K = l[17:21]
83
- I = l[18:19] # noqa: E741
84
- D = l[21:23]
85
- _ = l[
86
- 14:16
87
- ] # $ is not a valid variable name in Python, so I replaced it with an underscore
88
- B = l[29:32]
89
- N = l[21:23]
90
- V = l[24:26]
91
- Y = l[16:17]
92
-
93
- def b(
94
- t,
95
- e,
96
- n,
97
- i,
98
- a,
99
- r,
100
- o,
101
- l, # noqa: E741
102
- u,
103
- c,
104
- s,
105
- d,
106
- _,
107
- f,
108
- h,
109
- p,
110
- m,
111
- g,
112
- v,
113
- y,
114
- b,
115
- k,
116
- w,
117
- x,
118
- P,
119
- z,
120
- j,
121
- q,
122
- H,
123
- O, # noqa: E741
124
- C,
125
- E,
126
- A,
127
- ):
128
- t["data"]["tirgkjfs"] = f
129
- t["data"]["abiokytke"] = _
130
- t["data"]["u54rg5d"] = e
131
- t["data"]["kf54ge7"] = q
132
- t["data"]["tiklsktr4"] = d
133
- t["data"]["lksytkjh"] = z
134
- t["data"]["sbnoywr"] = j
135
- t["data"]["bgd7h8tyu54"] = w
136
- t["data"]["y654b5fs3tr"] = C
137
- t["data"]["bioduytlw"] = n
138
- t["data"]["bd4uy742"] = P
139
- t["data"]["h67456y"] = o
140
- t["data"]["bvytikwqjk"] = s
141
- t["data"]["ngd4uy551"] = b
142
- t["data"]["bgiuytkw"] = v
143
- t["data"]["nd354uy4752"] = g
144
- t["data"]["ghtoiutkmlg"] = x
145
- t["data"]["bd24y6421f"] = i
146
- t["data"]["tbvdiuytk"] = l
147
- t["data"]["ibvytiqjek"] = p
148
- t["data"]["jnhf8u5231"] = A
149
- t["data"]["fjlkatj"] = E
150
- t["data"]["hy5641d321t"] = H
151
- t["data"]["iogojti"] = r
152
- t["data"]["ngd4yut78"] = a
153
- t["data"]["nkjhrew"] = c
154
- t["data"]["yt447e13f"] = O
155
- t["data"]["n3bf4uj7y7"] = k
156
- t["data"]["nbf4uj7y432"] = h
157
- t["data"]["yi854tew"] = u
158
- t["data"]["h13ey474"] = m
159
- t["data"]["quikgdky"] = y
160
-
161
- t = {"data": {}}
162
-
163
- b(
164
- t,
165
- d,
166
- f,
167
- V,
168
- U,
169
- S,
170
- R,
171
- Y,
172
- c,
173
- h,
174
- m,
175
- v,
176
- N,
177
- y,
178
- D,
179
- _,
180
- B,
181
- x,
182
- E,
183
- A,
184
- T,
185
- I,
186
- k,
187
- P,
188
- F,
189
- K,
190
- H,
191
- O,
192
- C,
193
- w,
194
- z,
195
- j,
196
- q,
197
- )
198
- return t["data"]
199
-
200
-
201
13
  def stock_zh_index_hist_csindex(
202
14
  symbol: str = "000928",
203
15
  start_date: str = "20180526",
@@ -243,7 +55,7 @@ def stock_zh_index_hist_csindex(
243
55
  "样本数量",
244
56
  "滚动市盈率",
245
57
  ]
246
- temp_df["日期"] = pd.to_datetime(temp_df["日期"]).dt.date
58
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
247
59
  temp_df["开盘"] = pd.to_numeric(temp_df["开盘"], errors="coerce")
248
60
  temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce")
249
61
  temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce")
@@ -293,176 +105,6 @@ def stock_zh_index_value_csindex(symbol: str = "H30374") -> pd.DataFrame:
293
105
  return temp_df
294
106
 
295
107
 
296
- @lru_cache()
297
- def index_value_name_funddb() -> pd.DataFrame:
298
- """
299
- funddb-指数估值-指数代码
300
- https://funddb.cn/site/index
301
- :return: pandas.DataFrame
302
- :rtype: 指数代码
303
- """
304
- url = "https://api.jiucaishuo.com/v2/guzhi/showcategory"
305
- get_current_timestamp_ms_str = __get_current_timestamp_ms()
306
- encode_params = __create_encode(
307
- act_time=str(get_current_timestamp_ms_str),
308
- authtoken="",
309
- gu_code="",
310
- pe_category="",
311
- type="pc",
312
- ver="",
313
- version="2.2.7",
314
- year="",
315
- )
316
- payload = {
317
- "type": "pc",
318
- "version": "2.2.7",
319
- "authtoken": "",
320
- "act_time": str(get_current_timestamp_ms_str),
321
- }
322
- payload.update(encode_params)
323
- r = requests.post(url, json=payload)
324
- data_json = r.json()
325
- temp_df = pd.DataFrame(data_json["data"]["right_list"])
326
- temp_df.columns = [
327
- "指数开始时间",
328
- "-",
329
- "指数名称",
330
- "指数代码",
331
- "最新PE",
332
- "最新PB",
333
- "PE分位",
334
- "PB分位",
335
- "股息率",
336
- "-",
337
- "-",
338
- "-",
339
- "更新时间",
340
- "股息率分位",
341
- "-",
342
- "-",
343
- "-",
344
- "-",
345
- "-",
346
- "-",
347
- "-",
348
- "-",
349
- "-",
350
- "-",
351
- "-",
352
- "-",
353
- "-",
354
- "-",
355
- "-",
356
- "-",
357
- ]
358
- temp_df = temp_df[
359
- [
360
- "指数名称",
361
- "最新PE",
362
- "PE分位",
363
- "最新PB",
364
- "PB分位",
365
- "股息率",
366
- "股息率分位",
367
- "指数代码",
368
- "指数开始时间",
369
- "更新时间",
370
- ]
371
- ]
372
- temp_df["指数开始时间"] = pd.to_datetime(
373
- temp_df["指数开始时间"], errors="coerce"
374
- ).dt.date
375
- temp_df["最新PE"] = pd.to_numeric(temp_df["最新PE"], errors="coerce")
376
- temp_df["PE分位"] = pd.to_numeric(temp_df["PE分位"], errors="coerce")
377
- temp_df["最新PB"] = pd.to_numeric(temp_df["最新PB"], errors="coerce")
378
- temp_df["PB分位"] = pd.to_numeric(temp_df["PB分位"], errors="coerce")
379
- temp_df["股息率"] = pd.to_numeric(temp_df["股息率"], errors="coerce")
380
- temp_df["股息率分位"] = pd.to_numeric(temp_df["股息率分位"], errors="coerce")
381
- return temp_df
382
-
383
-
384
- def index_value_hist_funddb(
385
- symbol: str = "大盘成长", indicator: str = "市盈率", year: str = "-1"
386
- ) -> pd.DataFrame:
387
- """
388
- funddb-指数估值-估值信息
389
- https://funddb.cn/site/index
390
- :param symbol: 指数名称; 通过调用 ak.index_value_name_funddb() 来获取
391
- :type symbol: str
392
- :param indicator: choice of {'市盈率', '市净率', '股息率', '风险溢价'}
393
- :type indicator: str
394
- :param year: choice of {'-1': "所有", '3': "近3年", '5': "近5年", '10': "近10年"}
395
- :type year: str
396
- :return: 估值信息
397
- :rtype: pandas.DataFrame
398
- """
399
- indicator_map = {
400
- "市盈率": "pe",
401
- "市净率": "pb",
402
- "股息率": "xilv",
403
- "风险溢价": "fed",
404
- }
405
- index_value_name_funddb_df = index_value_name_funddb()
406
- name_code_map = dict(
407
- zip(
408
- index_value_name_funddb_df["指数名称"],
409
- index_value_name_funddb_df["指数代码"],
410
- )
411
- )
412
- url = "https://api.jiucaishuo.com/v2/guzhi/newtubiaolinedata"
413
- get_current_timestamp_ms_str = __get_current_timestamp_ms()
414
- encode_params = __create_encode(
415
- act_time=str(get_current_timestamp_ms_str),
416
- authtoken="",
417
- gu_code=name_code_map[symbol],
418
- pe_category=indicator_map[indicator],
419
- type="pc",
420
- ver="new",
421
- version="2.2.7",
422
- year=int(year),
423
- )
424
- payload = {
425
- "gu_code": name_code_map[symbol],
426
- "pe_category": indicator_map[indicator],
427
- "year": int(year),
428
- "ver": "new",
429
- "type": "pc",
430
- "version": "2.2.7",
431
- "authtoken": "",
432
- "act_time": str(get_current_timestamp_ms_str),
433
- }
434
- payload.update(encode_params)
435
- r = requests.post(url, json=payload)
436
- data_json = r.json()
437
- big_df = pd.DataFrame()
438
- temp_df = pd.DataFrame(
439
- data_json["data"]["tubiao"]["series"][0]["data"],
440
- columns=["timestamp", "value"],
441
- )
442
- big_df["日期"] = (
443
- pd.to_datetime(temp_df["timestamp"], unit="ms", utc=True)
444
- .dt.tz_convert("Asia/Shanghai")
445
- .dt.date
446
- )
447
- big_df["平均值"] = pd.to_numeric(temp_df["value"])
448
- big_df[indicator] = pd.to_numeric(
449
- [item[1] for item in data_json["data"]["tubiao"]["series"][1]["data"]]
450
- )
451
- big_df["最低30"] = pd.to_numeric(
452
- [item[1] for item in data_json["data"]["tubiao"]["series"][2]["data"]]
453
- )
454
- big_df["最低10"] = pd.to_numeric(
455
- [item[1] for item in data_json["data"]["tubiao"]["series"][3]["data"]]
456
- )
457
- big_df["最高30"] = pd.to_numeric(
458
- [item[1] for item in data_json["data"]["tubiao"]["series"][4]["data"]]
459
- )
460
- big_df["最高10"] = pd.to_numeric(
461
- [item[1] for item in data_json["data"]["tubiao"]["series"][5]["data"]]
462
- )
463
- return big_df
464
-
465
-
466
108
  if __name__ == "__main__":
467
109
  stock_zh_index_hist_csindex_df = stock_zh_index_hist_csindex(
468
110
  symbol="000928", start_date="20100101", end_date="20240604"
@@ -471,11 +113,3 @@ if __name__ == "__main__":
471
113
 
472
114
  stock_zh_index_value_csindex_df = stock_zh_index_value_csindex(symbol="H30374")
473
115
  print(stock_zh_index_value_csindex_df)
474
-
475
- index_value_name_funddb_df = index_value_name_funddb()
476
- print(index_value_name_funddb_df)
477
-
478
- index_value_hist_funddb_df = index_value_hist_funddb(
479
- symbol="大盘成长", indicator="市盈率", year="-1"
480
- )
481
- print(index_value_hist_funddb_df)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.15.51
3
+ Version: 1.15.52
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=enlu3yvTdssFK9ultKiulg2pjakyGFCiirI0id7EBcs,184737
1
+ akshare/__init__.py,sha256=_c70BHqGSSHjYPF9CgmWM2rWlOGB7-w5wbqE1qPolek,184536
2
2
  akshare/datasets.py,sha256=-qdwaQjgBlftX84uM74KJqCYJYkQ50PV416_neA4uls,995
3
3
  akshare/exceptions.py,sha256=WEJjIhSmJ_xXNW6grwV4nufE_cfmmyuhmueVGiN1VAg,878
4
4
  akshare/request.py,sha256=HtFFf9MhfEibR-ETWe-1Tts6ELU4VKSqA-ghaXjegQM,4252
@@ -157,7 +157,6 @@ akshare/index/index_cons.py,sha256=3jrDfdxhNr9c4NVsTVOyORZwKBFNUU8giERYoIKkUUY,7
157
157
  akshare/index/index_cx.py,sha256=aAmsIKkswKFNOhAsW0QOhp-q6q1aFOSBtqcDaZhIh6A,16775
158
158
  akshare/index/index_drewry.py,sha256=BM7V6P8K4QUFQArsdaWRu5qJUZaCoyNz97_b8dmLeCw,2937
159
159
  akshare/index/index_eri.py,sha256=7X0KNDBntEkE_qSb2jb6IBv-S8PsevLFdxGT8nKT3W0,2111
160
- akshare/index/index_fear_greed_funddb.py,sha256=7Z6GqYkKPJHNHMEN-uZNu2KnNNLTWvJcVlYpfAShJJc,2378
161
160
  akshare/index/index_hog.py,sha256=kb867BVagt70_ycZMn22ks5Z9jlVbMiuTsvq5ygjeig,1657
162
161
  akshare/index/index_kq_fz.py,sha256=Y-cbxWLpRyGcFcMSDxZZQXdAuD85IuQH5xC2rhtGbRc,3395
163
162
  akshare/index/index_kq_ss.py,sha256=m4hAMNnzHk8JNAnKjkYYVeyG4zUC5zR5i0-u-OxmaGU,3333
@@ -168,7 +167,7 @@ akshare/index/index_spot.py,sha256=HrXt2QC9i1pYEh7wyJPKjtexctzSIUyMjEzk5BQq_K8,1
168
167
  akshare/index/index_stock_hk.py,sha256=nPFzRrjyiUpRK-OSDsdi5AFCKHNKqOVji6WJcQxOvNo,9781
169
168
  akshare/index/index_stock_us_sina.py,sha256=IxOk4G49oasv7EfEQenL9-GLuelyUus6c4JPyRlaOzY,1551
170
169
  akshare/index/index_stock_zh.py,sha256=A-tfbz6KHTLmBJimSzvaINrdmkWJ8V-mUkjcy7ly258,17669
171
- akshare/index/index_stock_zh_csindex.py,sha256=jVF29Byn2guaZ4QsXwwL1C5qtqk_m1ja-dgDnKnfz8s,13267
170
+ akshare/index/index_stock_zh_csindex.py,sha256=fIgPyhjbjd8JuREXNZRXEBbKAi4qQh8NaDPSc4k1k5k,4197
172
171
  akshare/index/index_sugar.py,sha256=B_Nj9Q6JP-Y_d7myZ0C79izTxxrbuZIp1Vv_CilVMOc,5006
173
172
  akshare/index/index_sw.py,sha256=hETMmFszQb7JDY8UHjLK8szfwkr7Ui_6QcseOoEfxaI,10456
174
173
  akshare/index/index_yw.py,sha256=6FF38kooLQulnMTqAd1__TNWip4XC1VA72k3T049xYc,4319
@@ -380,8 +379,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
380
379
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
381
380
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
382
381
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
383
- akshare-1.15.51.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.15.51.dist-info/METADATA,sha256=AM8ozZOv4s_KJTomr5Tvk7NeLqBqFv6SjmJENJ1JpBI,13423
385
- akshare-1.15.51.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
386
- akshare-1.15.51.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.15.51.dist-info/RECORD,,
382
+ akshare-1.15.52.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
383
+ akshare-1.15.52.dist-info/METADATA,sha256=GfRVN6XAskJOvwQjjtJdJZviEpJLncP0omIwlfZTi8Q,13423
384
+ akshare-1.15.52.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
385
+ akshare-1.15.52.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
386
+ akshare-1.15.52.dist-info/RECORD,,
@@ -1,78 +0,0 @@
1
- # -*- coding:utf-8 -*-
2
- # !/usr/bin/env python
3
- """
4
- Date: 2024/4/21 17:00
5
- Desc: funddb-工具-估值情绪-恐惧贪婪指数
6
- https://funddb.cn/tool/fear
7
- """
8
-
9
- import json
10
-
11
- import pandas as pd
12
- import requests
13
- import py_mini_racer
14
-
15
- from akshare.datasets import get_ths_js
16
-
17
-
18
- def _get_file_content_ths(file: str = "cninfo.js") -> str:
19
- """
20
- 获取 JS 文件的内容
21
- :param file: JS 文件名
22
- :type file: str
23
- :return: 文件内容
24
- :rtype: str
25
- """
26
- setting_file_path = get_ths_js(file)
27
- with open(setting_file_path, encoding="utf8") as f:
28
- file_data = f.read()
29
- return file_data
30
-
31
-
32
- def index_fear_greed_funddb(symbol: str = "上证指数") -> pd.DataFrame:
33
- """
34
- funddb-工具-估值情绪-恐惧贪婪指数
35
- https://funddb.cn/tool/fear
36
- :param symbol: choice of {"上证指数", "沪深300"}
37
- :type symbol: str
38
- :return: 恐惧贪婪指数
39
- :rtype: pandas.DataFrame
40
- """
41
- symbol_map = {
42
- "上证指数": "000001.SH",
43
- "沪深300": "000300.SH",
44
- }
45
- url = "https://api.jiucaishuo.com/v2/kjtl/kjtlconnect"
46
- payload = {
47
- "gu_code": symbol_map[symbol],
48
- "type": "h5",
49
- "version": "2.4.5",
50
- "act_time": 1697623588394,
51
- }
52
- r = requests.post(url, json=payload)
53
- data_json = r.json()
54
- js_code = py_mini_racer.MiniRacer()
55
- js_content = _get_file_content_ths("cninfo.js")
56
- js_code.eval(js_content)
57
- mcode = js_code.call("new_my_decode", data_json)
58
- data_json = json.loads(mcode)
59
- date_list = data_json["data"]["xAxis"]["categories"]
60
- tl_list = data_json["data"]["series"][0]["data"]
61
- sz_list = data_json["data"]["series"][1]["data"]
62
- temp_df = pd.DataFrame([date_list, tl_list, sz_list]).T
63
- temp_df.columns = ["date", "fear", "index"]
64
- temp_df["date"] = pd.to_datetime(temp_df["date"], errors="coerce").dt.date
65
- temp_df["fear"] = pd.to_numeric(temp_df["fear"], errors="coerce")
66
- temp_df["index"] = pd.to_numeric(temp_df["index"], errors="coerce")
67
-
68
- temp_df["fear"] = temp_df["fear"].round(2)
69
- temp_df["index"] = temp_df["index"].round(2)
70
- return temp_df
71
-
72
-
73
- if __name__ == "__main__":
74
- index_fear_greed_funddb_df = index_fear_greed_funddb(symbol="上证指数")
75
- print(index_fear_greed_funddb_df)
76
-
77
- index_fear_greed_funddb_df = index_fear_greed_funddb(symbol="沪深300")
78
- print(index_fear_greed_funddb_df)