python-quanta 0.4.7__tar.gz → 0.5.0__tar.gz

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 (72) hide show
  1. python_quanta-0.5.0/PKG-INFO +204 -0
  2. python_quanta-0.5.0/README.md +175 -0
  3. {python_quanta-0.4.7 → python_quanta-0.5.0}/pyproject.toml +1 -1
  4. python_quanta-0.5.0/src/python_quanta.egg-info/PKG-INFO +204 -0
  5. python_quanta-0.4.7/PKG-INFO +0 -34
  6. python_quanta-0.4.7/README.md +0 -5
  7. python_quanta-0.4.7/src/python_quanta.egg-info/PKG-INFO +0 -34
  8. {python_quanta-0.4.7 → python_quanta-0.5.0}/setup.cfg +0 -0
  9. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/python_quanta.egg-info/SOURCES.txt +0 -0
  10. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/python_quanta.egg-info/dependency_links.txt +0 -0
  11. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/python_quanta.egg-info/requires.txt +0 -0
  12. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/python_quanta.egg-info/top_level.txt +0 -0
  13. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/__init__.py +0 -0
  14. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/config/__init__.py +0 -0
  15. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/config/_internal.py +0 -0
  16. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/config/data.yaml +0 -0
  17. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/config/flow.yaml +0 -0
  18. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/config/libs.yaml +0 -0
  19. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/__init__.py +0 -0
  20. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/joinquant/__init__.py +0 -0
  21. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/joinquant/dt_table/__init__.py +0 -0
  22. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/joinquant/dt_table/main.py +0 -0
  23. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/joinquant/id_table/__init__.py +0 -0
  24. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/joinquant/id_table/main.py +0 -0
  25. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/joinquant/meta/__init__.py +0 -0
  26. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/data/joinquant/meta/main.py +0 -0
  27. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/duckui.py +0 -0
  28. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/__init__.py +0 -0
  29. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/__init__.py +0 -0
  30. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/_extra_pandas/__init__.py +0 -0
  31. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/_extra_pandas/core.py +0 -0
  32. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/_extra_pandas/main.py +0 -0
  33. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/_extra_pandas/old_main.py +0 -0
  34. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/_main/__init__.py +0 -0
  35. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/_main/_base.py +0 -0
  36. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_flow/_main/_connect.py +0 -0
  37. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/__init__.py +0 -0
  38. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/analysis/__init__.py +0 -0
  39. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/analysis/core.py +0 -0
  40. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/analysis/dev.py +0 -0
  41. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/analysis/main.py +0 -0
  42. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/db/__init__.py +0 -0
  43. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/db/dev.py +0 -0
  44. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/db/main.py +0 -0
  45. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/gen/__init__.py +0 -0
  46. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/gen/core.py +0 -0
  47. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/gen/dev.py +0 -0
  48. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/gen/main.py +0 -0
  49. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/rollings/__init__.py +0 -0
  50. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/rollings/base.py +0 -0
  51. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/rollings/core.py +0 -0
  52. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/rollings/dev.py +0 -0
  53. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/rollings/main.py +0 -0
  54. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/stats/__init__.py +0 -0
  55. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/stats/core.py +0 -0
  56. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/stats/dev.py +0 -0
  57. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/stats/main.py +0 -0
  58. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/tools/__init__.py +0 -0
  59. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/tools/core.py +0 -0
  60. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/tools/dev.py +0 -0
  61. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/_pandas/tools/main.py +0 -0
  62. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/__init__.py +0 -0
  63. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/_data_type_standard/__init__.py +0 -0
  64. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/_data_type_standard/main.py +0 -0
  65. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/_engines/DuckDB.py +0 -0
  66. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/_engines/MySQL.py +0 -0
  67. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/_engines/__init__.py +0 -0
  68. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/_engines/meta.py +0 -0
  69. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/db/main.py +0 -0
  70. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/utils/__init__.py +0 -0
  71. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/utils/_base.py +0 -0
  72. {python_quanta-0.4.7 → python_quanta-0.5.0}/src/quanta/libs/utils/_decorator.py +0 -0
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-quanta
3
+ Version: 0.5.0
4
+ Summary: A quantitative analysis project for financial data.
5
+ Author-email: Porco Rosso <porcorossobaojiel@gmail.com>
6
+ Project-URL: Homepage, https://github.com/porcorossobaojie/quanta.git
7
+ Keywords: quantitative,finance,data-analysis
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: pandas>=1.3.0
11
+ Requires-Dist: numpy>=1.21.0
12
+ Requires-Dist: scipy>=1.7.0
13
+ Requires-Dist: tomlkit>=0.11.0
14
+ Requires-Dist: python-dotenv>=0.19.0
15
+ Requires-Dist: python-box>=5.4.0
16
+ Requires-Dist: duckdb>=0.8.0
17
+ Requires-Dist: jqdatasdk>=1.8.0
18
+ Requires-Dist: matplotlib>=3.5.0
19
+ Requires-Dist: pymysql>=1.0.0
20
+ Requires-Dist: sqlalchemy>=1.4.0
21
+ Requires-Dist: statsmodels>=0.13.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
24
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
25
+ Requires-Dist: mypy>=0.910; extra == "dev"
26
+ Requires-Dist: ipython>=8.0.0; extra == "dev"
27
+ Requires-Dist: black>=22.0.0; extra == "dev"
28
+ Requires-Dist: isort>=5.0.0; extra == "dev"
29
+
30
+ # quanta
31
+
32
+ Summary
33
+ -------
34
+ A local-first quantitative research framework designed for:
35
+ -- providing specialized financial analysis modules and functions.
36
+ -- abstracting database connectivity to streamline data access for researchers.
37
+ -- deep integration with JoinQuant (JQData) for professional-grade data support.
38
+ -- supporting industry-standard factor models (e.g., Barra - Work in Progress).
39
+
40
+ How Install
41
+ -----------
42
+
43
+ pip install python-quanta -i https://pypi.org/simple
44
+
45
+ How Initial Local Settings
46
+ --------------------------
47
+
48
+ I new docoument like:
49
+ your project
50
+ |-- .env <-- build by user
51
+ |-- account.yaml <-- build by user if you have
52
+ |-- libs.yaml <-- must build
53
+
54
+ II if having join quant account, create file <account.yaml>:
55
+ account.yaml
56
+ ----
57
+ joinquant:
58
+ username: 'your_user_name'
59
+ password: 'your_password'
60
+
61
+ III set up your database env, create file <libs.yaml>:
62
+ libs.yaml
63
+ ----
64
+ db:
65
+ recommand_settings: DuckDB # recommand database type
66
+ DuckDB:
67
+ recommand_settings:
68
+ path: 'E:/ProgramData/DuckDB' # path of database file
69
+ database: Locals # name of database file
70
+ schema: jq_data # schema name
71
+
72
+ Why python-quanta
73
+ -----------------
74
+
75
+ I provide local database construct automatically
76
+ all you need is just running:
77
+ -- quanta.data.daily()
78
+ including:
79
+ -- trading data: stock, index(not in CSI), etf
80
+ -- finance data: stock
81
+
82
+ II specialized financial analytical extensions (based on pandas.DataFrame)
83
+ -- DataFrame.gen
84
+ .group() # quick-grouping based on multi-factor theory
85
+ .portfolio() # get returns of each group generated by function above
86
+ -- DataFrame.rollings
87
+ .sth() # specialized rolling, e.g., "get 3 max volume in 21 days"
88
+ -- DataFrame.stats
89
+ .neutral() # OLS or factor neutralization (e.g., .stats.neutral)
90
+
91
+ III more powerful functions with database
92
+ if user have join quant account, python-quanta will be more powerful:
93
+ -- DataFrame.f.listing # filter portfolio by listed date
94
+ not_st # filter portfolio by ST status
95
+ tradestatus # filter portfolio by trade status
96
+ index_members # get index constituents (e.g., '300', '500')
97
+ label # get industry classifications (e.g., "swl1_code")
98
+ ic # Information Coefficient (IC)
99
+ ir # Information Ratio (IR, annual)
100
+ port / test # rapid group return calculation and backtesting
101
+
102
+ IV high-efficiency research workflow (quanta.flow)
103
+ The `flow` module provides a high-level abstraction for factor/strategy research:
104
+ -- quanta.flow.astock("key") # unified interface for price and financial data
105
+ -- quanta.flow.astock._help # metadata lookup for tables, columns, and comments
106
+ -- quanta.flow.astock.help("keyword") # fuzzy search within metadata (e.g., "oper" for operating data)
107
+
108
+ V standard factor library (Roadmap)
109
+ Ongoing implementation of benchmark factors for strategy comparison:
110
+ -- Barra Risk Model factors, Alpha 101, etc.
111
+
112
+ Notices
113
+ -------
114
+ welcome for advise! ^_^
115
+ if you want data for testing python-quanta, please mail: porcorossobaojie@gmail.com
116
+
117
+ ---
118
+
119
+ # quanta (中文版)
120
+
121
+ Summary
122
+ -------
123
+ 本地优先的量化研究框架, 旨在:
124
+ -- 提供针对金融场景优化的专业分析模块与函数.
125
+ -- 抽象化数据库连接细节, 使研究员能够高效获取所需数据.
126
+ -- 深度集成聚宽 (JQData) API, 提供强大的专业数据支持.
127
+ -- 逐步实现行业标准因子模型 (如 Barra 风险模型 - 开发中).
128
+
129
+ How Install
130
+ -----------
131
+
132
+ pip install python-quanta -i https://pypi.org/simple
133
+
134
+ How Initial Local Settings
135
+ --------------------------
136
+
137
+ I 新建配置文件:
138
+ 你的项目目录/
139
+ |-- .env <-- 环境变量配置文件
140
+ |-- account.yaml <-- 聚宽账户凭据 (可选)
141
+ |-- libs.yaml <-- 数据库配置 (必填)
142
+
143
+ II 若有聚宽账户, 创建 <account.yaml>:
144
+ account.yaml
145
+ ----
146
+ joinquant:
147
+ username: 'your_user_name'
148
+ password: 'your_password'
149
+
150
+ III 配置数据库环境 <libs.yaml>:
151
+ libs.yaml
152
+ ----
153
+ db:
154
+ recommand_settings: DuckDB # 推荐使用的存储引擎
155
+ DuckDB:
156
+ recommand_settings:
157
+ path: 'E:/ProgramData/DuckDB' # 本地数据库存放路径
158
+ database: Locals # 数据库文件名
159
+ schema: jq_data # Schema 名称
160
+
161
+ Why python-quanta
162
+ -----------------
163
+
164
+ I 提供自动化本地数据库构建
165
+ 仅需运行以下指令即可全自动同步 ETL:
166
+ -- quanta.data.daily()
167
+ 包含数据:
168
+ -- 交易数据: 股票, 指数(非中证系列), ETF.
169
+ -- 财务数据: 全量股票财务报表.
170
+
171
+ II 专业金融分析扩展 (基于 pandas.DataFrame)
172
+ -- DataFrame.gen
173
+ .group() # 基于多因子理论的高效分组函数
174
+ .portfolio() # 计算基于分组结果的投资组合收益
175
+ -- DataFrame.rollings
176
+ .sth() # 专用滚动窗口函数(如: "获取21日内成交量最大的3个交易日")
177
+ -- DataFrame.stats
178
+ .neutral() # 因子中性化处理及截面 OLS 回归
179
+
180
+ III 数据库增强型高级功能
181
+ 需配合聚宽账户以实现更强大的分析能力:
182
+ -- DataFrame.f.listing # 根据上市日期过滤
183
+ not_st # 剔除 ST/退市风险警示股票
184
+ tradestatus # 根据交易状态过滤
185
+ index_members # 获取指数成分股(如 '300', '500')
186
+ label # 获取行业分类信息(如申万一级)
187
+ ic # 因子 IC (Information Coefficient) 计算
188
+ ir # 因子 IR (Information Ratio, 年化) 计算
189
+ port / test # 快速计算分组收益及策略回测
190
+
191
+ IV 高效研究流工具 (quanta.flow)
192
+ `flow` 模块为因子与策略研发提供高层抽象:
193
+ -- quanta.flow.astock("key") # 获取价格或财务数据的统一接口
194
+ -- quanta.flow.astock._help # 快速查询数据库表, 字段及注释信息
195
+ -- quanta.flow.astock.help("key") # 模糊搜索元数据(如搜索 "oper" 获取营业相关字段)
196
+
197
+ V 标准因子库 (发展路线)
198
+ 持续集成行业标准因子以供对比与测试:
199
+ -- Barra 风险因子, Alpha 101 系列因子等.
200
+
201
+ Notices
202
+ -------
203
+ 欢迎任何建议与反馈! ^_^
204
+ 如需测试数据或技术咨询, 请联系: porcorossobaojie@gmail.com
@@ -0,0 +1,175 @@
1
+ # quanta
2
+
3
+ Summary
4
+ -------
5
+ A local-first quantitative research framework designed for:
6
+ -- providing specialized financial analysis modules and functions.
7
+ -- abstracting database connectivity to streamline data access for researchers.
8
+ -- deep integration with JoinQuant (JQData) for professional-grade data support.
9
+ -- supporting industry-standard factor models (e.g., Barra - Work in Progress).
10
+
11
+ How Install
12
+ -----------
13
+
14
+ pip install python-quanta -i https://pypi.org/simple
15
+
16
+ How Initial Local Settings
17
+ --------------------------
18
+
19
+ I new docoument like:
20
+ your project
21
+ |-- .env <-- build by user
22
+ |-- account.yaml <-- build by user if you have
23
+ |-- libs.yaml <-- must build
24
+
25
+ II if having join quant account, create file <account.yaml>:
26
+ account.yaml
27
+ ----
28
+ joinquant:
29
+ username: 'your_user_name'
30
+ password: 'your_password'
31
+
32
+ III set up your database env, create file <libs.yaml>:
33
+ libs.yaml
34
+ ----
35
+ db:
36
+ recommand_settings: DuckDB # recommand database type
37
+ DuckDB:
38
+ recommand_settings:
39
+ path: 'E:/ProgramData/DuckDB' # path of database file
40
+ database: Locals # name of database file
41
+ schema: jq_data # schema name
42
+
43
+ Why python-quanta
44
+ -----------------
45
+
46
+ I provide local database construct automatically
47
+ all you need is just running:
48
+ -- quanta.data.daily()
49
+ including:
50
+ -- trading data: stock, index(not in CSI), etf
51
+ -- finance data: stock
52
+
53
+ II specialized financial analytical extensions (based on pandas.DataFrame)
54
+ -- DataFrame.gen
55
+ .group() # quick-grouping based on multi-factor theory
56
+ .portfolio() # get returns of each group generated by function above
57
+ -- DataFrame.rollings
58
+ .sth() # specialized rolling, e.g., "get 3 max volume in 21 days"
59
+ -- DataFrame.stats
60
+ .neutral() # OLS or factor neutralization (e.g., .stats.neutral)
61
+
62
+ III more powerful functions with database
63
+ if user have join quant account, python-quanta will be more powerful:
64
+ -- DataFrame.f.listing # filter portfolio by listed date
65
+ not_st # filter portfolio by ST status
66
+ tradestatus # filter portfolio by trade status
67
+ index_members # get index constituents (e.g., '300', '500')
68
+ label # get industry classifications (e.g., "swl1_code")
69
+ ic # Information Coefficient (IC)
70
+ ir # Information Ratio (IR, annual)
71
+ port / test # rapid group return calculation and backtesting
72
+
73
+ IV high-efficiency research workflow (quanta.flow)
74
+ The `flow` module provides a high-level abstraction for factor/strategy research:
75
+ -- quanta.flow.astock("key") # unified interface for price and financial data
76
+ -- quanta.flow.astock._help # metadata lookup for tables, columns, and comments
77
+ -- quanta.flow.astock.help("keyword") # fuzzy search within metadata (e.g., "oper" for operating data)
78
+
79
+ V standard factor library (Roadmap)
80
+ Ongoing implementation of benchmark factors for strategy comparison:
81
+ -- Barra Risk Model factors, Alpha 101, etc.
82
+
83
+ Notices
84
+ -------
85
+ welcome for advise! ^_^
86
+ if you want data for testing python-quanta, please mail: porcorossobaojie@gmail.com
87
+
88
+ ---
89
+
90
+ # quanta (中文版)
91
+
92
+ Summary
93
+ -------
94
+ 本地优先的量化研究框架, 旨在:
95
+ -- 提供针对金融场景优化的专业分析模块与函数.
96
+ -- 抽象化数据库连接细节, 使研究员能够高效获取所需数据.
97
+ -- 深度集成聚宽 (JQData) API, 提供强大的专业数据支持.
98
+ -- 逐步实现行业标准因子模型 (如 Barra 风险模型 - 开发中).
99
+
100
+ How Install
101
+ -----------
102
+
103
+ pip install python-quanta -i https://pypi.org/simple
104
+
105
+ How Initial Local Settings
106
+ --------------------------
107
+
108
+ I 新建配置文件:
109
+ 你的项目目录/
110
+ |-- .env <-- 环境变量配置文件
111
+ |-- account.yaml <-- 聚宽账户凭据 (可选)
112
+ |-- libs.yaml <-- 数据库配置 (必填)
113
+
114
+ II 若有聚宽账户, 创建 <account.yaml>:
115
+ account.yaml
116
+ ----
117
+ joinquant:
118
+ username: 'your_user_name'
119
+ password: 'your_password'
120
+
121
+ III 配置数据库环境 <libs.yaml>:
122
+ libs.yaml
123
+ ----
124
+ db:
125
+ recommand_settings: DuckDB # 推荐使用的存储引擎
126
+ DuckDB:
127
+ recommand_settings:
128
+ path: 'E:/ProgramData/DuckDB' # 本地数据库存放路径
129
+ database: Locals # 数据库文件名
130
+ schema: jq_data # Schema 名称
131
+
132
+ Why python-quanta
133
+ -----------------
134
+
135
+ I 提供自动化本地数据库构建
136
+ 仅需运行以下指令即可全自动同步 ETL:
137
+ -- quanta.data.daily()
138
+ 包含数据:
139
+ -- 交易数据: 股票, 指数(非中证系列), ETF.
140
+ -- 财务数据: 全量股票财务报表.
141
+
142
+ II 专业金融分析扩展 (基于 pandas.DataFrame)
143
+ -- DataFrame.gen
144
+ .group() # 基于多因子理论的高效分组函数
145
+ .portfolio() # 计算基于分组结果的投资组合收益
146
+ -- DataFrame.rollings
147
+ .sth() # 专用滚动窗口函数(如: "获取21日内成交量最大的3个交易日")
148
+ -- DataFrame.stats
149
+ .neutral() # 因子中性化处理及截面 OLS 回归
150
+
151
+ III 数据库增强型高级功能
152
+ 需配合聚宽账户以实现更强大的分析能力:
153
+ -- DataFrame.f.listing # 根据上市日期过滤
154
+ not_st # 剔除 ST/退市风险警示股票
155
+ tradestatus # 根据交易状态过滤
156
+ index_members # 获取指数成分股(如 '300', '500')
157
+ label # 获取行业分类信息(如申万一级)
158
+ ic # 因子 IC (Information Coefficient) 计算
159
+ ir # 因子 IR (Information Ratio, 年化) 计算
160
+ port / test # 快速计算分组收益及策略回测
161
+
162
+ IV 高效研究流工具 (quanta.flow)
163
+ `flow` 模块为因子与策略研发提供高层抽象:
164
+ -- quanta.flow.astock("key") # 获取价格或财务数据的统一接口
165
+ -- quanta.flow.astock._help # 快速查询数据库表, 字段及注释信息
166
+ -- quanta.flow.astock.help("key") # 模糊搜索元数据(如搜索 "oper" 获取营业相关字段)
167
+
168
+ V 标准因子库 (发展路线)
169
+ 持续集成行业标准因子以供对比与测试:
170
+ -- Barra 风险因子, Alpha 101 系列因子等.
171
+
172
+ Notices
173
+ -------
174
+ 欢迎任何建议与反馈! ^_^
175
+ 如需测试数据或技术咨询, 请联系: porcorossobaojie@gmail.com
@@ -1,7 +1,7 @@
1
1
  # D:\codes\quanta\pyproject.toml
2
2
  [project]
3
3
  name = "python-quanta" # 你的项目名称,建议与你的顶级包名(例如 src/quanta)一致
4
- version = "0.4.7" # 项目版本号
4
+ version = "0.5.0" # 项目版本号
5
5
  description = "A quantitative analysis project for financial data." # 项目的简短描述
6
6
  readme = "README.md" # 指向你的 README 文件
7
7
  requires-python = ">=3.9" # 项目所需的 Python 版本
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-quanta
3
+ Version: 0.5.0
4
+ Summary: A quantitative analysis project for financial data.
5
+ Author-email: Porco Rosso <porcorossobaojiel@gmail.com>
6
+ Project-URL: Homepage, https://github.com/porcorossobaojie/quanta.git
7
+ Keywords: quantitative,finance,data-analysis
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: pandas>=1.3.0
11
+ Requires-Dist: numpy>=1.21.0
12
+ Requires-Dist: scipy>=1.7.0
13
+ Requires-Dist: tomlkit>=0.11.0
14
+ Requires-Dist: python-dotenv>=0.19.0
15
+ Requires-Dist: python-box>=5.4.0
16
+ Requires-Dist: duckdb>=0.8.0
17
+ Requires-Dist: jqdatasdk>=1.8.0
18
+ Requires-Dist: matplotlib>=3.5.0
19
+ Requires-Dist: pymysql>=1.0.0
20
+ Requires-Dist: sqlalchemy>=1.4.0
21
+ Requires-Dist: statsmodels>=0.13.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
24
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
25
+ Requires-Dist: mypy>=0.910; extra == "dev"
26
+ Requires-Dist: ipython>=8.0.0; extra == "dev"
27
+ Requires-Dist: black>=22.0.0; extra == "dev"
28
+ Requires-Dist: isort>=5.0.0; extra == "dev"
29
+
30
+ # quanta
31
+
32
+ Summary
33
+ -------
34
+ A local-first quantitative research framework designed for:
35
+ -- providing specialized financial analysis modules and functions.
36
+ -- abstracting database connectivity to streamline data access for researchers.
37
+ -- deep integration with JoinQuant (JQData) for professional-grade data support.
38
+ -- supporting industry-standard factor models (e.g., Barra - Work in Progress).
39
+
40
+ How Install
41
+ -----------
42
+
43
+ pip install python-quanta -i https://pypi.org/simple
44
+
45
+ How Initial Local Settings
46
+ --------------------------
47
+
48
+ I new docoument like:
49
+ your project
50
+ |-- .env <-- build by user
51
+ |-- account.yaml <-- build by user if you have
52
+ |-- libs.yaml <-- must build
53
+
54
+ II if having join quant account, create file <account.yaml>:
55
+ account.yaml
56
+ ----
57
+ joinquant:
58
+ username: 'your_user_name'
59
+ password: 'your_password'
60
+
61
+ III set up your database env, create file <libs.yaml>:
62
+ libs.yaml
63
+ ----
64
+ db:
65
+ recommand_settings: DuckDB # recommand database type
66
+ DuckDB:
67
+ recommand_settings:
68
+ path: 'E:/ProgramData/DuckDB' # path of database file
69
+ database: Locals # name of database file
70
+ schema: jq_data # schema name
71
+
72
+ Why python-quanta
73
+ -----------------
74
+
75
+ I provide local database construct automatically
76
+ all you need is just running:
77
+ -- quanta.data.daily()
78
+ including:
79
+ -- trading data: stock, index(not in CSI), etf
80
+ -- finance data: stock
81
+
82
+ II specialized financial analytical extensions (based on pandas.DataFrame)
83
+ -- DataFrame.gen
84
+ .group() # quick-grouping based on multi-factor theory
85
+ .portfolio() # get returns of each group generated by function above
86
+ -- DataFrame.rollings
87
+ .sth() # specialized rolling, e.g., "get 3 max volume in 21 days"
88
+ -- DataFrame.stats
89
+ .neutral() # OLS or factor neutralization (e.g., .stats.neutral)
90
+
91
+ III more powerful functions with database
92
+ if user have join quant account, python-quanta will be more powerful:
93
+ -- DataFrame.f.listing # filter portfolio by listed date
94
+ not_st # filter portfolio by ST status
95
+ tradestatus # filter portfolio by trade status
96
+ index_members # get index constituents (e.g., '300', '500')
97
+ label # get industry classifications (e.g., "swl1_code")
98
+ ic # Information Coefficient (IC)
99
+ ir # Information Ratio (IR, annual)
100
+ port / test # rapid group return calculation and backtesting
101
+
102
+ IV high-efficiency research workflow (quanta.flow)
103
+ The `flow` module provides a high-level abstraction for factor/strategy research:
104
+ -- quanta.flow.astock("key") # unified interface for price and financial data
105
+ -- quanta.flow.astock._help # metadata lookup for tables, columns, and comments
106
+ -- quanta.flow.astock.help("keyword") # fuzzy search within metadata (e.g., "oper" for operating data)
107
+
108
+ V standard factor library (Roadmap)
109
+ Ongoing implementation of benchmark factors for strategy comparison:
110
+ -- Barra Risk Model factors, Alpha 101, etc.
111
+
112
+ Notices
113
+ -------
114
+ welcome for advise! ^_^
115
+ if you want data for testing python-quanta, please mail: porcorossobaojie@gmail.com
116
+
117
+ ---
118
+
119
+ # quanta (中文版)
120
+
121
+ Summary
122
+ -------
123
+ 本地优先的量化研究框架, 旨在:
124
+ -- 提供针对金融场景优化的专业分析模块与函数.
125
+ -- 抽象化数据库连接细节, 使研究员能够高效获取所需数据.
126
+ -- 深度集成聚宽 (JQData) API, 提供强大的专业数据支持.
127
+ -- 逐步实现行业标准因子模型 (如 Barra 风险模型 - 开发中).
128
+
129
+ How Install
130
+ -----------
131
+
132
+ pip install python-quanta -i https://pypi.org/simple
133
+
134
+ How Initial Local Settings
135
+ --------------------------
136
+
137
+ I 新建配置文件:
138
+ 你的项目目录/
139
+ |-- .env <-- 环境变量配置文件
140
+ |-- account.yaml <-- 聚宽账户凭据 (可选)
141
+ |-- libs.yaml <-- 数据库配置 (必填)
142
+
143
+ II 若有聚宽账户, 创建 <account.yaml>:
144
+ account.yaml
145
+ ----
146
+ joinquant:
147
+ username: 'your_user_name'
148
+ password: 'your_password'
149
+
150
+ III 配置数据库环境 <libs.yaml>:
151
+ libs.yaml
152
+ ----
153
+ db:
154
+ recommand_settings: DuckDB # 推荐使用的存储引擎
155
+ DuckDB:
156
+ recommand_settings:
157
+ path: 'E:/ProgramData/DuckDB' # 本地数据库存放路径
158
+ database: Locals # 数据库文件名
159
+ schema: jq_data # Schema 名称
160
+
161
+ Why python-quanta
162
+ -----------------
163
+
164
+ I 提供自动化本地数据库构建
165
+ 仅需运行以下指令即可全自动同步 ETL:
166
+ -- quanta.data.daily()
167
+ 包含数据:
168
+ -- 交易数据: 股票, 指数(非中证系列), ETF.
169
+ -- 财务数据: 全量股票财务报表.
170
+
171
+ II 专业金融分析扩展 (基于 pandas.DataFrame)
172
+ -- DataFrame.gen
173
+ .group() # 基于多因子理论的高效分组函数
174
+ .portfolio() # 计算基于分组结果的投资组合收益
175
+ -- DataFrame.rollings
176
+ .sth() # 专用滚动窗口函数(如: "获取21日内成交量最大的3个交易日")
177
+ -- DataFrame.stats
178
+ .neutral() # 因子中性化处理及截面 OLS 回归
179
+
180
+ III 数据库增强型高级功能
181
+ 需配合聚宽账户以实现更强大的分析能力:
182
+ -- DataFrame.f.listing # 根据上市日期过滤
183
+ not_st # 剔除 ST/退市风险警示股票
184
+ tradestatus # 根据交易状态过滤
185
+ index_members # 获取指数成分股(如 '300', '500')
186
+ label # 获取行业分类信息(如申万一级)
187
+ ic # 因子 IC (Information Coefficient) 计算
188
+ ir # 因子 IR (Information Ratio, 年化) 计算
189
+ port / test # 快速计算分组收益及策略回测
190
+
191
+ IV 高效研究流工具 (quanta.flow)
192
+ `flow` 模块为因子与策略研发提供高层抽象:
193
+ -- quanta.flow.astock("key") # 获取价格或财务数据的统一接口
194
+ -- quanta.flow.astock._help # 快速查询数据库表, 字段及注释信息
195
+ -- quanta.flow.astock.help("key") # 模糊搜索元数据(如搜索 "oper" 获取营业相关字段)
196
+
197
+ V 标准因子库 (发展路线)
198
+ 持续集成行业标准因子以供对比与测试:
199
+ -- Barra 风险因子, Alpha 101 系列因子等.
200
+
201
+ Notices
202
+ -------
203
+ 欢迎任何建议与反馈! ^_^
204
+ 如需测试数据或技术咨询, 请联系: porcorossobaojie@gmail.com
@@ -1,34 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python-quanta
3
- Version: 0.4.7
4
- Summary: A quantitative analysis project for financial data.
5
- Author-email: Porco Rosso <porcorossobaojiel@gmail.com>
6
- Project-URL: Homepage, https://github.com/porcorossobaojie/quanta.git
7
- Keywords: quantitative,finance,data-analysis
8
- Requires-Python: >=3.9
9
- Description-Content-Type: text/markdown
10
- Requires-Dist: pandas>=1.3.0
11
- Requires-Dist: numpy>=1.21.0
12
- Requires-Dist: scipy>=1.7.0
13
- Requires-Dist: tomlkit>=0.11.0
14
- Requires-Dist: python-dotenv>=0.19.0
15
- Requires-Dist: python-box>=5.4.0
16
- Requires-Dist: duckdb>=0.8.0
17
- Requires-Dist: jqdatasdk>=1.8.0
18
- Requires-Dist: matplotlib>=3.5.0
19
- Requires-Dist: pymysql>=1.0.0
20
- Requires-Dist: sqlalchemy>=1.4.0
21
- Requires-Dist: statsmodels>=0.13.0
22
- Provides-Extra: dev
23
- Requires-Dist: pytest>=7.0.0; extra == "dev"
24
- Requires-Dist: flake8>=4.0.0; extra == "dev"
25
- Requires-Dist: mypy>=0.910; extra == "dev"
26
- Requires-Dist: ipython>=8.0.0; extra == "dev"
27
- Requires-Dist: black>=22.0.0; extra == "dev"
28
- Requires-Dist: isort>=5.0.0; extra == "dev"
29
-
30
- # quanta
31
- A 股量化交易系统:
32
- 提供基于Join Quant的本地数据平台搭建;
33
- 提供基础类因子;
34
- 提供金融场景下的函数构造及封装;
@@ -1,5 +0,0 @@
1
- # quanta
2
- A 股量化交易系统:
3
- 提供基于Join Quant的本地数据平台搭建;
4
- 提供基础类因子;
5
- 提供金融场景下的函数构造及封装;
@@ -1,34 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python-quanta
3
- Version: 0.4.7
4
- Summary: A quantitative analysis project for financial data.
5
- Author-email: Porco Rosso <porcorossobaojiel@gmail.com>
6
- Project-URL: Homepage, https://github.com/porcorossobaojie/quanta.git
7
- Keywords: quantitative,finance,data-analysis
8
- Requires-Python: >=3.9
9
- Description-Content-Type: text/markdown
10
- Requires-Dist: pandas>=1.3.0
11
- Requires-Dist: numpy>=1.21.0
12
- Requires-Dist: scipy>=1.7.0
13
- Requires-Dist: tomlkit>=0.11.0
14
- Requires-Dist: python-dotenv>=0.19.0
15
- Requires-Dist: python-box>=5.4.0
16
- Requires-Dist: duckdb>=0.8.0
17
- Requires-Dist: jqdatasdk>=1.8.0
18
- Requires-Dist: matplotlib>=3.5.0
19
- Requires-Dist: pymysql>=1.0.0
20
- Requires-Dist: sqlalchemy>=1.4.0
21
- Requires-Dist: statsmodels>=0.13.0
22
- Provides-Extra: dev
23
- Requires-Dist: pytest>=7.0.0; extra == "dev"
24
- Requires-Dist: flake8>=4.0.0; extra == "dev"
25
- Requires-Dist: mypy>=0.910; extra == "dev"
26
- Requires-Dist: ipython>=8.0.0; extra == "dev"
27
- Requires-Dist: black>=22.0.0; extra == "dev"
28
- Requires-Dist: isort>=5.0.0; extra == "dev"
29
-
30
- # quanta
31
- A 股量化交易系统:
32
- 提供基于Join Quant的本地数据平台搭建;
33
- 提供基础类因子;
34
- 提供金融场景下的函数构造及封装;
File without changes