johnnybt-ledger-polars
An amount-based bookkeeping policy for johnnybt's
account walk, as a polars expression plugin.
The framework's default policy (johnnybt-polars) is market-neutral: a buy only
fills from cash the account actually has, nobody runs a debt. This one keeps the
books the way a production A-share ledger does:
- Netted funding. A decision is funded once, at sizing, with the gap between target equity and holdings — on the assumption its sells go through. Fills carry no cash check; what a refused sale leaves unpaid becomes a debt in that tranche's own pocket, outside the account's cash and its reported equity, until the next net sale repays it.
- A sellable budget in money, account-wide. One per name across every tranche and the liquidation pool, reset at each close to everything held, drawn down by what each decision meant to sell rather than by what it sold.
- Two-pass sizing. A mask pass sizes under the tighter cash, the frozen budget is released, then the trading pass sizes again — the two see different cash on purpose.
- Estimated commission frozen with a blocked order, at the share count the order was sized for.
It is one Bookkeeping implementation of johnnybt_engine's
account walk: the walk — pricing, ex-dividend, the liquidation pool, equity
snapshots — is the same for every market, and only the funding, sizing and
settlement rules live here.
Install
pip install johnnybt-ledger-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_ledger_polars import simulate
equity = frame.group_by("account").agg(simulate(columns, **kwargs))
columns and kwargs are johnnybt's SimulateKwargs contract — which column
plays which part, the market's rules, the account's terms. The same call shape as
johnnybt_polars.simulate, a different policy behind it.
Build
maturin develop --release # or: maturin build --release
Rust ≥ 1.85, Python ≥ 3.11 (abi3). A pure-Python twin of this policy is held bit-for-bit equal to it by test, which is how the rules stay honest.
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_ledger_polars-0.1.0.tar.gz.
File metadata
- Download URL: johnnybt_ledger_polars-0.1.0.tar.gz
- Upload date:
- Size: 59.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8943e08ab13090b96170ad45716630a2060d987f4d206bbd18fd5716aac3a93
|
|
| MD5 |
039aa272b4c91ade6de2bc580114577d
|
|
| BLAKE2b-256 |
9b65353e44f5506ed180702ac15c1dff4859a86fe6f1b2b131f9ed370b9ed683
|
Provenance
The following attestation bundles were made for johnnybt_ledger_polars-0.1.0.tar.gz:
Publisher:
release.yml on quant-on-quest/johnnybt-ledger-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_ledger_polars-0.1.0.tar.gz -
Subject digest:
c8943e08ab13090b96170ad45716630a2060d987f4d206bbd18fd5716aac3a93 - Sigstore transparency entry: 2784141630
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-ledger-polars@701cc549633681173e2089e5a616a7fd832cf9b3 -
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@701cc549633681173e2089e5a616a7fd832cf9b3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_ledger_polars-0.1.0-cp311-abi3-win_arm64.whl.
File metadata
- Download URL: johnnybt_ledger_polars-0.1.0-cp311-abi3-win_arm64.whl
- Upload date:
- Size: 4.6 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 |
44bb309d4872cb0b188648b4a5eb42a2396f74f576d1fe371c975d134b630012
|
|
| MD5 |
d025f1d3687613a68d0f913e1296fe84
|
|
| BLAKE2b-256 |
8eb112e5aa443eee5d2e671d862d87e63952f2ddea3f09fa2a243c892eb0b27f
|
Provenance
The following attestation bundles were made for johnnybt_ledger_polars-0.1.0-cp311-abi3-win_arm64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-ledger-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_ledger_polars-0.1.0-cp311-abi3-win_arm64.whl -
Subject digest:
44bb309d4872cb0b188648b4a5eb42a2396f74f576d1fe371c975d134b630012 - Sigstore transparency entry: 2784141652
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-ledger-polars@701cc549633681173e2089e5a616a7fd832cf9b3 -
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@701cc549633681173e2089e5a616a7fd832cf9b3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_ledger_polars-0.1.0-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: johnnybt_ledger_polars-0.1.0-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 5.0 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 |
a2001ae0308b50e31a8d322b102799d74f37cab279fff4587ef203e3be163cf3
|
|
| MD5 |
38e2f86e15675846f00ed8d2a7bcaee7
|
|
| BLAKE2b-256 |
d3ef812955004bb2c612d4613fb7cd21e77462b42035045720c53ffc8a070c7f
|
Provenance
The following attestation bundles were made for johnnybt_ledger_polars-0.1.0-cp311-abi3-win_amd64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-ledger-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_ledger_polars-0.1.0-cp311-abi3-win_amd64.whl -
Subject digest:
a2001ae0308b50e31a8d322b102799d74f37cab279fff4587ef203e3be163cf3 - Sigstore transparency entry: 2784141743
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-ledger-polars@701cc549633681173e2089e5a616a7fd832cf9b3 -
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@701cc549633681173e2089e5a616a7fd832cf9b3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.0 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 |
8ec8d0e7dfb8b5bba00f9f90ce8868a1ec7899c9528f8e14fcd17bee33891d20
|
|
| MD5 |
34cc87dfd41a6623809b7f0503ebe34e
|
|
| BLAKE2b-256 |
53f7eb59bfa0dd05593622a99e3c54e815d21242877b6c7797d1035d979a7bc8
|
Provenance
The following attestation bundles were made for johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-ledger-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
8ec8d0e7dfb8b5bba00f9f90ce8868a1ec7899c9528f8e14fcd17bee33891d20 - Sigstore transparency entry: 2784141797
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-ledger-polars@701cc549633681173e2089e5a616a7fd832cf9b3 -
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@701cc549633681173e2089e5a616a7fd832cf9b3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 4.7 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 |
11362669afca8b3f607f13acc09bae06ee2b8ff2168e5b480cb7f9a39f3be997
|
|
| MD5 |
400e4d8e3ef0edeabe5296f764cd8ba1
|
|
| BLAKE2b-256 |
8ac83335ece2f41e521e85626ae64584c0acdf34bb921477c32b860b197fc189
|
Provenance
The following attestation bundles were made for johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-ledger-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_ledger_polars-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
11362669afca8b3f607f13acc09bae06ee2b8ff2168e5b480cb7f9a39f3be997 - Sigstore transparency entry: 2784141855
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-ledger-polars@701cc549633681173e2089e5a616a7fd832cf9b3 -
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@701cc549633681173e2089e5a616a7fd832cf9b3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 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 |
6833511bc5b304da3503cead986f0dd04c86ca0514b80904eebc832c0b77e4a2
|
|
| MD5 |
a8b79d48758d32bc3a29910e67233c3d
|
|
| BLAKE2b-256 |
fa8f89e5d2bc11248ae0fa4eca5ae4a9cdcfa0d4ac031beac2569d50203b2ab4
|
Provenance
The following attestation bundles were made for johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-ledger-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
6833511bc5b304da3503cead986f0dd04c86ca0514b80904eebc832c0b77e4a2 - Sigstore transparency entry: 2784141699
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-ledger-polars@701cc549633681173e2089e5a616a7fd832cf9b3 -
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@701cc549633681173e2089e5a616a7fd832cf9b3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 4.7 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 |
0b1e6f1672f4d74bfbe8de8f156cd6d48e72be2a652af32ac3422847e5481bc2
|
|
| MD5 |
c85b4710d8bb9307ebd1871d145db515
|
|
| BLAKE2b-256 |
921d68081585ece2b1c40dbaf9a8eb6d75f5e8b6897da21b1a0c95abea9abcf3
|
Provenance
The following attestation bundles were made for johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on quant-on-quest/johnnybt-ledger-polars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
johnnybt_ledger_polars-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl -
Subject digest:
0b1e6f1672f4d74bfbe8de8f156cd6d48e72be2a652af32ac3422847e5481bc2 - Sigstore transparency entry: 2784141906
- Sigstore integration time:
-
Permalink:
quant-on-quest/johnnybt-ledger-polars@701cc549633681173e2089e5a616a7fd832cf9b3 -
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@701cc549633681173e2089e5a616a7fd832cf9b3 -
Trigger Event:
push
-
Statement type: