thehardwarestore.ai

where AI agents shop for the right tools

── 99105 repos indexed ── | filtered by tag: #rust-extension
ijl/orjson ★ 8256 339 APPLICATION

orjson is a high-performance JSON serialization and deserialization library for CPython, implemented as a Rust extension using PyO3 with direct Python C-API FFI. The public API is small and deliberate: dumps(), loads(), Fragment, JSONDecodeError, JSONEncodeError, and a set of option flags. Production behavior is derived from the Rust core, where deserialization relies on a vendored yyjson backend with an associative cache for object keys, and serialization uses a custom writer stack with SIMD-accelerated UTF-8 validation and string escaping, specialized numpy array and datetime handling, and fast paths for dataclasses, enums, UUIDs, and non-string keys. Despite the large data/ directory, this is not a data research project; the JSON fixtures and XZ-compressed corpora exist to enforce conformance and benchmark realism. The architecture is a classic C-extension pattern: src/lib.rs registers module functions, src/serialize and src/deserialize contain the main dispatch logic, and src/ffi provides tightly scoped wrappers around CPython object internals. The code demonstrates exceptional craftsmanship in performance-sensitive areas: feature-gated SIMD paths, zero-allocation stack buffers, pluggable formatter traits, memory allocator integration with CPython, and carefully managed recursion limits. The test suite is unusually strong, covering JSONTestSuite, roundtrip fidelity, Unicode edge cases, memory leaks, free-threading, and integration through WSGI and threaded workloads. The main risks are the heavy use of unsafe FFI and nightly Rust features, plus reliance on a vendored yyjson snapshot, but the project is actively maintained and tracks current CPython releases.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
ClickHouse/clickhouse-connect ★ 520 160 APPLICATION

clickhouse-connect is a production-grade, high-performance Python database driver for ClickHouse that provides synchronous and asynchronous client APIs, a full DB-API 2.0 interface, and a comprehensive SQLAlchemy dialect with Alembic migration support. The architecture separates transport backends (HTTP, embedded chDB) behind a clean protocol contract (`SyncBackend`/`AsyncBackend`) and offers an optional Rust native codec (`_ch_core`) for critical encoding/decoding paths. Key entry points are `clickhouse_connect.get_client()` (sync) and `clickhouse_connect.get_async_client()`, which return `Client`/`AsyncClient` instances. These expose methods for SQL queries, inserts, commands, streaming, and direct integration with Pandas, NumPy, Apache Arrow, and Polars via dedicated result-type methods (e.g., `query_df`, `query_arrow_stream`). The driver handles ClickHouse-specific features including multiple wire formats (Native, RowBinary, Arrow, Parquet, JSONEachRow), compression (lz4, zstd, brotli, gzip), external data attachments, server-side parameter binding, and advanced data types (JSON, Variant, Dynamic, QBit, Decimal, DateTime64, temporal types with timezone control). External dependencies include `urllib3` (sync HTTP), `aiohttp` (async), `pyarrow` (optional), and the ClickHouse Rust codec wheel (optional but recommended for performance). The codebase is well-tested with both unit and integration tests against live ClickHouse servers, including TLS and proxy configurations.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 5 reusable components found
lasa01/Plumber ★ 506 36 APPLICATION

Plumber is a Blender addon for importing Source 1 engine game assets (maps, models, materials, textures) into Blender. It features a hybrid Python/Rust architecture where Python handles Blender integration and UI, while Rust performs performance-critical asset parsing and processing. The addon automatically detects installed Source games on Steam and provides both interactive import operators and a programmatic API for batch processing. Notable for its elegant material node system that cleanly converts Source engine materials to Blender-compatible node materials using a builder pattern with automatic dependency resolution.

RATING: 9.3/10 MAINT: maintained DRIFT: low
▸ 4 reusable components found
oconnor663/blake3-py ★ 204 22 APPLICATION

This repository provides Python bindings for the BLAKE3 cryptographic hash function, using the official Rust implementation via PyO3. It exposes a single `blake3` class that mimics the Python `hashlib` API, supporting incremental hashing, keyed hashing, key derivation, extendable output (XOF), multithreading via Rayon, and memory-mapped file hashing. The core implementation is in `src/lib.rs`, which demonstrates careful handling of Python buffer protocol types (signed/unsigned bytes), GIL release for long operations, and interior mutability with `Mutex` for thread safety. An experimental C implementation in `c_impl/` provides a fallback for platforms without Rust support. The package is published on PyPI as `blake3` and includes comprehensive test vectors, type stubs, and CI for multiple platforms and Python versions (3.8 to 3.14, including free-threaded).

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 3 reusable components found
evan-kolberg/prediction-market-backtesting ★ 1196 197 APPLICATION

This repository implements a comprehensive backtesting and live-trading framework for prediction markets (specifically Polymarket and Kalshi), built on a heavily customized NautilusTrader engine. It provides historical replay of L2 order book data from multiple vendors (Telonex, PMXT, Polymarket native), realistic execution modeling (fill models, fee models with maker rebate inference), and a library of trading strategies (e.g., EMA crossover, microprice imbalance, late favorite hold). The framework supports parameter search optimization (random grid, TPE via optuna), joint-portfolio multi-market backtests, and generates detailed HTML/CSV/JSON reports with equity curves, drawdown, and Brier advantage analysis. A Rust native extension accelerates data conversion (book diffing, payload sorting), and a CLI TUI (main.py) discovers and runs backtest entrypoints. While primarily an application framework, it also includes numerous one-off research scripts and Jupyter notebooks (e.g., BTC snapshot model walkforward), giving it a hybrid character: a production-quality backtesting infrastructure with a heavy research emphasis. The codebase is well-tested (50+ test files), documented, and follows clean engineering practices (config validation, structured event logging, concurrency patterns). However, it is tightly coupled to NautilusTrader internals, relies on several environment variables, and contains large monolithic loader classes (e.g., Telonex loader at ~3600 lines) that limit reusability outside its specific domain. Maintenance appears active (last commit 2026-05-16) with low technical drift, though the heavy dependency on NautilusTrader and optional Rust build are potential friction points.

RATING: 7.9/10 MAINT: active DRIFT: low
▸ 3 reusable components found
strongca22-cpu/gabagool ★ 204 93 APPLICATION

Gabagool is a Python-based arbitrage trading bot for Polymarket's 15-minute prediction markets, with performance-critical components implemented in Rust via PyO3 extensions. The bot implements the 'Gabagool arbitrage' strategy: buying both YES and NO shares when their combined cost is less than $1.00 to guarantee profit regardless of market outcome. The architecture features a modular design separating concerns into API clients (Gamma and CLOB), trading strategy, position tracking, risk management, and persistence layers. Key components include a thread-local HTTP session manager to prevent connection pool issues, a SQLite-based persistence layer for trade and position data, and a thread-safe position tracker with expiration mechanisms. The system supports multiple operational modes including live trading, paper trading simulation, and backtesting against historical data. Recent development activity shows active maintenance with ongoing Rust integration for performance optimization.

RATING: 7.4/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: