Skip to main content

ys_trade_sdk

YS 交易网关 SDK。账号线程、迅投/聚源客户端、行情与静态信息、盈亏缓存、Auth 账号对账都在这个包里。 契约、Auth 客户端和服务骨架仍在 ys_base。网关改动只升本包,不带动 Auth、MS、模板。

uv add ys_trade_sdk

需要服务骨架的交易系统同时安装底座:

uv add "ys_base[server]"
uv add ys_trade_sdk

本目录开发:

uv python install 3.13
uv sync --frozen
uv run pytest

发布到 PyPI

先改 ys_trade_sdk/__init__.py 的 __version__。PyPI 不允许覆盖同版本。Token 用钥匙串项目 pypi:__token__,不要把明文放进仓库。

cd ys_trade_sdk
./publish-pypi.sh

清华镜像能看到该版本后再给消费仓升锁。生产锁文件走清华镜像,禁止 --default-index https://pypi.org/simple。

from ys_trade_sdk import Account, TradeManager, TradeRuntimeConfig

manager = TradeManager(
    accounts=[
        Account(
            account="A001",
            password="...",
            trade_source="xt",
            trade_uri="ws://trade.example.com",
            profit_enabled=True,
        )
    ],
    runtime_config=TradeRuntimeConfig(
        quote_data_base_url="http://quote.example.com",
        symbol_data_base_url="http://symbol.example.com",
        symbol_data_token="symbol-token",
        trade_data_base_url="http://trade-data.example.com",
        trade_data_username="trade-user",
        trade_data_password="trade-password",
    ),
)

证券连接只认账户快照 stock_td_server。有地址和端口时交易源为迅投,地址为 ws://地址:端口。 profit_enabled=True 时才要求行情、静态信息和交易数据三类地址齐全。

Metadata

Release files for ys_trade_sdk 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ys_trade_sdk 0.1.2
File Size Uploaded Provenance Actions
ys_trade_sdk-0.1.2.tar.gz 146.5 kB Without provenance Details for ys_trade_sdk-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ys_trade_sdk 0.1.2
File Interpreter ABI Platform Actions
ys_trade_sdk-0.1.2-py3-none-any.whl Python 3 none any Details for ys_trade_sdk-0.1.2-py3-none-any.whl

Total release size: 180.8 kB

Release files / ys_trade_sdk-0.1.2.tar.gz

Download URL ys_trade_sdk-0.1.2.tar.gz
Size 146.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a10daf12c061260229eaec31ce723dae1470520acaa4a548b69e3223e8b1a8cd
BLAKE2b-256 checksum
How to use checksums
7735cdf0bb52e4b40e2ae1ffd5a73f7aaefa0cbcd14df0e24a7ced6d96f6e3cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ys_trade_sdk-0.1.2-py3-none-any.whl

Download URL ys_trade_sdk-0.1.2-py3-none-any.whl
Size 34.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81c76b50751c57b0c4672231e3efc367fdf29a531c6f48dfbb03cb329c585d22
BLAKE2b-256 checksum
How to use checksums
0ac8c63976ff3b45d4137f78a2c80d841a4d6bb33711b6c10b242ebab8878bbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ys_trade_sdk 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page