Skip to main content

Private macOS runtime and HTTP client for oficcejo/tdx-api.

Project description

pytdxfeed

pytdxfeed is a private Python wrapper around the local oficcejo/tdx-api service used by VQT and vnpy_ths. It provides one macOS LaunchAgent and one HTTP client contract, so both consumers share the same process instead of deploying competing copies.

The package is installed only from the private Git repository. It is not the unrelated package formerly published under similar names on PyPI.

Runtime

  • Host: 127.0.0.1
  • Port: 8080 by default; consumers may select another explicit port
  • Runtime root: ~/.pytdxfeed
  • LaunchAgent: com.hermanzhaozzzz.pytdxfeed.tdx-api
  • Pinned upstream commit: ea07dccb67aeb92ebde851ac31503b4bf457a318

On macOS, ensure_service() reuses an already healthy service or installs the bundled binary for the current architecture. The persistent upstream database is kept in ~/.pytdxfeed/data/database. On other systems the function only checks an existing local service.

from pytdxfeed import TdxApiClient, ensure_service

service = ensure_service(port=18080)
with TdxApiClient(timeout_sec=3.0, port=18080) as client:
    health = client.health()
    quotes = client.batch_quote(["sh600000", "sz159915"])

The host and LaunchAgent identity stay fixed. Port selection is explicit: the runtime never scans for a free port, and an unhealthy unknown process occupying the selected port causes startup to fail without terminating that process. The managed macOS service receives the selected port through TDX_API_PORT.

Development

uv sync --locked --all-groups
uv run ruff check .
uv run ruff format --check .
uv run pytest
uv build

Regenerate the private macOS assets when the locked upstream commit or reviewed private patch set changes:

uv run python scripts/build_assets.py --source /path/to/tdx-api

The build verifies the exact clean upstream checkout, applies the patches in patches/, runs their Go tests, and records every patch checksum in the asset manifest. Artifact generation 3 retains explicit THS JSONP validation and adds strict TDX_API_PORT handling to the Go service. It does not retry or switch market-data sources.

The upstream repository currently has no declared license. This repository and its derived binaries must remain private/internal until redistribution terms are clear.

Project details


Download files

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

Source Distribution

pytdxfeed-0.2.0.tar.gz (12.8 MB view details)

Uploaded Source

Built Distribution

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

pytdxfeed-0.2.0-py3-none-any.whl (12.8 MB view details)

Uploaded Python 3

File details

Details for the file pytdxfeed-0.2.0.tar.gz.

File metadata

  • Download URL: pytdxfeed-0.2.0.tar.gz
  • Upload date:
  • Size: 12.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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}

File hashes

Hashes for pytdxfeed-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dff28c49c866572a78d8f76f321275f8b7f6efbafcb638f41fc31fbc0df0becf
MD5 b7ae0b8e1d7472af00096c7aea788995
BLAKE2b-256 d4fd5336fe5df36a0192d7ba8232246f7cb2d73c2ae66abc6cde6245325e9a42

See more details on using hashes here.

File details

Details for the file pytdxfeed-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pytdxfeed-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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}

File hashes

Hashes for pytdxfeed-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 581b1ecc6263ce3c12a127a23ed56e6b7fe71f1b0592092dac856ebf4f92a951
MD5 1c5851695e3f372f5be04eae78ec5c6a
BLAKE2b-256 fcea475b14cd698956cda5714cb92f7ad9e11b2c7245335f0055447d2880c0c4

See more details on using hashes here.

Supported by

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