Skip to main content

fxxking-data-client

0.3.0 将公共 bars 契约升级为 API contract 2:bars Arrow Schema 的 currency 允许来源事实缺失时保持 null,同步/异步 HTTP 请求默认携带 X-API-Contract-Version: 2,实时连接默认携带 api_contract_version=2。两条 A 股 ashare-lake 独立订阅能力继续保留:

async with MarketDataStreamClient(base_url, token) as client:
    latest = await client.open_latest_price_subscription(
        market="CN",
        symbol="600519.SH",
        poll_interval="5m",
    )
    closed = await client.open_closed_bar_subscription(
        market="CN",
        symbol="600519.SH",
        interval="5m",
    )

两个句柄均提供 initial_status()current_status()status_updates()events()aclose()CLIENT_VERSION_SERIES="0.3.x" 表示只接受 API contract 2 的兼容系列。

fxxking-data-clientfxxking-data 服务的来源无关 Python Client。 候选版本为 0.3.0,Python import package 保持为 market_data_client

本包提供同步 HTTP Client、异步 HTTP Client、WebSocket Client,以及搜索、标的详情、 K 线、报价、日历和市场状态的强类型请求与响应模型。它不包含服务端实现、存储实现或 Longbridge、Bitget、OpenFIGI 等金融上游 SDK。

安装

正式发布门禁关闭后,从 PyPI 安装精确版本:

python -m pip install fxxking-data-client==0.3.0

当前仓只生成并验证本地 wheel/sdist 发布候选,尚未执行 PyPI 发布。client/dist/ 不是正式 registry,不得据此声明该版本已经发布。

兼容范围

Client 0.3.x 只接受 API contract 2。同步和异步 Client 在首次搜索、详情、K 线 或 backfill 创建前读取服务的公开只读 GET /v1/capabilities;实时 Client 在建立 bars WebSocket 前执行同一握手。成功后在当前实例内缓存。capabilities 缺失、Schema 错误、 contract 不是 2 或缺少必需能力时抛出 CompatibilityError,不会继续访问旧接口或使用 fallback。

M1 最小使用

from market_data_client import MarketDataClient

with MarketDataClient(
    "https://data.example.invalid",
    "service-token",
) as client:
    search = client.search_instruments("AAPL", market="US")
    instrument_id = search.items[0].instrument_id
    details = client.get_instrument(instrument_id)
    bars = client.get_bars_by_instrument(
        instrument_ids=[instrument_id],
        market="US",
        interval="1d",
        start="2025-07-29T00:00:00Z",
        end="2026-07-30T00:00:00Z",
        adjustment="none",
    )

assert details.instrument_id == instrument_id
assert bars.items[0].instrument_id == instrument_id

同步与异步 Client 使用相同公共模型、稳定错误层级和兼容握手。搜索与详情成功响应 保留服务 request ID;K 线结果保留 request/result ID、row count、data version、 generated time 和 canonical hash。Client 只解释数据与协议事实,不决定业务是否运行。 Client 0.3.0 会在同步查询、异步查询和 get_result() 下载后,使用唯一基础 BARS_SCHEMA 对每个成功 item 重算 row count 和 canonical hash;任何内容、 result identity 或 Schema metadata 不一致都会明确失败,不会静默降级。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fxxking_data_client-0.3.0.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fxxking_data_client-0.3.0-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file fxxking_data_client-0.3.0.tar.gz.

File metadata

  • Download URL: fxxking_data_client-0.3.0.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fxxking_data_client-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d7957174d566f45eab1eba01f6170650d7b704af16e7008795c226d10f38a57f
MD5 30b28ef1661c08aed3b399b859c7a916
BLAKE2b-256 2d0976be0be70303a549524f17ef7eaf739fe65e8874162364ced51102c4297e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fxxking_data_client-0.3.0.tar.gz:

Publisher: release-client.yml on git54496/fxxking-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fxxking_data_client-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fxxking_data_client-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a36d81740e802999c7a5758fc7fa5eb1c1a7cf14a7adde0e267cfa2345a146e6
MD5 c9ee32e62c88f77f46980d98da35a2cb
BLAKE2b-256 a4c85a35d380ad907f9dedb01b842ca155ad6a669efc09fc9a021af242a7dfd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fxxking_data_client-0.3.0-py3-none-any.whl:

Publisher: release-client.yml on git54496/fxxking-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.2

2 files

0.3.1

2 files

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page