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.12x (8–15x faster), putting the full 18-group suite at 0.82x:

benchmark dizzle cytoolz toolz vs cytoolz
frequencies (30k int64 buffer) 51 us 740 us 1138 us 0.07x
unique (30k int64 buffer) 45 us 373 us 421 us 0.12x
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. 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.7.0.tar.gz (104.1 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.7.0-cp314-cp314-win_amd64.whl (326.4 kB view details)

Uploaded CPython 3.14Windows x86-64

dizzle-0.7.0-cp314-cp314-musllinux_1_2_x86_64.whl (651.0 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

dizzle-0.7.0-cp314-cp314-musllinux_1_2_aarch64.whl (604.0 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

dizzle-0.7.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (437.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

dizzle-0.7.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (425.7 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

dizzle-0.7.0-cp314-cp314-macosx_11_0_arm64.whl (399.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

dizzle-0.7.0-cp314-cp314-macosx_10_12_x86_64.whl (429.7 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

dizzle-0.7.0-cp313-cp313-win_amd64.whl (327.0 kB view details)

Uploaded CPython 3.13Windows x86-64

dizzle-0.7.0-cp313-cp313-musllinux_1_2_x86_64.whl (651.3 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

dizzle-0.7.0-cp313-cp313-musllinux_1_2_aarch64.whl (603.7 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

dizzle-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (437.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

dizzle-0.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (425.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

dizzle-0.7.0-cp313-cp313-macosx_11_0_arm64.whl (400.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dizzle-0.7.0-cp313-cp313-macosx_10_12_x86_64.whl (428.9 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dizzle-0.7.0.tar.gz
Algorithm Hash digest
SHA256 8f1a6d1f65599c84a21dfc9ea34130ff5e0bfb158e93bf4548263010e03ba400
MD5 a79a0f5a27a660d6a98df43206e39cbe
BLAKE2b-256 bfcc2df64196c7f16d336949b7876b86bbab2a5638be578db59f3908658dcc28

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: dizzle-0.7.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 326.4 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.7.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 dae5a9de11d031c1b21dbac06ffa11f30d7cd21ef53953f28cb3abf6ac9b172c
MD5 ec058bb9c99c742b7f51ef6b2d5175e4
BLAKE2b-256 167cc6592346664daf56b0dc4119782c9dffee4769fb8d478dd9b1d5666a9f68

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dfa53d5376ae92727ee3c5c610ef62a3f77b6f09056079eb92ae2c0bd21acbea
MD5 1917b04c0089c2f3b3a130cfa2529385
BLAKE2b-256 cbbada1b05b4d12f82efd4eb47f538e2d39c19898f726616e0e13062da99c866

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp314-cp314-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 26a5ea8b459af780f69d2032ae2b909634b8f6257aeafcf5b652abc65e6c48f6
MD5 68a3afd08974456b4a3752429c83ac0a
BLAKE2b-256 7bc97d31378ea050d714caa32aee056f33694f1ad8c3df7517304f4ee7d1e693

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be4d8398df69ab56a8ff2b8b8acfc4e2b88dd6253ad92c68abae295170726c9a
MD5 1cf74eed5f4970ed0f71c925c4aada9b
BLAKE2b-256 e4f8948a340c19ff8cce385d21d907a6f0491b53629e74e70b838ab15f02cb88

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f6dd71b40032723945dda66646fa12835455c31476e3ddda3d97a9c9b56c35af
MD5 08e07638e1f562c0c7e0533752db7b82
BLAKE2b-256 d57afcc40a28f87350bef3f9f104a4387d547b232f7b7992a67ad6943e72a6b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d1ec8eaad3528ffca843d58ff2203213695d1e595e1ef83824f0c8aa07ef617b
MD5 f9f2bf82703deff0cbbd54033834f459
BLAKE2b-256 2fab1e949e09931bf4ecda486178bc7ab8e67a19d6933788898fd371033980b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eb174ef468b5cfe9949b129504b1aa6f3b84dc93366e8ce7590214eb98446edf
MD5 13e5e18348f81d5f1e144699264cb19b
BLAKE2b-256 378ab8878a3feb86d506da3c22b641c427cc1b488b7c57fe0b5c7557885d2f0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: dizzle-0.7.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 327.0 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.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b4eaebbe1df4b4eb40ad2280ff4592c10accb17aaa85982ebfcc18af49c9c4be
MD5 ea263e50801425eb96886827e21e7e23
BLAKE2b-256 c186141972ed42944b3eac12c83b797ed74af0b672c8cbc232ae9352a56a0486

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 16ba09c48a28c4377beb2482555254cb76b9a7198f8bec4f0254ebc7a7740f3b
MD5 7460c50f8483e142926da31a7c21c2cc
BLAKE2b-256 f7c3625878d9c09dd9b507ec03f14365d76b47e49602289b7bde8e5007bf54c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp313-cp313-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 33d3d755301aa4e715a79e12e2b483fa1cc9b6ff433d8536ce331bd41610f418
MD5 e4ebfe60c7fec1d3cfe30218e837b23d
BLAKE2b-256 87120b04dcf57b053379fd77c76146484143a2de98bd3d6c750763b6ec9690b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4b5bd4cc61de04db4e93a064416a01e74335dd8f3332d825784dfdc97d7e93e8
MD5 3087d4ba31dfd1917f5221e56f48240c
BLAKE2b-256 e2a8e14df7d9568d49ee4693319c64d1a4ab33bf83e1e70c829c64159cbc6333

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ca2cf29bcdfc9eb111292cd5172ab3be274fa5f6d9a23c1fffd45c942b50a0c2
MD5 9a8531fa3b8ef62549075cd1c6e36880
BLAKE2b-256 25b87a9ae13410fbf8947aab102445f819c44c302726e20dc4bbe57788454f0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3c15f933fcd292d09019644e31f7dc8c402600a4529a6709caa05dbeab6026a
MD5 e9a8f45eaedafd517234f560bb4bcb66
BLAKE2b-256 7a156e0ba60d009f9feec0bdc23d5fcdab9a8b8e045ce68c863b05af401af043

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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.7.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dizzle-0.7.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 851c375bb70c0322e1905607cabc0b472315d6c7adc303f728e4e8ffadec951d
MD5 e7528729bea882e2bd4f0b2cbd98f144
BLAKE2b-256 afe75b191495159a3b110e9dff0f60b6251b338080ee1be16359aa4e1cbd62f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dizzle-0.7.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

0.8.0

15 files

This release

0.7.0 This release

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