quantcli 0.1.4__tar.gz → 0.1.5__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.
- {quantcli-0.1.4/quantcli.egg-info → quantcli-0.1.5}/PKG-INFO +1 -1
- {quantcli-0.1.4 → quantcli-0.1.5}/pyproject.toml +1 -1
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/sync/base.py +27 -27
- {quantcli-0.1.4 → quantcli-0.1.5/quantcli.egg-info}/PKG-INFO +1 -1
- {quantcli-0.1.4 → quantcli-0.1.5}/LICENSE +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/README.md +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/cli.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/core/__init__.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/core/backtest.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/core/data.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/core/factor.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/__init__.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/akshare.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/baostock.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/base.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/cache.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/mixed.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/mysql.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/sync/__init__.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/sync/akshare.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/datasources/sync/gm.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/__init__.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/base.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/compute.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/loader.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/pipeline.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/ranking.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/ranking_executor.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/screening.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/factors/screening_executor.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/models/bar.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/parser/__init__.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/parser/constants.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/parser/formula.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/utils/__init__.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/utils/logger.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/utils/path.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/utils/symbol_utils.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/utils/time.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli/utils/validate.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli.egg-info/SOURCES.txt +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli.egg-info/dependency_links.txt +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli.egg-info/entry_points.txt +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli.egg-info/requires.txt +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/quantcli.egg-info/top_level.txt +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/setup.cfg +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_akshare_integration.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_builtin_factors.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_cli.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_datasources.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_factors.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_gm_executors.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_mixed_datasource.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_multi_factor.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_pipeline_integration.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_symbol_utils.py +0 -0
- {quantcli-0.1.4 → quantcli-0.1.5}/tests/test_time.py +0 -0
|
@@ -150,24 +150,24 @@ class DataSync(ABC):
|
|
|
150
150
|
def create_sync(
|
|
151
151
|
source: str,
|
|
152
152
|
token: str = None,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
host: str = None,
|
|
154
|
+
port: int = None,
|
|
155
|
+
user: str = None,
|
|
156
|
+
password: str = None,
|
|
157
|
+
database: str = None,
|
|
158
|
+
table_prefix: str = None,
|
|
159
159
|
) -> "DataSync":
|
|
160
160
|
"""创建同步器
|
|
161
161
|
|
|
162
162
|
Args:
|
|
163
163
|
source: 数据源名称 ("gm", "akshare", "baostock")
|
|
164
164
|
token: API token (仅 gm 需要)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
host: MySQL 主机地址
|
|
166
|
+
port: MySQL 端口
|
|
167
|
+
user: MySQL 用户名
|
|
168
|
+
password: MySQL 密码
|
|
169
|
+
database: MySQL 数据库名
|
|
170
|
+
table_prefix: 表前缀
|
|
171
171
|
|
|
172
172
|
Returns:
|
|
173
173
|
DataSync 实例
|
|
@@ -184,20 +184,20 @@ def create_sync(
|
|
|
184
184
|
>>> sync = create_sync(
|
|
185
185
|
... "gm",
|
|
186
186
|
... token="your_token",
|
|
187
|
-
...
|
|
188
|
-
...
|
|
189
|
-
...
|
|
190
|
-
...
|
|
191
|
-
...
|
|
192
|
-
...
|
|
187
|
+
... host="192.168.1.100",
|
|
188
|
+
... port=3307,
|
|
189
|
+
... user="quant",
|
|
190
|
+
... password="secret",
|
|
191
|
+
... database="quantdb",
|
|
192
|
+
... table_prefix="test_"
|
|
193
193
|
... )
|
|
194
194
|
|
|
195
195
|
>>> # 使用 akshare 同步到自定义数据库
|
|
196
196
|
>>> sync = create_sync(
|
|
197
197
|
... "akshare",
|
|
198
|
-
...
|
|
199
|
-
...
|
|
200
|
-
...
|
|
198
|
+
... host="localhost",
|
|
199
|
+
... database="mydata",
|
|
200
|
+
... table_prefix="prod_"
|
|
201
201
|
... )
|
|
202
202
|
"""
|
|
203
203
|
from ..mysql import MySQLDataSource
|
|
@@ -206,12 +206,12 @@ def create_sync(
|
|
|
206
206
|
|
|
207
207
|
# 创建 MySQL 数据源(传入连接参数)
|
|
208
208
|
mysql = MySQLDataSource(
|
|
209
|
-
host=
|
|
210
|
-
port=
|
|
211
|
-
user=
|
|
212
|
-
password=
|
|
213
|
-
database=
|
|
214
|
-
table_prefix=
|
|
209
|
+
host=host,
|
|
210
|
+
port=port,
|
|
211
|
+
user=user,
|
|
212
|
+
password=password,
|
|
213
|
+
database=database,
|
|
214
|
+
table_prefix=table_prefix,
|
|
215
215
|
)
|
|
216
216
|
|
|
217
217
|
if source == "gm":
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|