From c098eeb9cb763e7e33e6effbb411cd1de704dd5a Mon Sep 17 00:00:00 2001 From: 1nchaos Date: Thu, 14 Nov 2024 00:22:50 +0800 Subject: [PATCH 1/3] add Concept flow --- .../market/concept_capital_flow/concept_flow.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 adata/stock/market/concept_capital_flow/concept_flow.py diff --git a/adata/stock/market/concept_capital_flow/concept_flow.py b/adata/stock/market/concept_capital_flow/concept_flow.py new file mode 100644 index 0000000..76cf0bb --- /dev/null +++ b/adata/stock/market/concept_capital_flow/concept_flow.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +""" +@desc: 概念资金流向 + +东方财富:概念 +https://data.eastmoney.com/bkzj/gn.html +@author: 1nchaos +@time: 2024/11/14 +@log: change log +""" + + +class ConceptCapitalFlow(object): + """概念资金流向""" + + def __init__(self) -> None: + super().__init__() From 0b0b2d743a48b3f08dcbdfeb6bbc58265adaf72c Mon Sep 17 00:00:00 2001 From: 1nchaos <9527@1nchaos.com> Date: Mon, 2 Dec 2024 17:56:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fixed=20issues=EF=BC=9A114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adata/__version__.py | 2 +- .../market/capital_flow/stock_capital_flow_east.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/adata/__version__.py b/adata/__version__.py index c1978dc..3d5f9f0 100644 --- a/adata/__version__.py +++ b/adata/__version__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -VERSION = (2, 7, 1) +VERSION = (2, 7, 2) PRERELEASE = None # alpha, beta or rc REVISION = None diff --git a/adata/stock/market/capital_flow/stock_capital_flow_east.py b/adata/stock/market/capital_flow/stock_capital_flow_east.py index 7778ff3..e5da550 100644 --- a/adata/stock/market/capital_flow/stock_capital_flow_east.py +++ b/adata/stock/market/capital_flow/stock_capital_flow_east.py @@ -75,9 +75,19 @@ def get_capital_flow(self, stock_code: str = '000001', start_date=None, end_date df = df.astype({'main_net_inflow': 'float64', 'sm_net_inflow': 'float64', 'mid_net_inflow': 'float64', 'lg_net_inflow': 'float64', 'max_net_inflow': 'float64' }) + + # 4. 范围筛选 + df['trade_date'] = pd.to_datetime(df['trade_date']) + if start_date is not None: + start_date = pd.to_datetime(start_date) + df = df[df['trade_date'] >= start_date] + if end_date is not None: + end_date = pd.to_datetime(end_date) + df = df[df['trade_date'] <= end_date] + df['trade_date'] = pd.to_datetime(df['trade_date']).dt.strftime('%Y-%m-%d') return df if __name__ == '__main__': print(StockCapitalFlowEast().get_capital_flow_min(stock_code='300059')) - print(StockCapitalFlowEast().get_capital_flow(stock_code='000001')) + print(StockCapitalFlowEast().get_capital_flow(stock_code='000001', start_date='2024-12-01')) From 4e5de7857cbe559d81fb16389676aef93618d8fc Mon Sep 17 00:00:00 2001 From: 1nchaos <9527@1nchaos.com> Date: Mon, 2 Dec 2024 18:02:30 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fixed=20issues=EF=BC=9A114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d9b0539..0875670 100644 --- a/README.md +++ b/README.md @@ -278,9 +278,9 @@ print(res_df) > 对于项目有支持,包括但不仅限:内容贡献,bug提交,思想交流等等,对项目有影响的个人和机构 -| Simon | [bigbigbigfish](https://github.com/bigbigbigfish) | [LuneZ99](https://github.com/LuneZ99) | 匿名用户 | thue | [Triones009](https://github.com/Triones009) | **[adaaaaaa](https://github.com/adaaaaaa)** | **[LeslieWuboy](https://github.com/LeslieWuboy)** | [yinzhengxin](https://github.com/yinzhengxin) | -| ------------------------------------- | ------------------------------------------------- | --------------------------------------------- | -------- | --------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------------- | --------------------------------------------- | -| [yxm0513](https://github.com/yxm0513) | [hanxuanliang](https://github.com/hanxuanliang) | [akihara-sam](https://github.com/akihara-sam) | Andy | [baei2048](https://github.com/baei2048) | [zpsakura](https://github.com/zpsakura) | [Yzx-1024](https://github.com/Yzx-1024) | | | +| Simon | [bigbigbigfish](https://github.com/bigbigbigfish) | [LuneZ99](https://github.com/LuneZ99) | 匿名用户 | thue | [Triones009](https://github.com/Triones009) | **[adaaaaaa](https://github.com/adaaaaaa)** | **[LeslieWuboy](https://github.com/LeslieWuboy)** | [yinzhengxin](https://github.com/yinzhengxin) | +| ------------------------------------- | ------------------------------------------------- | --------------------------------------------- | -------- | --------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------------------- | --------------------------------------------- | +| [yxm0513](https://github.com/yxm0513) | [hanxuanliang](https://github.com/hanxuanliang) | [akihara-sam](https://github.com/akihara-sam) | Andy | [baei2048](https://github.com/baei2048) | [zpsakura](https://github.com/zpsakura) | [Yzx-1024](https://github.com/Yzx-1024) | [Snowfall-in-June](https://github.com/Snowfall-in-June) | | ----------------------------------------------------------------------