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 int64 buffer (numpy int64, array.array('q')) 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. 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.6.0.tar.gz (100.0 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.6.0-cp314-cp314-win_amd64.whl (292.8 kB view details)

Uploaded CPython 3.14Windows x86-64

dizzle-0.6.0-cp314-cp314-musllinux_1_2_x86_64.whl (616.0 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

dizzle-0.6.0-cp314-cp314-musllinux_1_2_aarch64.whl (578.8 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

dizzle-0.6.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (402.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

dizzle-0.6.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (400.6 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

dizzle-0.6.0-cp314-cp314-macosx_11_0_arm64.whl (373.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

dizzle-0.6.0-cp314-cp314-macosx_10_12_x86_64.whl (397.9 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

dizzle-0.6.0-cp313-cp313-win_amd64.whl (293.0 kB view details)

Uploaded CPython 3.13Windows x86-64

dizzle-0.6.0-cp313-cp313-musllinux_1_2_x86_64.whl (616.1 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

dizzle-0.6.0-cp313-cp313-musllinux_1_2_aarch64.whl (578.5 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

dizzle-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (402.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

dizzle-0.6.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (400.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

dizzle-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (372.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dizzle-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl (396.9 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dizzle-0.6.0.tar.gz
Algorithm Hash digest
SHA256 081a4831db5b79692ab4e4ebd3634bd2ffa088f78200fd7f121a0e3595bf0543
MD5 4007a06c61c6197ed2c6392238ec4f3d
BLAKE2b-256 440d5da44282dc3331f420de2a7f49d7d057aab3935b0ddc4cfc801ef125466c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dizzle-0.6.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 292.8 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.6.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7bc156223e52145d0dbbc026f805229fba65a7151796acfb3e4541fcaa829c2b
MD5 43a2a471292b65d9f6b5a9a61c43d7b3
BLAKE2b-256 b0cadc0ed7f73e18d80ea6fb36b767942a77f7b1e6e797e005e5c1cab7198fb2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 42a6ea3e64476b0ee5384bd1bb65beeeeba022dae26cdc3eb2c126f5e8541bb2
MD5 7189bfab788611d8cb332ed9da8b54ca
BLAKE2b-256 aefaffd200eb1c6f28df7e1d3f684e601faf6cf8745d633f6b4955bbf7db4aec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6f68fbd02bd6d368dde6efbc0f6f92f650dead39481c0a82c8db49604e054d27
MD5 9933af4de8cd16b9e1f5baaecc615dac
BLAKE2b-256 849a885cf1704f8be238339ba81c4248a3f65fc27a3bac21876a240c5725a81b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5da3175f0103794e3b7091a89e23b1a192e1f26409233499d5b28178b7cf355f
MD5 1e2c5a800df2f50d3db64d2e85749c0c
BLAKE2b-256 e7051d9579daad45b6ed31915bad54c17395c10670fb9ce219f2df815be0aea6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9aed8cd9b8a7d9686fac528d32ece68982333130636ab35b7b5bef45fd3b5146
MD5 84892194897784128e793c165059b72a
BLAKE2b-256 2c022c8de3c9f991179005fb5d2ace32209f52c16e7caa9c0444c634fd6964fe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fe6ff9556de0c73e07981558bbcaf7ce8c4614ddbc3cb8da6228847365d30110
MD5 cb1b64d079b87cd939803c76a3f2c8d8
BLAKE2b-256 310bee30aba8d96f1d370680e47f21d036162bded9450f5f740969ae37e4144d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ba2ccc2c08de887758b50de4c215610370d72a53968139232cc4d6257285d6f2
MD5 40dd36ee1b96c1e3db2005b57e5ad368
BLAKE2b-256 d47f49283ed498e46f89cb10aa417ed40677a22557fbc7ffa258e7060a886c92

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dizzle-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 293.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.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1569add56c609d72c7f4153619d8495bcaab9d0325e6c6e1c89a1eb577e1e018
MD5 3dd7fe5d73f8a35ec0314f1fceea8d8e
BLAKE2b-256 83d33fc2b59f6a1089609075e77626f928bc8cd40b4b29639eec4684cfd1d634

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dce3b780a5f3cc16b7f0b7a20c22f2d5c2f73163d0c680cc1e2742c7775bffc0
MD5 c1b082d00bed9f59fc5528edbf4caf3b
BLAKE2b-256 7d07156f1e3b45d52c69cacb7781b667047bd7f8f998fc3ed692deb98431e8c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c686137ab7ac5cac7757b488069f2ea9ccb597254758da2d805228c97df305c5
MD5 8176a34cb0c7806981e648fc2ce996fb
BLAKE2b-256 abd81779a2c1977605bebde7237fe82e6820bd6030d6bbdf67ff068eb637bc75

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d8b5480748fb95c255b315ec12445f425273f1054d77ad0ece0dd57b3563dba5
MD5 0115913cb0bbeaf1b823a8f64e1bb1bf
BLAKE2b-256 b650193c77986ba793322d8bb99b242d18aa8a4d3be44a792fd7f58c58004765

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2e4d20dde29ab81e97959198146f589c9d597b1066657d70a47f8f7f37621971
MD5 7f9f05905c902886718408c4d7bb5dc9
BLAKE2b-256 95746a6267be2ad354534a4d2a8af4934ba45e39ffd19ec02e988d2591a60ad8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7b197a53283c536eef1a3797ad4c8b0d62e6bfb2386316470519444ab48a96b
MD5 f67a8232795d3b27d31f44e1501e9851
BLAKE2b-256 3295358b0d11baf8ba2d26fb6342d68c9addd09bcfc7ecb1b4936f1eea669d6e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dizzle-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2de426841a9b73c6aea093b9ae71d67b03d894020ecc3117cfcf3c05b420cf65
MD5 3ec10ef3d3bfbba62dccd973ec364bee
BLAKE2b-256 b3817ade5b73f427c1ba3085101589ffcfdafa58ac65abd4555310438c010c23

See more details on using hashes here.

Provenance

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

0.7.0

15 files

This release

0.6.0 This release

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