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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file johnnybt_polars-0.1.0.tar.gz.
File metadata
- Download URL: johnnybt_polars-0.1.0.tar.gz
- Upload date:
- Size: 85.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d0f31554c4009d9f1c470e392bca2edaa41fa1074c50ca98cac4e7876c37b43
|
|
| MD5 |
0f05314e4d158c012b5e5b5706220737
|
|
| BLAKE2b-256 |
26bc8305cacc9e487e84819c9b9e3d96f868a45593737f47fe79e9374a0a9178
|
Provenance
The following attestation bundles were made for johnnybt_polars-0.1.0.tar.gz:
Publisher:
release.yml on quant-on-quest/johnnybt-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_polars-0.1.0.tar.gz -
Subject digest:
1d0f31554c4009d9f1c470e392bca2edaa41fa1074c50ca98cac4e7876c37b43 - Sigstore transparency entry: 2784157988
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-polars@01f77466f7ff1b7134ac62844553bc4e0528056c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/quant-on-quest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01f77466f7ff1b7134ac62844553bc4e0528056c -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl.
File metadata
- Download URL: johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl
- Upload date:
- Size: 7.0 MB
- Tags: CPython 3.11+, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08000e97950f25c7c28430273a111e3ab69b2b90b86c0878686077c26b0df2df
|
|
| MD5 |
6ef756ec474bb0dc808ba666bb918bb8
|
|
| BLAKE2b-256 |
0688d266475045b65b4cc214eeb6676451e1fda0ba723e1e7f3f3629bcb88818
|
Provenance
The following attestation bundles were made for johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_polars-0.1.0-cp311-abi3-win_arm64.whl -
Subject digest:
08000e97950f25c7c28430273a111e3ab69b2b90b86c0878686077c26b0df2df - Sigstore transparency entry: 2784158153
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-polars@01f77466f7ff1b7134ac62844553bc4e0528056c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/quant-on-quest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01f77466f7ff1b7134ac62844553bc4e0528056c -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ba814c5d111acc2fc2fb90057eea3235a4ed6712cb063730934a77f16085711
|
|
| MD5 |
64fcf7fbb678413f4860636946c724b2
|
|
| BLAKE2b-256 |
392d28f6b9249450fdf42968ae3396ffc0cbebbdbead3fd6c5e133b728c696c0
|
Provenance
The following attestation bundles were made for johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_polars-0.1.0-cp311-abi3-win_amd64.whl -
Subject digest:
0ba814c5d111acc2fc2fb90057eea3235a4ed6712cb063730934a77f16085711 - Sigstore transparency entry: 2784158183
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-polars@01f77466f7ff1b7134ac62844553bc4e0528056c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/quant-on-quest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01f77466f7ff1b7134ac62844553bc4e0528056c -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.6 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4abd95fd080f3dcbebfd5fa57fff7c84c1e373019d865d8926d4e75d90ce62e2
|
|
| MD5 |
93989bf2d4331f97a80f223ecbcc699d
|
|
| BLAKE2b-256 |
794f96108553648d37e8ebd5888ecee9afd098b86382f7ebc395a5030db9e5fa
|
Provenance
The following attestation bundles were made for johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
4abd95fd080f3dcbebfd5fa57fff7c84c1e373019d865d8926d4e75d90ce62e2 - Sigstore transparency entry: 2784158083
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-polars@01f77466f7ff1b7134ac62844553bc4e0528056c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/quant-on-quest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01f77466f7ff1b7134ac62844553bc4e0528056c -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.2 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd891e935256914c63080398595ce84f237e600bc25c1bc2ef348c785b2b2793
|
|
| MD5 |
1dba7ba95e140b9b828c8b34f7d9e686
|
|
| BLAKE2b-256 |
bbe4a25d01fffe8c0812b33d9208e31276a8eb9c1e6f52223ace622c36eb491a
|
Provenance
The following attestation bundles were made for johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
bd891e935256914c63080398595ce84f237e600bc25c1bc2ef348c785b2b2793 - Sigstore transparency entry: 2784158109
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-polars@01f77466f7ff1b7134ac62844553bc4e0528056c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/quant-on-quest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01f77466f7ff1b7134ac62844553bc4e0528056c -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6380f075afb1e74f211dc0ba64fe2c34b757acb85a9a99a838a90ffeff0678b
|
|
| MD5 |
4f57bab70f44ae9a5b51f92da6f4eae2
|
|
| BLAKE2b-256 |
81e2a413b1cdccb4683fa4a128cf4064c171b64d9062c41d98b5fff7a2866dc1
|
Provenance
The following attestation bundles were made for johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
d6380f075afb1e74f211dc0ba64fe2c34b757acb85a9a99a838a90ffeff0678b - Sigstore transparency entry: 2784158027
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-polars@01f77466f7ff1b7134ac62844553bc4e0528056c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/quant-on-quest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01f77466f7ff1b7134ac62844553bc4e0528056c -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
603c9b7788af174049a085e3d1878df61665808e0d08fd40575a5fde61308b7f
|
|
| MD5 |
0962c892bbbcd014b022c17f482846ed
|
|
| BLAKE2b-256 |
f932256fdbff91661e79ba902213a16080b94c4670d732dc12e932feb3e50fb2
|
Provenance
The following attestation bundles were made for johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl -
Subject digest:
603c9b7788af174049a085e3d1878df61665808e0d08fd40575a5fde61308b7f - Sigstore transparency entry: 2784158051
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-polars@01f77466f7ff1b7134ac62844553bc4e0528056c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/quant-on-quest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01f77466f7ff1b7134ac62844553bc4e0528056c -
Trigger Event:
push
-
Statement type: