Skip to main content

dizzle

dizzle.png

Rust-powered functional toolkit for Python 3.13+: the toolz API you know, an Option/Result you've wanted, and a fluent Iter — all executing in native code.

Install

pip install dizzle  # or: uv add dizzle

The three layers

# 1. toolz-compatible flat functions — switch by changing an import
from dizzle import groupby, frequencies, merge, pipe, curried

groupby(len, ["a", "bb", "cc", "d"])   # {1: ['a', 'd'], 2: ['bb', 'cc']}

# 2. Option/Result — partiality without try/except
from dizzle.option import Option, get_in_opt, Some

loc = (get_in_opt(payload, "results", 0, "geometry", "location")
       .map(Location.from_dict)
       .unwrap_or(None))

match Option.of(user.email):
    case Some(email): send(email)
    case _:           skip()

# 3. Fluent Iter — Rust-iterator ergonomics, single-pass, lazy
from dizzle import Iter

(Iter(rows)
    .filter(lambda r: r["active"])
    .pluck("city")
    .frequencies())

Semantics

  • Flat layer matches toolz exactly — including exceptions (first([]) raises).
  • Option-returning twins (first_opt, get_in_opt, …) and all Iter partial terminals never raise on missing data.
  • Your callbacks' exceptions always propagate — nothing is swallowed.

Development

uv sync                      # builds the Rust extension via maturin
uv run pytest                # oracle + property tests against toolz
uv run pytest benches --benchmark-only   # vs cytoolz

Performance

Informational benchmarks against cytoolz and toolz live in benches/ and run explicitly:

uv run pytest benches --benchmark-only

As of 2026-08-27 (Python 3.13, Apple Silicon; median mean-time of 3 runs, ratio = dizzle/cytoolz, lower is better). The five benchmarks of the 0.4.0 suite hold at geometric mean 0.79x (~21% faster than cytoolz); the broad 16-group suite of 0.5.0, deliberately including the worst cases, sits at 1.07x; the two int64-buffer groups added in 0.6.0 land at 0.07x / 0.10x (10–14x faster), putting the full 18-group suite at 0.81x:

benchmark dizzle cytoolz toolz vs cytoolz
frequencies (30k int64 buffer) 52 us 756 us 1164 us 0.07x
unique (30k int64 buffer) 36 us 363 us 414 us 0.10x
frequencies (30k strs) 364 us 709 us 1091 us 0.51x
curry 3-arg chain 5 us 10 us 13 us 0.54x
groupby(len) (30k strs) 318 us 484 us 494 us 0.66x
unique (30k ints) 149 us 195 us 393 us 0.76x
take(1000) (30k ints) 5 us 5 us 5 us 1.00x (tie)
drop(29k) (30k ints) 64 us 63 us 65 us 1.00x (tie)
mapcat(reversed) (30 × 1k lists) 95 us 95 us 95 us 1.00x (tie)
concat (30 × 1k lists) 103 us 101 us 101 us 1.01x (tie)
cons (30k ints) 108 us 105 us 104 us 1.02x (tie)
merge (200 dicts × 50 keys) 112 us 109 us 117 us 1.02x (tie)
pluck('a') (10k dicts) 85 us 76 us 107 us 1.12x
sliding_window(3) (30k ints) 1329 us 1133 us 1228 us 1.17x
partition_all(100) (30k ints) 117 us 97 us 102 us 1.21x
interpose (30k ints) 276 us 185 us 717 us 1.49x
last (30k list) 0.07 us 0.03 us 0.06 us 2.65x
frequencies (5 items) 0.31 us 0.09 us 0.42 us 3.41x

How: eager hot functions bypass per-item C-API traffic with a GIL-held Rust-side index (one PyObject_Hash + inline probe per element instead of two dict lookups), CPython's own container fast paths (cached str hashes, compact-int values, identity-first probes), vectorcall for key callbacks, and direct PyList_GET_ITEM iteration over exact-list sources. Lazy functions toolz composes from itertools (take, drop, concat, cons, mapcat) return exactly those C iterators, so they tie by construction. The iterator classes dizzle writes itself sit behind hand-written tp_iternext slot functions instead of PyO3's generated trampoline, and pluck gets a dedicated iterator (one PyObject_GetItem per element) instead of map(itemgetter) — that narrowed interpose from 1.9x to ~1.4–1.5x against Cython's C class and pluck from 1.4x to 1.1x. Inputs exporting a 1-D contiguous integer buffer of any width and signedness (numpy int dtypes, array.array, bytes) take zero-copy native paths in frequencies (eager count, each distinct value boxed once, first-encounter order — keys are Python ints, dict-equal to numpy's own scalars) and keyless unique (lazy native scan): 8–15x faster than cytoolz at 30k elements, 11.9x at 1M np.int64 — and 3.9x faster than np.unique(return_counts=True), since a hash count beats a sort. Keyless topk runs a k-sized min-heap over the same buffers, boxing only the k survivors (17x at 30k, k=10), and isdistinct scans them natively with an early exit (1.5x on fully-distinct data, 100x+ when a duplicate appears early). Floats stay on the iteration path: toolz's dict keeps every NaN scalar as a distinct key, which a native value hash would silently merge. Above ~500k elements frequencies and topk fan out across cores with rayon (the parallel cargo feature, on by default) — frequencies first counts one chunk alone and only fans out when the observed cardinality says the merge will be cheap. 10M np.int64: counted in 12.9ms, 15x faster than np.unique(return_counts=True); topk(10) in 2.4ms, 1.8x faster than np.partition. curry resolves inspect.signature once per chain, making chained partial application ~2x faster than cytoolz. The remaining gaps are floors, not algorithms: the sub-microsecond rows (last, 5-item frequencies) measure fixed call overhead — absolute deltas of 40–220ns per call.

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dizzle-0.8.0.tar.gz (107.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dizzle-0.8.0-cp314-cp314-win_amd64.whl (394.3 kB view details)

Uploaded CPython 3.14Windows x86-64

dizzle-0.8.0-cp314-cp314-musllinux_1_2_x86_64.whl (720.3 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

dizzle-0.8.0-cp314-cp314-musllinux_1_2_aarch64.whl (672.3 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

dizzle-0.8.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.2 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

dizzle-0.8.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (493.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

dizzle-0.8.0-cp314-cp314-macosx_11_0_arm64.whl (457.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

dizzle-0.8.0-cp314-cp314-macosx_10_12_x86_64.whl (489.7 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

dizzle-0.8.0-cp313-cp313-win_amd64.whl (394.7 kB view details)

Uploaded CPython 3.13Windows x86-64

dizzle-0.8.0-cp313-cp313-musllinux_1_2_x86_64.whl (720.8 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

dizzle-0.8.0-cp313-cp313-musllinux_1_2_aarch64.whl (671.4 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

dizzle-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

dizzle-0.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (493.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

dizzle-0.8.0-cp313-cp313-macosx_11_0_arm64.whl (457.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dizzle-0.8.0-cp313-cp313-macosx_10_12_x86_64.whl (489.2 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

Details for the file dizzle-0.8.0.tar.gz.

File metadata

  • Download URL: dizzle-0.8.0.tar.gz
  • Upload date:
  • Size: 107.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dizzle-0.8.0.tar.gz
Algorithm Hash digest
SHA256 c2c6a6a48aa6dd1d99e2e70a81c1c9e29a04205ce5a62a794cf89a32aa4e1307
MD5 f0d807edd98f1d0e1ee4304b5bb5be86
BLAKE2b-256 833756f099a0b0a60718a72df0cc19544a8fa6b0e33ec4edfbc81312c47a2ab9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0.tar.gz:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: dizzle-0.8.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 394.3 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dizzle-0.8.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 205f2a347e022faa9809eecd27b7ec6ebe413fd0a372ee9883af908d7767e13d
MD5 266f202de2cf94330352b1407287e7a2
BLAKE2b-256 c3260f3124372955c8d25f8917c35d246d635254929cab340547c5c4c1a2a889

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp314-cp314-win_amd64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e1672148d7c3c1867b241853af35a05b607d89faba239671b43f40e74600644e
MD5 43563073efcab261bfef779ab65e2b4e
BLAKE2b-256 07850be3674e848f52c86e6f486db01ac3a655d9572d99ff684f0c29d04c06b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp314-cp314-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fa3dd1ef61e4933f7005055d790bd163b70d8817b070e8751d131606c1b4351c
MD5 95cb67f052e197cc2f30dd12ecfc13e9
BLAKE2b-256 2c3ba04968dd6775c2070ca2cce1c3dd7d4140798b4bcbe3dbbfe904b63e1470

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp314-cp314-musllinux_1_2_aarch64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48dea0085746b8661551b8ab0d546227e5f64cd69f5b27d9fd220d7c5ab8b97f
MD5 931a10db20cdfa6b7dc18001d678627b
BLAKE2b-256 bcd4b9f41565e0eebc4689e63df16b35d25316f36e7121a4748ffbe9728237f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 da7b8a2711432ba91eb7bb254c7e96b29ec985cca0291fb572a6944cfd5ab3d8
MD5 0b7c9d5ab966848a282fd88d487c90af
BLAKE2b-256 d48d395606ae2141e65680e62133458de5f81358e3c4368126d3b3a163c08947

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c4ca886d913e4e729a39f97f96ec5f203f07516ee9f7708a4b9c40bc3ae991a
MD5 c9aefab9df57d76c9a0044d797cebac6
BLAKE2b-256 595665f1f1baf5f181d213a2589c2291dfed53156c89c7d65cefd31b9dfa8b44

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 df3ca952dccded9bdd97f87f5aa593f986ddb53b357ee334282cfa48154d4ce2
MD5 f8ce3c89ec6a6c38edcc6ac7544a25e9
BLAKE2b-256 dec031b71d3e06c7a8034b7d2f4a2574734fb22ed2887416382f53c3169efdca

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: dizzle-0.8.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 394.7 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dizzle-0.8.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7fa5d5935b202d43469fe7f29f976cb74631916277712dff4c40c8bd188deee6
MD5 1b19d50c389e2c251090b84965514da1
BLAKE2b-256 d1ea16c154b2efe81e6366f41c4ee808c725e9fdc7f85fc063725c40dd02dca1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9ff54fa7905eef20e78ee85deb5655e2ae88c81ac9ee79f4e7da3c2839107a74
MD5 eb17e4641a7d35715d63abf311cc88a7
BLAKE2b-256 3de20cf9b83b0d9e0e325b9b873f586cd170be9622ec9aeeeaf149cf5ffd77e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp313-cp313-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f876d9f96145954d78acb1e7232090eb99f2ada5527d8aa871c1e663220b965c
MD5 98b7c651dfdfdf38e9c5a2950b9f5fbb
BLAKE2b-256 34b553a97be5e79a8f017febb15a22710798ffb2fe0ca68cf7e412c06d7c4e5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp313-cp313-musllinux_1_2_aarch64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d66e1ab92a08961ff34d454d20f186deaa41534b491588038cd7aee24bbc8a8a
MD5 4b73432aa6a70cae5760d89315dfd296
BLAKE2b-256 541c1e465e532bb10e38a11ff0541013801ed8954b94f71a53ff31a173aaa65e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 772843addfdba885cf442d144b69cfe32b67aacf4891fe40c74f5d1c945cef15
MD5 fa3cd6ba600e9a9b3b464ee5272c977e
BLAKE2b-256 ddc8a97e8ed20ea9f13bb4665184aeb9415727e45ae6f85d6d102f5dde5a7854

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd214a1b0c6994e75fd9bcc9eb650e95b7c3d0b2cdcf36aa0a591d6d15025fbc
MD5 4bd953be26ee682ab38cb08a31a4512a
BLAKE2b-256 67ac09e14578ccb1ec5a6071356c7e1cebb9d9768ae325fff90fa9543d452ec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dizzle-0.8.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.8.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 305cf1d41efec037c9e6e9efcc769b8569a5a707deea5335412feb29ecaeb18e
MD5 da8e18c64cdc8fab99668898d20cd8ce
BLAKE2b-256 0bda1960024fe8d66c4f8a24c8a76d650a55dda8871e826c80d6da5e4dd7ad1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.8.0-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: release.yml on 4thel00z/dizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.8.0 This release

15 files

0.7.0

15 files

0.6.0

15 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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