Skip to main content

johnnybt-polars

The hot paths of johnnybt in Rust, as polars plugins — so the parallelism lives where the work is, not behind Python's GIL.

Four things, each because the Python version was the bottleneck:

what it does
scan_gbk_csv Scans a directory of GB18030 CSVs as a LazyFrame, decoding in Rust. An IO plugin: projection and predicates push down, files stream in batches. Measured 4.8× a polars-plus-Python decode.
scatter Writes a long frame into dense (rows, cols) float64 matrices, one per column, in parallel on rayon — numpy fancy-index semantics without leaving Rust.
vintage Expands one instrument's filings into vintages in a single pass: for every distinct publish date, the newest period then known and each line's value at that period and at the quarters before it. Point-in-time financials without a self-join.
simulate Walks one account per group — a day-by-day account state machine (johnnybt_engine) under its market-neutral policy: buys fill from cash the account has, blocked orders lock their exact cost, nobody runs a debt.

Every one is an expression or IO plugin: you call it from polars, polars decides the parallelism, and no data crosses back into Python in between.

Install

pip install johnnybt-polars

Prebuilt wheels — no Rust toolchain needed. One per platform, abi3 against Python 3.11, which covers 3.11 through 3.14:

x86_64 arm64
Linux manylinux2014 (glibc 2.17 and up) manylinux2014 (glibc 2.17 and up)
macOS 10.12 and up 11.0 and up
Windows yes yes

Use

import polars as pl
from johnnybt_polars import scan_gbk_csv, vintage

frame = scan_gbk_csv(paths, schema={"股票代码": "str", "收盘价": "float64"}, skip_rows=1)
seen = frame.group_by("股票代码").agg(vintage("报告期", "公告日", "净利润", horizon_days=1))

Build from source

maturin develop --release

Rust ≥ 1.85, Python ≥ 3.11 (abi3 — one wheel covers 3.11 through 3.14).

Licence

MIT

Metadata

Release files for johnnybt-polars 0.1.0

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

Source distribution (sdist)

Source distribution for johnnybt-polars 0.1.0
File Size Uploaded Provenance Actions
johnnybt_polars-0.1.0.tar.gz 85.0 kB With provenance Details for johnnybt_polars-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for johnnybt-polars 0.1.0
File Actions
johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl
johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl
johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 43.8 MB

Release files / johnnybt_polars-0.1.0.tar.gz

Download URL johnnybt_polars-0.1.0.tar.gz
Size 85.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1d0f31554c4009d9f1c470e392bca2edaa41fa1074c50ca98cac4e7876c37b43
BLAKE2b-256 checksum
How to use checksums
26bc8305cacc9e487e84819c9b9e3d96f868a45593737f47fe79e9374a0a9178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl

Download URL johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl
Size 7.0 MB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
08000e97950f25c7c28430273a111e3ab69b2b90b86c0878686077c26b0df2df
BLAKE2b-256 checksum
How to use checksums
0688d266475045b65b4cc214eeb6676451e1fda0ba723e1e7f3f3629bcb88818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl

Download URL johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl
Size 7.7 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0ba814c5d111acc2fc2fb90057eea3235a4ed6712cb063730934a77f16085711
BLAKE2b-256 checksum
How to use checksums
392d28f6b9249450fdf42968ae3396ffc0cbebbdbead3fd6c5e133b728c696c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
4abd95fd080f3dcbebfd5fa57fff7c84c1e373019d865d8926d4e75d90ce62e2
BLAKE2b-256 checksum
How to use checksums
794f96108553648d37e8ebd5888ecee9afd098b86382f7ebc395a5030db9e5fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 7.2 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
bd891e935256914c63080398595ce84f237e600bc25c1bc2ef348c785b2b2793
BLAKE2b-256 checksum
How to use checksums
bbe4a25d01fffe8c0812b33d9208e31276a8eb9c1e6f52223ace622c36eb491a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Size 6.8 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d6380f075afb1e74f211dc0ba64fe2c34b757acb85a9a99a838a90ffeff0678b
BLAKE2b-256 checksum
How to use checksums
81e2a413b1cdccb4683fa4a128cf4064c171b64d9062c41d98b5fff7a2866dc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 7.3 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
603c9b7788af174049a085e3d1878df61665808e0d08fd40575a5fde61308b7f
BLAKE2b-256 checksum
How to use checksums
f932256fdbff91661e79ba902213a16080b94c4670d732dc12e932feb3e50fb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Security for johnnybt-polars 0.1.0

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.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for johnnybt_polars-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

7 release files Full provenance

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