hypercast
match/case over a two-case verdict — the value, or a closed reason plus the exact
byte span that offended — with the Rust core linked straight into CPython as a native
extension. No dlopen, no ctypes marshalling, no runtime bridge.
Allocation-lean scalar casts — booleans, the full integer family, reals, UUIDs, temporals.
The PyO3 extension (hypercast._native) is the only backend — a door is an ordinary
METH_FASTCALL extension call into a direct Rust call, and the wheel maturin builds is
the whole package (the interim ctypes fallback is gone). Python 3.10 is the floor
(match/case is the consumption
idiom); wheels are abi3-py310, one per platform covering every CPython from there up, no
compiler needed to install.
import hypercast
match hypercast.cast_i32("(1,234)", hypercast.NumFormat.INVARIANT):
case hypercast.Success(value):
print("got", value) # -1234, accounting negative
case hypercast.Fault(reason, offset, length):
print(reason.name, "at byte", offset)
Door names mirror the native ABI (cast_i32, cast_f64, cast_timestamp, …); inputs are
str or bytes, both zero-copy views. Exhaustiveness is the type checker's job here —
pair the two cases with typing.assert_never under mypy/pyright for the compile-time
guarantee the static bindings get natively. Python-flavored fidelity, stated honestly:
int is unbounded, so cast_u64 returns the true unsigned value with no bit-pattern
games; datetime's resolution is microseconds, so the core's nanoseconds truncate by
three digits on the temporal doors — datetime's own ceiling, not the parser's, and said
out loud rather than discovered later.
Why not int() / fromisoformat / dateutil?
-
Verdicts, not exceptions — bad data is the expected case for untrusted text, and a
Faultis a reason plus a span, not aValueErrorto catch and regex. -
The vocabulary untrusted sources actually send — twenty boolean lexemes, accounting parentheses, declared separators, radix prefixes, all five .NET
Guidtext forms plusurn:uuid:prefixes, protobuf JSON durations — with each lenience individually declared, never guessed. -
One engine across a polyglot system — bit-for-bit verdicts with every other binding, held by the shared corpus (26 tests green, full twelve-file corpus replay).
-
Native-extension speed — the escape from the interpreted tier is this binding's own receipt: the old losses were never "Python calling native code," they were ctypes (~1 µs of interpreted marshalling per call, measured). With the mechanism replaced, every door runs 10-18x faster than it did over ctypes (pyperf, linux-arm64): timestamp 3.07 µs → 201 ns — near-parity with C-accelerated
fromisoformat(163 ns) while returning verdicts instead of exceptions; i32 at 146 ns vsint()'s 88; uuid at parity withuuid.UUID()(both sides bounded byUUID.__init__itself); and the forgiveness doors at ~180 ns for grammar the stdlib doesn't sell at any price.The messy-feed doors are where the gap is widest, because
strptimeis the only stdlib parser that accepts their input at all — and it is slow:Door HyperCast stdlib Verdict cast_datetime("1/7/2026 3:04 PM", MONTH_DAY_YEAR)409 ns 5.19 µs datetime.strptime12.7x faster cast_date("1/7/2026", MONTH_DAY_YEAR)292 ns 3.86 µs datetime.strptime13.2x faster Separator detection costs ~18 ns:
1.234.567,89underNumFormat.DETECTis 216 ns against 198 ns for the same text under a declared eurozone format. Reproduce:python bench_cast.py --fast(pyperf, in thebenchextra).
The honest trade-off: for plain invariant integers int() still wins — it's a
C-accelerated builtin with no boundary to cross. These doors earn their keep on the
culture-machinery parsers, the closed error contract, and cross-language agreement. And
dropping ctypes means dropping the Pyodide/wasm path Python briefly had — the wheels are
real native extensions, and a native extension has no browser story.
Install
Not on PyPI yet — the release pipeline is staged (.github/workflows/release.yml,
Trusted Publishing pending) and the wheels ship with the first coordinated tag. Until
then: clone the repo, cargo build --release --features python in rust/, copy
libhypercast.so to python/src/hypercast/_native.abi3.so (CI's own staging step, by
hand), and pytest — tests/conftest.py puts the in-repo package on the path with no
install step.
See the repo root README for the full door table, the receipts, and the state of every other language binding.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 hypercast-0.0.1-cp310-abi3-win_arm64.whl.
File metadata
- Download URL: hypercast-0.0.1-cp310-abi3-win_arm64.whl
- Upload date:
- Size: 204.1 kB
- Tags: CPython 3.10+, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95cd0036b1d24feba51508c31753c744f7c4e9211d337d538adf0f8777481274
|
|
| MD5 |
30c9e68c9209bc0a7464410abb15c286
|
|
| BLAKE2b-256 |
a310a47f039ef123ce1734cad4cf5c67f5567fff8a5bedcf4a441ab66e7f9fd2
|
Provenance
The following attestation bundles were made for hypercast-0.0.1-cp310-abi3-win_arm64.whl:
Publisher:
release.yml on SkunkWerkx/HyperCast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypercast-0.0.1-cp310-abi3-win_arm64.whl -
Subject digest:
95cd0036b1d24feba51508c31753c744f7c4e9211d337d538adf0f8777481274 - Sigstore transparency entry: 2666261128
- Sigstore integration time:
-
Permalink:
SkunkWerkx/HyperCast@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/SkunkWerkx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Trigger Event:
push
-
Statement type:
File details
Details for the file hypercast-0.0.1-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: hypercast-0.0.1-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 207.9 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34e554536f2e16509564567dcfb1df5b0ad73ed5159e5cb367d6a92b4fba7c31
|
|
| MD5 |
57accedb233e9f59900f834c0823bfde
|
|
| BLAKE2b-256 |
c2cb83585294d1bd3b9e9dff14e04dfdd1383ab37d42e7635b0c3dba24369311
|
Provenance
The following attestation bundles were made for hypercast-0.0.1-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on SkunkWerkx/HyperCast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypercast-0.0.1-cp310-abi3-win_amd64.whl -
Subject digest:
34e554536f2e16509564567dcfb1df5b0ad73ed5159e5cb367d6a92b4fba7c31 - Sigstore transparency entry: 2666261396
- Sigstore integration time:
-
Permalink:
SkunkWerkx/HyperCast@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/SkunkWerkx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Trigger Event:
push
-
Statement type:
File details
Details for the file hypercast-0.0.1-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hypercast-0.0.1-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 354.6 kB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0856d2bb2083c0d40defcdacf0e2c25e8dcec94ba206e9cc0868239fd4c64234
|
|
| MD5 |
1b35e0c74325722327558384dd803c15
|
|
| BLAKE2b-256 |
124359edbb0100e76e1505bdcaf365ccef1f5a4894e815f2564eda0befb42560
|
Provenance
The following attestation bundles were made for hypercast-0.0.1-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on SkunkWerkx/HyperCast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypercast-0.0.1-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
0856d2bb2083c0d40defcdacf0e2c25e8dcec94ba206e9cc0868239fd4c64234 - Sigstore transparency entry: 2666261235
- Sigstore integration time:
-
Permalink:
SkunkWerkx/HyperCast@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/SkunkWerkx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Trigger Event:
push
-
Statement type:
File details
Details for the file hypercast-0.0.1-cp310-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: hypercast-0.0.1-cp310-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 351.9 kB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53861b6235e8add5e275202d3ce4687f77f6780970d47ca43f2b1504d852007d
|
|
| MD5 |
c53feb819243d4f5ce5d652ac817c50d
|
|
| BLAKE2b-256 |
51cd09400e7c85e7b830d157c978053bcaeeb52173a992fa6da65ecf6a173c56
|
Provenance
The following attestation bundles were made for hypercast-0.0.1-cp310-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on SkunkWerkx/HyperCast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypercast-0.0.1-cp310-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
53861b6235e8add5e275202d3ce4687f77f6780970d47ca43f2b1504d852007d - Sigstore transparency entry: 2666261191
- Sigstore integration time:
-
Permalink:
SkunkWerkx/HyperCast@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/SkunkWerkx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Trigger Event:
push
-
Statement type:
File details
Details for the file hypercast-0.0.1-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: hypercast-0.0.1-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 315.9 kB
- Tags: CPython 3.10+, 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 |
a0a85ce0b9d370ebeb5ada3f0b0233afbaf1a81ab02ea2d981e57a4b28911610
|
|
| MD5 |
1305047a8272cf98058953f4379e50a5
|
|
| BLAKE2b-256 |
fb5c10b2d268fe1551376c4e6ecd5f253a0a3d43dc56ff1171f7351d193f0b6d
|
Provenance
The following attestation bundles were made for hypercast-0.0.1-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on SkunkWerkx/HyperCast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypercast-0.0.1-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
a0a85ce0b9d370ebeb5ada3f0b0233afbaf1a81ab02ea2d981e57a4b28911610 - Sigstore transparency entry: 2666261171
- Sigstore integration time:
-
Permalink:
SkunkWerkx/HyperCast@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/SkunkWerkx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Trigger Event:
push
-
Statement type:
File details
Details for the file hypercast-0.0.1-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: hypercast-0.0.1-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 317.8 kB
- Tags: CPython 3.10+, 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 |
de228f50893552e22630db5fe8dcff668f9aadcf697bb9ddb1324ed8cc1464fe
|
|
| MD5 |
c42d75daa975dde0978fb0f28237acf1
|
|
| BLAKE2b-256 |
dfafe0d47a2d6bc418e7967c921f82369ab814df91f2cd48211af895064138ae
|
Provenance
The following attestation bundles were made for hypercast-0.0.1-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on SkunkWerkx/HyperCast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypercast-0.0.1-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
de228f50893552e22630db5fe8dcff668f9aadcf697bb9ddb1324ed8cc1464fe - Sigstore transparency entry: 2666261303
- Sigstore integration time:
-
Permalink:
SkunkWerkx/HyperCast@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/SkunkWerkx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1ab63c8c7212beef4e85afb4e6060eb72de1acc -
Trigger Event:
push
-
Statement type: