diff --git a/HISTORY.md b/HISTORY.md index 133fc98..7363ce8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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,感谢各位老铁的支持。 diff --git a/adata/__version__.py b/adata/__version__.py index 00c732c..008ebf4 100644 --- a/adata/__version__.py +++ b/adata/__version__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -VERSION = (2, 9, 4) +VERSION = (2, 9, 5) PRERELEASE = None # alpha, beta or rc REVISION = None diff --git a/adata/common/utils/sunrequests.py b/adata/common/utils/sunrequests.py index 9fec0ed..eaf7c5f 100644 --- a/adata/common/utils/sunrequests.py +++ b/adata/common/utils/sunrequests.py @@ -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 diff --git a/adata/sentiment/hot.py b/adata/sentiment/hot.py index 1cdde54..f4c87a7 100644 --- a/adata/sentiment/hot.py +++ b/adata/sentiment/hot.py @@ -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", @@ -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)) diff --git a/adata/stock/cache/calendar/2026.csv b/adata/stock/cache/calendar/2026.csv new file mode 100644 index 0000000..7da89ae --- /dev/null +++ b/adata/stock/cache/calendar/2026.csv @@ -0,0 +1,366 @@ +trade_date,trade_status,day_week +2026-01-01,0,5 +2026-01-02,0,6 +2026-01-03,0,7 +2026-01-04,0,1 +2026-01-05,1,2 +2026-01-06,1,3 +2026-01-07,1,4 +2026-01-08,1,5 +2026-01-09,1,6 +2026-01-10,0,7 +2026-01-11,0,1 +2026-01-12,1,2 +2026-01-13,1,3 +2026-01-14,1,4 +2026-01-15,1,5 +2026-01-16,1,6 +2026-01-17,0,7 +2026-01-18,0,1 +2026-01-19,1,2 +2026-01-20,1,3 +2026-01-21,1,4 +2026-01-22,1,5 +2026-01-23,1,6 +2026-01-24,0,7 +2026-01-25,0,1 +2026-01-26,1,2 +2026-01-27,1,3 +2026-01-28,1,4 +2026-01-29,1,5 +2026-01-30,1,6 +2026-01-31,0,7 +2026-02-01,0,1 +2026-02-02,1,2 +2026-02-03,1,3 +2026-02-04,1,4 +2026-02-05,1,5 +2026-02-06,1,6 +2026-02-07,0,7 +2026-02-08,0,1 +2026-02-09,1,2 +2026-02-10,1,3 +2026-02-11,1,4 +2026-02-12,1,5 +2026-02-13,1,6 +2026-02-14,0,7 +2026-02-15,0,1 +2026-02-16,0,2 +2026-02-17,0,3 +2026-02-18,0,4 +2026-02-19,0,5 +2026-02-20,0,6 +2026-02-21,0,7 +2026-02-22,0,1 +2026-02-23,0,2 +2026-02-24,1,3 +2026-02-25,1,4 +2026-02-26,1,5 +2026-02-27,1,6 +2026-02-28,0,7 +2026-03-01,0,1 +2026-03-02,1,2 +2026-03-03,1,3 +2026-03-04,1,4 +2026-03-05,1,5 +2026-03-06,1,6 +2026-03-07,0,7 +2026-03-08,0,1 +2026-03-09,1,2 +2026-03-10,1,3 +2026-03-11,1,4 +2026-03-12,1,5 +2026-03-13,1,6 +2026-03-14,0,7 +2026-03-15,0,1 +2026-03-16,1,2 +2026-03-17,1,3 +2026-03-18,1,4 +2026-03-19,1,5 +2026-03-20,1,6 +2026-03-21,0,7 +2026-03-22,0,1 +2026-03-23,1,2 +2026-03-24,1,3 +2026-03-25,1,4 +2026-03-26,1,5 +2026-03-27,1,6 +2026-03-28,0,7 +2026-03-29,0,1 +2026-03-30,1,2 +2026-03-31,1,3 +2026-04-01,1,4 +2026-04-02,1,5 +2026-04-03,1,6 +2026-04-04,0,7 +2026-04-05,0,1 +2026-04-06,0,2 +2026-04-07,1,3 +2026-04-08,1,4 +2026-04-09,1,5 +2026-04-10,1,6 +2026-04-11,0,7 +2026-04-12,0,1 +2026-04-13,1,2 +2026-04-14,1,3 +2026-04-15,1,4 +2026-04-16,1,5 +2026-04-17,1,6 +2026-04-18,0,7 +2026-04-19,0,1 +2026-04-20,1,2 +2026-04-21,1,3 +2026-04-22,1,4 +2026-04-23,1,5 +2026-04-24,1,6 +2026-04-25,0,7 +2026-04-26,0,1 +2026-04-27,1,2 +2026-04-28,1,3 +2026-04-29,1,4 +2026-04-30,1,5 +2026-05-01,0,6 +2026-05-02,0,7 +2026-05-03,0,1 +2026-05-04,0,2 +2026-05-05,0,3 +2026-05-06,1,4 +2026-05-07,1,5 +2026-05-08,1,6 +2026-05-09,0,7 +2026-05-10,0,1 +2026-05-11,1,2 +2026-05-12,1,3 +2026-05-13,1,4 +2026-05-14,1,5 +2026-05-15,1,6 +2026-05-16,0,7 +2026-05-17,0,1 +2026-05-18,1,2 +2026-05-19,1,3 +2026-05-20,1,4 +2026-05-21,1,5 +2026-05-22,1,6 +2026-05-23,0,7 +2026-05-24,0,1 +2026-05-25,1,2 +2026-05-26,1,3 +2026-05-27,1,4 +2026-05-28,1,5 +2026-05-29,1,6 +2026-05-30,0,7 +2026-05-31,0,1 +2026-06-01,1,2 +2026-06-02,1,3 +2026-06-03,1,4 +2026-06-04,1,5 +2026-06-05,1,6 +2026-06-06,0,7 +2026-06-07,0,1 +2026-06-08,1,2 +2026-06-09,1,3 +2026-06-10,1,4 +2026-06-11,1,5 +2026-06-12,1,6 +2026-06-13,0,7 +2026-06-14,0,1 +2026-06-15,1,2 +2026-06-16,1,3 +2026-06-17,1,4 +2026-06-18,1,5 +2026-06-19,0,6 +2026-06-20,0,7 +2026-06-21,0,1 +2026-06-22,1,2 +2026-06-23,1,3 +2026-06-24,1,4 +2026-06-25,1,5 +2026-06-26,1,6 +2026-06-27,0,7 +2026-06-28,0,1 +2026-06-29,1,2 +2026-06-30,1,3 +2026-07-01,1,4 +2026-07-02,1,5 +2026-07-03,1,6 +2026-07-04,0,7 +2026-07-05,0,1 +2026-07-06,1,2 +2026-07-07,1,3 +2026-07-08,1,4 +2026-07-09,1,5 +2026-07-10,1,6 +2026-07-11,0,7 +2026-07-12,0,1 +2026-07-13,1,2 +2026-07-14,1,3 +2026-07-15,1,4 +2026-07-16,1,5 +2026-07-17,1,6 +2026-07-18,0,7 +2026-07-19,0,1 +2026-07-20,1,2 +2026-07-21,1,3 +2026-07-22,1,4 +2026-07-23,1,5 +2026-07-24,1,6 +2026-07-25,0,7 +2026-07-26,0,1 +2026-07-27,1,2 +2026-07-28,1,3 +2026-07-29,1,4 +2026-07-30,1,5 +2026-07-31,1,6 +2026-08-01,0,7 +2026-08-02,0,1 +2026-08-03,1,2 +2026-08-04,1,3 +2026-08-05,1,4 +2026-08-06,1,5 +2026-08-07,1,6 +2026-08-08,0,7 +2026-08-09,0,1 +2026-08-10,1,2 +2026-08-11,1,3 +2026-08-12,1,4 +2026-08-13,1,5 +2026-08-14,1,6 +2026-08-15,0,7 +2026-08-16,0,1 +2026-08-17,1,2 +2026-08-18,1,3 +2026-08-19,1,4 +2026-08-20,1,5 +2026-08-21,1,6 +2026-08-22,0,7 +2026-08-23,0,1 +2026-08-24,1,2 +2026-08-25,1,3 +2026-08-26,1,4 +2026-08-27,1,5 +2026-08-28,1,6 +2026-08-29,0,7 +2026-08-30,0,1 +2026-08-31,1,2 +2026-09-01,1,3 +2026-09-02,1,4 +2026-09-03,1,5 +2026-09-04,1,6 +2026-09-05,0,7 +2026-09-06,0,1 +2026-09-07,1,2 +2026-09-08,1,3 +2026-09-09,1,4 +2026-09-10,1,5 +2026-09-11,1,6 +2026-09-12,0,7 +2026-09-13,0,1 +2026-09-14,1,2 +2026-09-15,1,3 +2026-09-16,1,4 +2026-09-17,1,5 +2026-09-18,1,6 +2026-09-19,0,7 +2026-09-20,0,1 +2026-09-21,1,2 +2026-09-22,1,3 +2026-09-23,1,4 +2026-09-24,1,5 +2026-09-25,0,6 +2026-09-26,0,7 +2026-09-27,0,1 +2026-09-28,1,2 +2026-09-29,1,3 +2026-09-30,1,4 +2026-10-01,0,5 +2026-10-02,0,6 +2026-10-03,0,7 +2026-10-04,0,1 +2026-10-05,0,2 +2026-10-06,0,3 +2026-10-07,0,4 +2026-10-08,1,5 +2026-10-09,1,6 +2026-10-10,0,7 +2026-10-11,0,1 +2026-10-12,1,2 +2026-10-13,1,3 +2026-10-14,1,4 +2026-10-15,1,5 +2026-10-16,1,6 +2026-10-17,0,7 +2026-10-18,0,1 +2026-10-19,1,2 +2026-10-20,1,3 +2026-10-21,1,4 +2026-10-22,1,5 +2026-10-23,1,6 +2026-10-24,0,7 +2026-10-25,0,1 +2026-10-26,1,2 +2026-10-27,1,3 +2026-10-28,1,4 +2026-10-29,1,5 +2026-10-30,1,6 +2026-10-31,0,7 +2026-11-01,0,1 +2026-11-02,1,2 +2026-11-03,1,3 +2026-11-04,1,4 +2026-11-05,1,5 +2026-11-06,1,6 +2026-11-07,0,7 +2026-11-08,0,1 +2026-11-09,1,2 +2026-11-10,1,3 +2026-11-11,1,4 +2026-11-12,1,5 +2026-11-13,1,6 +2026-11-14,0,7 +2026-11-15,0,1 +2026-11-16,1,2 +2026-11-17,1,3 +2026-11-18,1,4 +2026-11-19,1,5 +2026-11-20,1,6 +2026-11-21,0,7 +2026-11-22,0,1 +2026-11-23,1,2 +2026-11-24,1,3 +2026-11-25,1,4 +2026-11-26,1,5 +2026-11-27,1,6 +2026-11-28,0,7 +2026-11-29,0,1 +2026-11-30,1,2 +2026-12-01,1,3 +2026-12-02,1,4 +2026-12-03,1,5 +2026-12-04,1,6 +2026-12-05,0,7 +2026-12-06,0,1 +2026-12-07,1,2 +2026-12-08,1,3 +2026-12-09,1,4 +2026-12-10,1,5 +2026-12-11,1,6 +2026-12-12,0,7 +2026-12-13,0,1 +2026-12-14,1,2 +2026-12-15,1,3 +2026-12-16,1,4 +2026-12-17,1,5 +2026-12-18,1,6 +2026-12-19,0,7 +2026-12-20,0,1 +2026-12-21,1,2 +2026-12-22,1,3 +2026-12-23,1,4 +2026-12-24,1,5 +2026-12-25,1,6 +2026-12-26,0,7 +2026-12-27,0,1 +2026-12-28,1,2 +2026-12-29,1,3 +2026-12-30,1,4 +2026-12-31,1,5