explaingit

jiangtaovan/tdxrs

Analysis updated 2026-05-18

15RustAudience · dataComplexity · 3/5LicenseSetup · moderate

TLDR

A Rust library with Python bindings that parses TDX Chinese stock market data far faster than the original Python tool, while keeping a compatible API.

Mindmap

mindmap
  root((tdxrs))
    What it does
      Parses TDX stock data
      9 to 11x faster than Python
      Compatible with tdxpy API
    Tech stack
      Rust
      PyO3
      maturin
      Tokio
    Use cases
      Fast historical bar parsing
      Real time quote fetching
      Client side price adjustment
    Audience
      Quant researchers
      Financial data engineers
    Client types
      Pooled client
      Direct client
      Finance client
      Async client

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Parse large volumes of Chinese A-share historical price files far faster than pure Python

USE CASE 2

Pull real time five-level quotes and tick data for multiple stocks at once

USE CASE 3

Calculate correctly adjusted prices after stock splits, dividends, or rights issues

USE CASE 4

Swap an existing tdxpy-based Python project onto a faster backend with minimal code changes

What is it built with?

RustPythonPyO3maturinTokiopandas

How does it compare?

jiangtaovan/tdxrscodeaashu/agents-are-thinkingforgeailab/forge
Stars151515
LanguageRustRustRust
Setup difficultymoderateeasymoderate
Complexity3/52/53/5
Audiencedatadeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Rust 1.83+ and maturin to build, Windows builds need an extra MSYS2 dlltool step.

Free to use, modify, and distribute, including commercially, as long as you keep the copyright notice.

In plain English

tdxrs is a Rust rewrite of the parsing engine behind TDX, a data format and protocol used by Chinese stock market software to store and transmit price history. The project exists to make reading and parsing this financial data much faster than the original Python library it replaces, called tdxpy, while keeping the same function names and calling style so existing Python code can switch over with minimal changes. The library exposes its Rust core to Python through PyO3 and maturin, so you install and use it as a normal Python package even though the actual parsing work runs as compiled Rust underneath. Reported benchmarks show roughly nine to eleven times faster local file parsing compared to the pure Python version, and about thirty to fifty percent faster network requests for live quotes and historical bars. Functionally, tdxrs can fetch daily and minute-level candlestick data, real time five-level quotes, tick by tick trade records, security listings, financial statement figures, and dividend or rights adjustment history, either over the network from a TDX server or by reading local .day, .lc5, .lc1, and block data files directly from disk. It also performs the price adjustment math needed to account for stock splits, dividends, and rights issues on the client side, since the raw server data does not include this calculation. The project offers four different client types depending on your use case: a pooled client with retries and caching for normal sequential requests, a client that opens a fresh connection per request for high concurrency work, a specialized client for large financial data files, and an async client built on Tokio. Output can be returned as Python dictionaries, tuples for speed, or pandas DataFrames. Installation is done through maturin, and it requires Rust 1.83 or newer plus Python 3.8 or newer. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Show me how to install tdxrs with maturin and fetch daily bars for a stock
Prompt 2
Help me migrate my existing tdxpy code to tdxrs with minimal changes
Prompt 3
Explain how tdxrs calculates forward and backward adjusted prices for stock splits
Prompt 4
Compare tdxrs's four client types and tell me which one fits high concurrency requests
Prompt 5
Write a script using tdxrs to load local .day files into a pandas DataFrame

Frequently asked questions

What is tdxrs?

A Rust library with Python bindings that parses TDX Chinese stock market data far faster than the original Python tool, while keeping a compatible API.

What language is tdxrs written in?

Mainly Rust. The stack also includes Rust, Python, PyO3.

What license does tdxrs use?

Free to use, modify, and distribute, including commercially, as long as you keep the copyright notice.

How hard is tdxrs to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is tdxrs for?

Mainly data.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.