ffdata 0.2.7__tar.gz → 0.2.9__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 (27) hide show
  1. {ffdata-0.2.7 → ffdata-0.2.9}/PKG-INFO +1 -1
  2. {ffdata-0.2.7 → ffdata-0.2.9}/pyproject.toml +1 -1
  3. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/__init__.py +18 -0
  4. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/client.py +95 -3
  5. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata.egg-info/PKG-INFO +1 -1
  6. {ffdata-0.2.7 → ffdata-0.2.9}/README.md +0 -0
  7. {ffdata-0.2.7 → ffdata-0.2.9}/scripts/configure_ffdata.sh +0 -0
  8. {ffdata-0.2.7 → ffdata-0.2.9}/setup.cfg +0 -0
  9. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/cli.py +0 -0
  10. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/datasets/__init__.py +0 -0
  11. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/datasets/manager.py +0 -0
  12. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/local/__init__.py +0 -0
  13. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/local/store.py +0 -0
  14. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/transport/__init__.py +0 -0
  15. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata/transport/http.py +0 -0
  16. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata.egg-info/SOURCES.txt +0 -0
  17. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata.egg-info/dependency_links.txt +0 -0
  18. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata.egg-info/entry_points.txt +0 -0
  19. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata.egg-info/requires.txt +0 -0
  20. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata.egg-info/top_level.txt +0 -0
  21. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata_common/__init__.py +0 -0
  22. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata_common/codecs/__init__.py +0 -0
  23. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata_common/codecs/arrow.py +0 -0
  24. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata_common/errors.py +0 -0
  25. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata_common/protocol.py +0 -0
  26. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata_common/schemas/__init__.py +0 -0
  27. {ffdata-0.2.7 → ffdata-0.2.9}/src/ffdata_common/schemas/manifest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ffdata
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: ffdata lightweight Python client for governed financial-data APIs
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ffdata"
3
- version = "0.2.7"
3
+ version = "0.2.9"
4
4
  description = "ffdata lightweight Python client for governed financial-data APIs"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -152,6 +152,11 @@ def fund_stock_portfolio(*args: Any, **kwargs: Any):
152
152
  return _client().fund_stock_portfolio(*args, **kwargs)
153
153
 
154
154
 
155
+ def sge_daily(*args: Any, **kwargs: Any):
156
+ """通过默认客户端查询上海黄金交易所现货日行情(20 列,前 14 列对齐 Tushare)。"""
157
+ return _client().sge_daily(*args, **kwargs)
158
+
159
+
155
160
  def macro_indicator_basic(*args: Any, **kwargs: Any):
156
161
  return _client().macro_indicator_basic(*args, **kwargs)
157
162
 
@@ -160,6 +165,16 @@ def macro_indicator_data(*args: Any, **kwargs: Any):
160
165
  return _client().macro_indicator_data(*args, **kwargs)
161
166
 
162
167
 
168
+ def intl_macro_indicator_basic(*args: Any, **kwargs: Any):
169
+ """通过默认客户端查询国际宏观指标基本信息(国家/口径/频率/单位随行返回)。"""
170
+ return _client().intl_macro_indicator_basic(*args, **kwargs)
171
+
172
+
173
+ def intl_macro_indicator_data(*args: Any, **kwargs: Any):
174
+ """通过默认客户端查询国际宏观指标时间序列(含预测值标识)。"""
175
+ return _client().intl_macro_indicator_data(*args, **kwargs)
176
+
177
+
163
178
  def trade_cal(*args: Any, **kwargs: Any):
164
179
  """通过默认客户端查询交易日历(8 列,支持沪深/北交所/港股/美股/银行间)。"""
165
180
  return _client().trade_cal(*args, **kwargs)
@@ -191,9 +206,12 @@ __all__ = [
191
206
  "index_valuation",
192
207
  "index_weight",
193
208
  "index_industry",
209
+ "intl_macro_indicator_basic",
210
+ "intl_macro_indicator_data",
194
211
  "macro_indicator_basic",
195
212
  "macro_indicator_data",
196
213
  "query",
214
+ "sge_daily",
197
215
  "sql_query",
198
216
  "set_token",
199
217
  "stock_adjusting_factor",
@@ -358,10 +358,23 @@ class Client:
358
358
  *,
359
359
  indicator_code: int | list[int] | None = None,
360
360
  name: str | None = None,
361
+ state: str = "active",
362
+ limit: int = 20,
361
363
  fields: list[str] | None = None,
362
364
  ) -> pd.DataFrame:
365
+ """查询宏观指标基本信息(名称 → 指标代码)。
366
+
367
+ ``name`` 走全库名称检索(支持空格分词),``state`` 默认 ``active`` 只返回有效
368
+ 指标(``all`` 含已终止指标),``limit`` 默认 20、最大 200。返回的
369
+ ``indicator_code`` 可直接用于 :meth:`macro_indicator_data`。
370
+ """
363
371
  return self.query(
364
- "macro_indicator_basic", indicator_code=indicator_code, name=name, fields=fields
372
+ "macro_indicator_basic",
373
+ indicator_code=indicator_code,
374
+ name=name,
375
+ state=state,
376
+ limit=limit,
377
+ fields=fields,
365
378
  )
366
379
 
367
380
  def macro_indicator_data(
@@ -380,6 +393,55 @@ class Client:
380
393
  fields=fields,
381
394
  )
382
395
 
396
+ def intl_macro_indicator_basic(
397
+ self,
398
+ *,
399
+ name: str | None = None,
400
+ indicator_code: int | list[int] | None = None,
401
+ region: str | list[str] | None = None,
402
+ state: str = "active",
403
+ limit: int = 20,
404
+ fields: list[str] | None = None,
405
+ ) -> pd.DataFrame:
406
+ """查询国际宏观指标基本信息(名称/地区 → 指标代码)。
407
+
408
+ ``name`` 同时匹配中文名与英文名(支持空格分词),``region`` 按国家/地区名称
409
+ 精确筛选;``state`` 默认 ``active`` 只返回有效指标(``all`` 含已终止指标),
410
+ ``limit`` 默认 20、最大 200。返回的 ``indicator_code`` 可直接用于
411
+ :meth:`intl_macro_indicator_data`。
412
+ """
413
+ return self.query(
414
+ "intl_macro_indicator_basic",
415
+ indicator_code=indicator_code,
416
+ name=name,
417
+ region=region,
418
+ state=state,
419
+ limit=limit,
420
+ fields=fields,
421
+ )
422
+
423
+ def intl_macro_indicator_data(
424
+ self,
425
+ indicator_code: int | list[int],
426
+ *,
427
+ start_date: Any = None,
428
+ end_date: Any = None,
429
+ fields: list[str] | None = None,
430
+ ) -> pd.DataFrame:
431
+ """查询国际宏观指标时间序列(指标代码 → 指标数据)。
432
+
433
+ ``indicator_code`` 取自 :meth:`intl_macro_indicator_basic`;``start_date`` /
434
+ ``end_date`` 可只给一端,都不给表示返回全部可用数据。返回行含单位/频率与
435
+ ``data_disclosure_type``(``2401`` 表示预测值,空表示实际值),数值不做换算。
436
+ """
437
+ return self.query(
438
+ "intl_macro_indicator_data",
439
+ indicator_code=indicator_code,
440
+ start_date=start_date,
441
+ end_date=end_date,
442
+ fields=fields,
443
+ )
444
+
383
445
  def stock_basic(
384
446
  self,
385
447
  *,
@@ -489,8 +551,9 @@ class Client:
489
551
  或纯代码(服务端剥离后缀后匹配,并校验后缀与交易所一致);``index_code``
490
552
  是跟踪目标代码,可能是指数,也可能是现货/商品标的;``list_status`` 取
491
553
  ``L``/``D``/``P``;``exchange`` 取 ``SH``/``SZ``;``mgr`` 按管理人简称
492
- 模糊匹配;``csrc_category`` 按证监会分类中文名称等值过滤。返回 19 列,其中 ``inner_code``(ETF 聚源内码)与
493
- ``index_inner_code``(跟踪目标聚源内码)是 ffdata 扩展字段;不传任何过滤
554
+ 模糊匹配;``csrc_category`` 按证监会分类中文名称等值过滤。返回 21 列,其中 ``inner_code``(ETF 聚源内码)、
555
+ ``index_inner_code``(跟踪目标聚源内码)、``track_asset_type``(跟踪资产类型)
556
+ 与 ``track_asset_category``(原始类别编码)是 ffdata 扩展字段;不传任何过滤
494
557
  条件时返回全部沪深上市 ETF。本接口仅支持远程查询。
495
558
  """
496
559
  return self.query(
@@ -585,6 +648,35 @@ class Client:
585
648
  fields=fields,
586
649
  )
587
650
 
651
+ def sge_daily(
652
+ self,
653
+ *,
654
+ ts_code: str | list[str] | None = None,
655
+ trade_date: Any = None,
656
+ start_date: Any = None,
657
+ end_date: Any = None,
658
+ date_type: int = 3,
659
+ fields: list[str] | None = None,
660
+ ) -> pd.DataFrame:
661
+ """查询上海黄金交易所现货日行情(20 列,前 14 列对齐 Tushare ``sge_daily``)。
662
+
663
+ ``ts_code`` 为聚源现货合约代码原值(如 ``Au99.99``、``Au(T+D)``、``iAu99.99``),
664
+ **不带市场后缀**,支持列表与逗号分隔;``trade_date`` 与 ``start_date``/
665
+ ``end_date`` 互斥,且至少需要 ``ts_code`` 或 ``trade_date`` 之一。
666
+ ``date_type`` 默认 ``3``(日,与 Tushare 一致),``4`` 为聚源周频扩展。
667
+ 价格元/克、``vol`` 千克、``amount`` 元、``pct_change`` 为百分数;``change`` 与
668
+ ``pct_change`` 为聚源原值(两者比较基准不同,见接口文档)。
669
+ """
670
+ return self.query(
671
+ "sge_daily",
672
+ ts_code=ts_code,
673
+ trade_date=trade_date,
674
+ start_date=start_date,
675
+ end_date=end_date,
676
+ date_type=date_type,
677
+ fields=fields,
678
+ )
679
+
588
680
  def cb_daily(
589
681
  self,
590
682
  *,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ffdata
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: ffdata lightweight Python client for governed financial-data APIs
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
File without changes
File without changes
File without changes
File without changes