jiangtaovan

jiangtaovan / tdxrs

Public

tdxrs 是通达信 (TDX) 行情数据解析库的 Rust 高性能实现,通过 PyO3/maturin 提供原生 Python 接口。它无缝兼容 [tdxpy] 的 API,并将核心解析引擎以 Rust 重构,从而实现数量级的本地解析性能提升,尤其在海量历史数据处理场景下优势显著。

13
2
69% credibility
Found May 17, 2026 at 13 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Rust
AI Summary

tdxrs is a high-performance library that gives Python developers easy access to Chinese stock market data. It connects to TongDaXin servers to fetch real-time stock quotes, historical price charts (K-lines), financial reports, and sector information. The library also reads local binary data files containing historical market data. Built in Rust for speed and wrapped for Python, it handles the complex data formats automatically so developers can focus on building their trading tools rather than parsing binary data.

How It Works

1
💡 You discover a faster way to get stock data

You're a Python developer building a trading tool and need real-time Chinese stock market data. You find tdxrs, a library that fetches stock prices much faster than alternatives.

2
📦 You install the package

With one simple command, you add tdxrs to your project. It comes with everything you need to start pulling market data right away.

3
🔌 You connect to the market data servers

The library automatically finds available servers and establishes a connection. You can also specify your own if you prefer.

4
You choose how to get your data
🌐
Fetch live data from servers

Get real-time quotes, historical charts, and financial information directly from market data servers.

📁
Parse local data files

Read and analyze binary data files containing historical stock prices and financial reports.

5
📈 You get clean, structured data

Whether you need stock prices, candlestick charts, or company financials, everything comes back organized and ready to use in your analysis.

🎉 Your trading tool is ready

You have fast, reliable access to Chinese stock market data. Your analysis and trading algorithms can now run smoothly with real-time information.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 13 to 13 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is tdxrs?

tdxrs is a Rust-powered library that parses 通达信 (TDX) binary market data feeds from Chinese stock exchanges and exposes everything through a clean Python API. If you've ever tried to pull K-line data, tick-by-tick trades, or financial reports from TDX servers, you know the protocol is gnarly -- proprietary binary encoding, zlib compression, and a handshake sequence that changes without notice. This library handles all of that in Rust, wraps it with PyO3, and gives you dicts, lists, or pandas DataFrames back. The pitch: take your existing tdxpy code and swap it in for something 10x faster on bulk data operations.

Why is it gaining traction?

The killer feature is the performance delta on historical data. Rust's zero-cost abstractions mean parsing thousands of daily bars or minute-level tick data doesn't involve the Python interpreter at all -- the hot path stays in native code. Beyond raw speed, the library ships with connection pooling, automatic failover across 101 known TDX servers, heartbeat keep-alive, and client-side forward/backward price adjustment (复权) that handles edge cases where dividend events predate your requested window. There's also an async client for tokio-based pipelines and disk caching for large financial report files.

Who should use this?

Quantitative researchers pulling years of minute-bar history for backtesting will see the biggest gains. Algorithmic traders who need real-time quotes with bid/ask depth and tick data will appreciate the clean API and DataFrame output. Anyone currently using tdxpy for bulk data extraction who is bottlenecked on parsing throughput should evaluate this -- the API surface is nearly identical, so migration is low-risk. If you just need occasional single-stock quotes, the overhead of compiling a Rust extension probably isn't worth it yet.

Verdict

At 13 stars and v0.5.0, tdxrs is early but functional -- the credibility score of 0.7% reflects a small community, not broken code. The codebase has solid test coverage and the maintainer clearly understands the TDX protocol. Worth trying for performance-critical workloads, but treat it as beta software and pin your dependencies.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.