ffdata 0.2.10__tar.gz → 0.2.17__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.
- {ffdata-0.2.10 → ffdata-0.2.17}/PKG-INFO +1 -1
- {ffdata-0.2.10 → ffdata-0.2.17}/pyproject.toml +1 -1
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/__init__.py +48 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/client.py +210 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata.egg-info/PKG-INFO +1 -1
- {ffdata-0.2.10 → ffdata-0.2.17}/README.md +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/scripts/configure_ffdata.sh +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/setup.cfg +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/cli.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/datasets/__init__.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/datasets/manager.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/local/__init__.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/local/store.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/transport/__init__.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata/transport/http.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata.egg-info/SOURCES.txt +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata.egg-info/dependency_links.txt +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata.egg-info/entry_points.txt +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata.egg-info/requires.txt +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata.egg-info/top_level.txt +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata_common/__init__.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata_common/codecs/__init__.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata_common/codecs/arrow.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata_common/errors.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata_common/protocol.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata_common/schemas/__init__.py +0 -0
- {ffdata-0.2.10 → ffdata-0.2.17}/src/ffdata_common/schemas/manifest.py +0 -0
|
@@ -58,6 +58,21 @@ def stock_adjusting_factor(*args: Any, **kwargs: Any):
|
|
|
58
58
|
return _client().stock_adjusting_factor(*args, **kwargs)
|
|
59
59
|
|
|
60
60
|
|
|
61
|
+
def stock_margin_detail(*args: Any, **kwargs: Any):
|
|
62
|
+
"""通过默认客户端查询融资融券交易明细(个股级,15 列,金额单位为元)。"""
|
|
63
|
+
return _client().stock_margin_detail(*args, **kwargs)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def stock_margin_stat(*args: Any, **kwargs: Any):
|
|
67
|
+
"""通过默认客户端查询融资融券交易总量(交易所级,20 列,含万股/万元混合单位)。"""
|
|
68
|
+
return _client().stock_margin_stat(*args, **kwargs)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def stock_margin_market(*args: Any, **kwargs: Any):
|
|
72
|
+
"""通过默认客户端查询融资融券市场统计(全市场,32 列,日频+月频,金额单位为亿元)。"""
|
|
73
|
+
return _client().stock_margin_market(*args, **kwargs)
|
|
74
|
+
|
|
75
|
+
|
|
61
76
|
def stock_valuation_daily(*args: Any, **kwargs: Any):
|
|
62
77
|
"""通过默认客户端查询 A 股估值分析(日频)。"""
|
|
63
78
|
return _client().stock_valuation_daily(*args, **kwargs)
|
|
@@ -97,6 +112,16 @@ def index_industry(*args: Any, **kwargs: Any):
|
|
|
97
112
|
return _client().index_industry(*args, **kwargs)
|
|
98
113
|
|
|
99
114
|
|
|
115
|
+
def industry_index(*args: Any, **kwargs: Any):
|
|
116
|
+
"""通过默认客户端查询申万/中信指定级别行业对应的指数。"""
|
|
117
|
+
return _client().industry_index(*args, **kwargs)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def index_relation(*args: Any, **kwargs: Any):
|
|
121
|
+
"""通过默认客户端查询指数代码的关联指数(如全收益/净收益指数)。"""
|
|
122
|
+
return _client().index_relation(*args, **kwargs)
|
|
123
|
+
|
|
124
|
+
|
|
100
125
|
def index_performance(*args: Any, **kwargs: Any):
|
|
101
126
|
"""通过默认客户端查询指数区间行情表现(12 个区间,120 列)。"""
|
|
102
127
|
return _client().index_performance(*args, **kwargs)
|
|
@@ -117,6 +142,11 @@ def etf_basic(*args: Any, **kwargs: Any):
|
|
|
117
142
|
return _client().etf_basic(*args, **kwargs)
|
|
118
143
|
|
|
119
144
|
|
|
145
|
+
def etf_scale_daily(*args: Any, **kwargs: Any):
|
|
146
|
+
"""通过默认客户端查询 ETF 日规模明细(场内份额与净资产值)。"""
|
|
147
|
+
return _client().etf_scale_daily(*args, **kwargs)
|
|
148
|
+
|
|
149
|
+
|
|
120
150
|
def etf_daily(*args: Any, **kwargs: Any):
|
|
121
151
|
"""通过默认客户端查询 ETF 日线行情(83 列,含聚源区间表现列)。"""
|
|
122
152
|
return _client().etf_daily(*args, **kwargs)
|
|
@@ -167,6 +197,16 @@ def fund_stock_portfolio(*args: Any, **kwargs: Any):
|
|
|
167
197
|
return _client().fund_stock_portfolio(*args, **kwargs)
|
|
168
198
|
|
|
169
199
|
|
|
200
|
+
def fund_shares_change(*args: Any, **kwargs: Any):
|
|
201
|
+
"""通过默认客户端查询公募基金份额变动(20 列,含 ETF/LOF 日份额)。"""
|
|
202
|
+
return _client().fund_shares_change(*args, **kwargs)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def fund_holder_info(*args: Any, **kwargs: Any):
|
|
206
|
+
"""通过默认客户端查询公募基金持有人结构(24 列,含机构占比与前十大合计)。"""
|
|
207
|
+
return _client().fund_holder_info(*args, **kwargs)
|
|
208
|
+
|
|
209
|
+
|
|
170
210
|
def sge_daily(*args: Any, **kwargs: Any):
|
|
171
211
|
"""通过默认客户端查询上海黄金交易所现货日行情(20 列,前 14 列对齐 Tushare)。"""
|
|
172
212
|
return _client().sge_daily(*args, **kwargs)
|
|
@@ -210,9 +250,12 @@ __all__ = [
|
|
|
210
250
|
"cb_issue",
|
|
211
251
|
"configure",
|
|
212
252
|
"etf_adj_daily",
|
|
253
|
+
"etf_scale_daily",
|
|
213
254
|
"etf_basic",
|
|
214
255
|
"etf_daily",
|
|
215
256
|
"fund_basic",
|
|
257
|
+
"fund_holder_info",
|
|
258
|
+
"fund_shares_change",
|
|
216
259
|
"fund_stock_portfolio",
|
|
217
260
|
"index_basic",
|
|
218
261
|
"index_daily",
|
|
@@ -221,6 +264,8 @@ __all__ = [
|
|
|
221
264
|
"index_valuation",
|
|
222
265
|
"index_weight",
|
|
223
266
|
"index_industry",
|
|
267
|
+
"industry_index",
|
|
268
|
+
"index_relation",
|
|
224
269
|
"intl_macro_indicator_basic",
|
|
225
270
|
"intl_macro_indicator_data",
|
|
226
271
|
"macro_indicator_basic",
|
|
@@ -231,6 +276,9 @@ __all__ = [
|
|
|
231
276
|
"set_token",
|
|
232
277
|
"stock_adjusting_factor",
|
|
233
278
|
"stock_basic",
|
|
279
|
+
"stock_margin_detail",
|
|
280
|
+
"stock_margin_market",
|
|
281
|
+
"stock_margin_stat",
|
|
234
282
|
"stock_daily",
|
|
235
283
|
"stock_limit_price_daily",
|
|
236
284
|
"stock_performance_daily",
|
|
@@ -139,6 +139,84 @@ class Client:
|
|
|
139
139
|
fields=fields,
|
|
140
140
|
)
|
|
141
141
|
|
|
142
|
+
def stock_margin_detail(
|
|
143
|
+
self,
|
|
144
|
+
ts_code: str | list[str] | None = None,
|
|
145
|
+
*,
|
|
146
|
+
exchange: str | None = None,
|
|
147
|
+
trade_date: Any = None,
|
|
148
|
+
start_date: Any = None,
|
|
149
|
+
end_date: Any = None,
|
|
150
|
+
fields: list[str] | None = None,
|
|
151
|
+
) -> pd.DataFrame:
|
|
152
|
+
"""查询融资融券交易明细(个股级,15 列)。
|
|
153
|
+
|
|
154
|
+
``ts_code`` / ``exchange`` / ``trade_date`` / ``start_date``+``end_date`` **任一**即可,
|
|
155
|
+
``exchange`` 可单独使用(``SH``/``SZ``/``BJ``);代码列表单次最多 100 个。
|
|
156
|
+
``ts_code`` 后缀只用于匹配、不与交易所校验(传 ``600000.SZ`` 会返回 ``600000.SH`` 的行)。
|
|
157
|
+
金额单位为**元**、数量为**股**;明细只含**当前**标的,被调出标的的余额余量在
|
|
158
|
+
``stock_margin_stat`` 中。
|
|
159
|
+
"""
|
|
160
|
+
return self.query(
|
|
161
|
+
"stock_margin_detail",
|
|
162
|
+
ts_code=ts_code,
|
|
163
|
+
exchange=exchange,
|
|
164
|
+
trade_date=trade_date,
|
|
165
|
+
start_date=start_date,
|
|
166
|
+
end_date=end_date,
|
|
167
|
+
fields=fields,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
def stock_margin_stat(
|
|
171
|
+
self,
|
|
172
|
+
*,
|
|
173
|
+
exchange: str | None = None,
|
|
174
|
+
trade_date: Any = None,
|
|
175
|
+
start_date: Any = None,
|
|
176
|
+
end_date: Any = None,
|
|
177
|
+
fields: list[str] | None = None,
|
|
178
|
+
) -> pd.DataFrame:
|
|
179
|
+
"""查询融资融券交易总量(交易所级,20 列)。
|
|
180
|
+
|
|
181
|
+
**必须提供日期条件**(``trade_date`` 或 ``start_date``+``end_date``);``exchange``
|
|
182
|
+
仅用于收窄(不传返回沪深京三行/日)。金额为**元**,但 ``float_shares`` 为**万股**、
|
|
183
|
+
``negotiable_mv``/``turnover_value`` 为**万元**,本接口不做单位换算。
|
|
184
|
+
``tv_change_ratio_hs`` 是沪深京合计口径,同一交易日各交易所行取值相同、不可加总。
|
|
185
|
+
"""
|
|
186
|
+
return self.query(
|
|
187
|
+
"stock_margin_stat",
|
|
188
|
+
exchange=exchange,
|
|
189
|
+
trade_date=trade_date,
|
|
190
|
+
start_date=start_date,
|
|
191
|
+
end_date=end_date,
|
|
192
|
+
fields=fields,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
def stock_margin_market(
|
|
196
|
+
self,
|
|
197
|
+
*,
|
|
198
|
+
report_period: int | None = None,
|
|
199
|
+
trade_date: Any = None,
|
|
200
|
+
start_date: Any = None,
|
|
201
|
+
end_date: Any = None,
|
|
202
|
+
fields: list[str] | None = None,
|
|
203
|
+
) -> pd.DataFrame:
|
|
204
|
+
"""查询融资融券市场统计(全市场,32 列,日频 + 月频同表)。
|
|
205
|
+
|
|
206
|
+
**必须提供日期条件**;``report_period`` 取 ``5``(日)/``1``(月),不传返回两者
|
|
207
|
+
(月末最后交易日会同时出现日频与月频两行,做时间序列前先过滤)。
|
|
208
|
+
金额单位为**亿元**、``individual_num`` 为**万名**;期末账户数、新开账户数、
|
|
209
|
+
可充抵保证金股票市值与「债券/基金/其它市值」**只有月频有值**,日频为空是正常口径。
|
|
210
|
+
"""
|
|
211
|
+
return self.query(
|
|
212
|
+
"stock_margin_market",
|
|
213
|
+
report_period=report_period,
|
|
214
|
+
trade_date=trade_date,
|
|
215
|
+
start_date=start_date,
|
|
216
|
+
end_date=end_date,
|
|
217
|
+
fields=fields,
|
|
218
|
+
)
|
|
219
|
+
|
|
142
220
|
def stock_adjusting_factor(
|
|
143
221
|
self,
|
|
144
222
|
ts_code: str | list[str] | None = None,
|
|
@@ -334,6 +412,55 @@ class Client:
|
|
|
334
412
|
fields=fields,
|
|
335
413
|
)
|
|
336
414
|
|
|
415
|
+
def industry_index(
|
|
416
|
+
self,
|
|
417
|
+
*,
|
|
418
|
+
industry_standard: int,
|
|
419
|
+
industry_level: int,
|
|
420
|
+
industry_code: str | list[str] | None = None,
|
|
421
|
+
fields: list[str] | None = None,
|
|
422
|
+
) -> pd.DataFrame:
|
|
423
|
+
"""查询申万/中信指定级别行业对应的指数。
|
|
424
|
+
|
|
425
|
+
``industry_standard`` 取 37(中信)/ 38(申万),``industry_level`` 取
|
|
426
|
+
1(一级)/ 2(二级)/ 3(三级);``industry_code`` 可选,支持列表与
|
|
427
|
+
逗号分隔。返回 11 列,含行业名称路径、行业代码与指数代码/简称;
|
|
428
|
+
本接口仅支持远程查询。
|
|
429
|
+
"""
|
|
430
|
+
return self.query(
|
|
431
|
+
"industry_index",
|
|
432
|
+
industry_standard=industry_standard,
|
|
433
|
+
industry_level=industry_level,
|
|
434
|
+
industry_code=industry_code,
|
|
435
|
+
fields=fields,
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
def index_relation(
|
|
439
|
+
self,
|
|
440
|
+
index_code: str | list[str],
|
|
441
|
+
*,
|
|
442
|
+
direction: str = "both",
|
|
443
|
+
code_define: int | list[int] | None = None,
|
|
444
|
+
if_effected: int | None = None,
|
|
445
|
+
fields: list[str] | None = None,
|
|
446
|
+
) -> pd.DataFrame:
|
|
447
|
+
"""查询一个指数代码的关联指数(如价格指数与全收益指数)。
|
|
448
|
+
|
|
449
|
+
``index_code`` 必填,可带发布机构后缀或裸代码(港股用 ``HSI.HI``/``HSI``),
|
|
450
|
+
支持列表与逗号分隔。``direction`` 取 ``both``(默认)/``primary``/``related``,
|
|
451
|
+
决定查询代码落在源表哪一侧;``code_define`` 为关联方式码值(如 ``2``
|
|
452
|
+
= 分红规则不同,全收益通常在此);``if_effected`` 为 ``1`` 有效 / ``2`` 失效。
|
|
453
|
+
返回 13 列;本接口仅支持远程查询。
|
|
454
|
+
"""
|
|
455
|
+
return self.query(
|
|
456
|
+
"index_relation",
|
|
457
|
+
index_code=index_code,
|
|
458
|
+
direction=direction,
|
|
459
|
+
code_define=code_define,
|
|
460
|
+
if_effected=if_effected,
|
|
461
|
+
fields=fields,
|
|
462
|
+
)
|
|
463
|
+
|
|
337
464
|
def index_performance(
|
|
338
465
|
self,
|
|
339
466
|
ts_code: str | list[str] | None = None,
|
|
@@ -628,6 +755,31 @@ class Client:
|
|
|
628
755
|
fields=fields,
|
|
629
756
|
)
|
|
630
757
|
|
|
758
|
+
def etf_scale_daily(
|
|
759
|
+
self,
|
|
760
|
+
*,
|
|
761
|
+
ts_code: str | list[str] | None = None,
|
|
762
|
+
trade_date: Any = None,
|
|
763
|
+
start_date: Any = None,
|
|
764
|
+
end_date: Any = None,
|
|
765
|
+
fields: list[str] | None = None,
|
|
766
|
+
) -> pd.DataFrame:
|
|
767
|
+
"""查询 ETF 日规模明细(场内份额与净资产值)。
|
|
768
|
+
|
|
769
|
+
至少需要 ``ts_code`` 或 ``trade_date`` 之一;``trade_date`` 与日期区间互斥,
|
|
770
|
+
区间查询必须带 ``ts_code``。返回 5 列:``ts_code``、``inner_code``、
|
|
771
|
+
``trade_date``、``exchange_shares``(份)、``net_asset``(元);
|
|
772
|
+
本接口仅支持远程查询。
|
|
773
|
+
"""
|
|
774
|
+
return self.query(
|
|
775
|
+
"etf_scale_daily",
|
|
776
|
+
ts_code=ts_code,
|
|
777
|
+
trade_date=trade_date,
|
|
778
|
+
start_date=start_date,
|
|
779
|
+
end_date=end_date,
|
|
780
|
+
fields=fields,
|
|
781
|
+
)
|
|
782
|
+
|
|
631
783
|
def etf_daily(
|
|
632
784
|
self,
|
|
633
785
|
ts_code: str | list[str] | None = None,
|
|
@@ -708,6 +860,64 @@ class Client:
|
|
|
708
860
|
fields=fields,
|
|
709
861
|
)
|
|
710
862
|
|
|
863
|
+
def fund_shares_change(
|
|
864
|
+
self,
|
|
865
|
+
*,
|
|
866
|
+
ts_code: str | list[str] | None = None,
|
|
867
|
+
fund_inner_code: int | list[int] | None = None,
|
|
868
|
+
stat_period: str | int | list[str | int] | None = None,
|
|
869
|
+
report_date: Any = None,
|
|
870
|
+
start_date: Any = None,
|
|
871
|
+
end_date: Any = None,
|
|
872
|
+
fields: list[str] | None = None,
|
|
873
|
+
) -> pd.DataFrame:
|
|
874
|
+
"""查询公募基金份额变动(20 列)。
|
|
875
|
+
|
|
876
|
+
``stat_period``(统计区间)取 ``3`` 季度 / ``6`` 半年 / ``12`` 年度 / ``993`` 截止时点 /
|
|
877
|
+
``995`` 周 / ``996`` 日:``996`` 为交易所日份额(看 ``float_shares``),``993`` 为时点快照
|
|
878
|
+
(看 ``end_shares``),``3/6/12`` 为报告期申赎;三者口径不同、**不可相加**。
|
|
879
|
+
日期参数(``report_date`` 单日 / ``start_date``+``end_date`` 区间)作用于截止日期
|
|
880
|
+
``end_date`` 且互斥;至少提供代码、内码、统计区间或日期条件之一。
|
|
881
|
+
``ts_code`` 支持 ``.SH``/``.SZ``/``.OF`` 后缀或纯代码(按主代码匹配)。
|
|
882
|
+
"""
|
|
883
|
+
return self.query(
|
|
884
|
+
"fund_shares_change",
|
|
885
|
+
ts_code=ts_code,
|
|
886
|
+
fund_inner_code=fund_inner_code,
|
|
887
|
+
stat_period=stat_period,
|
|
888
|
+
report_date=report_date,
|
|
889
|
+
start_date=start_date,
|
|
890
|
+
end_date=end_date,
|
|
891
|
+
fields=fields,
|
|
892
|
+
)
|
|
893
|
+
|
|
894
|
+
def fund_holder_info(
|
|
895
|
+
self,
|
|
896
|
+
*,
|
|
897
|
+
ts_code: str | list[str] | None = None,
|
|
898
|
+
fund_inner_code: int | list[int] | None = None,
|
|
899
|
+
report_date: Any = None,
|
|
900
|
+
start_date: Any = None,
|
|
901
|
+
end_date: Any = None,
|
|
902
|
+
fields: list[str] | None = None,
|
|
903
|
+
) -> pd.DataFrame:
|
|
904
|
+
"""查询公募基金持有人结构(24 列)。
|
|
905
|
+
|
|
906
|
+
返回持有人户数、户均份额、机构/个人/未明确三类的份额与占比、前十大持有人合计、
|
|
907
|
+
从业人员与 ETF 联接基金持有情况,以及高管/基金经理持有份额的**区间上下限**。
|
|
908
|
+
``report_date``(截止日期)与 ``start_date``/``end_date`` 区间互斥;本接口**不要求**
|
|
909
|
+
半年度末(数据源含上市公告书、合同生效公告日)。前十大字段只对交易所交易基金有值。
|
|
910
|
+
"""
|
|
911
|
+
return self.query(
|
|
912
|
+
"fund_holder_info",
|
|
913
|
+
ts_code=ts_code,
|
|
914
|
+
fund_inner_code=fund_inner_code,
|
|
915
|
+
report_date=report_date,
|
|
916
|
+
start_date=start_date,
|
|
917
|
+
end_date=end_date,
|
|
918
|
+
fields=fields,
|
|
919
|
+
)
|
|
920
|
+
|
|
711
921
|
def sge_daily(
|
|
712
922
|
self,
|
|
713
923
|
*,
|
|
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
|