Skip to content
Merged

Dev #170

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ master

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

2.9.5 (2024-12-26)
------------------
1. 修复:ths热门概念等异常。
2. 新增:26y交易日缓存。

2.9.0 (2024-04-02)
------------------
1. 又是一年清明节,两年 2k star,感谢各位老铁的支持。
Expand Down
2 changes: 1 addition & 1 deletion adata/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

VERSION = (2, 9, 4)
VERSION = (2, 9, 5)
PRERELEASE = None # alpha, beta or rc
REVISION = None

Expand Down
5 changes: 4 additions & 1 deletion adata/common/utils/sunrequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def __get_proxies(self, proxies):
ip = requests.get(url=proxy_url).text.replace('\r\n', '') \
.replace('\r', '').replace('\n', '').replace('\t', '')
if is_proxy and ip:
proxies = {'https': f"http://{ip}", 'http': f"http://{ip}"}
if ip.startswith('http'):
proxies = {'https': f"{ip}", 'http': f"{ip}"}
else:
proxies = {'https': f"http://{ip}", 'http': f"http://{ip}"}
return proxies


Expand Down
18 changes: 11 additions & 7 deletions adata/sentiment/hot.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ def hot_rank_100_ths():
data = res.json()["data"]["stock_list"]
data_list = []
for d in data:
d["concept_tag"] = ";".join(d["tag"]["concept_tag"])
if "popularity_tag" in d["tag"]:
d["pop_tag"] = d["tag"]["popularity_tag"].replace("\n", "")
data_list.append(d)
try:
if "tag" in d and "concept_tag" in d["tag"]:
d["concept_tag"] = ";".join(d["tag"]["concept_tag"])
if "popularity_tag" in d["tag"]:
d["pop_tag"] = d["tag"]["popularity_tag"].replace("\n", "")
data_list.append(d)
except:
pass
rename = {
"order": "rank",
"rise_and_fall": "change_pct",
Expand Down Expand Up @@ -126,6 +130,6 @@ def hot_concept_20_ths(plate_type=1):

if __name__ == "__main__":
print(Hot().hot_rank_100_ths())
print(Hot().pop_rank_100_east())
print(Hot().hot_concept_20_ths(plate_type=1))
print(Hot().hot_concept_20_ths(plate_type=2))
# print(Hot().pop_rank_100_east())
# print(Hot().hot_concept_20_ths(plate_type=1))
# print(Hot().hot_concept_20_ths(plate_type=2))
Loading