Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

toolz parity

Every public name in toolz, and where it stands in pipekit-ops.

Read: pytoolz/toolz commit 451af60dec590a6010e2babdbf391ea8f815122f, committed 2026-09-18 (“Add pysentry-pre-commit (#637)”), tag 1.2.0, read on 2026-11-06. The lists come from __all__ in toolz/itertoolz.py, toolz/functoolz.py, toolz/dicttoolz.py and toolz/recipes.py, from the aliases in toolz/__init__.py and toolz/curried/__init__.py, and from toolz/sandbox/. cytoolz is a drop-in with the same names, so the table covers it.

How to read the status column

Deliberate divergences from toolz

  1. Operators, not functions. A pipekit op is configured at construction and called on one carrier: Filter(pred)(items), not filter(pred, items). The constructor plays the role of toolz.curry.

  2. Configs, not closures. Arguments are JSON values or operators, so the pipeline round-trips through dumps / loads and has a pipeline_hash. toolz accepts any callable; pipekit accepts a callable only through Lambda, which is flagged.

  3. Lists, not lazy iterators. toolz is lazy by default (take, partition_all, concat return iterators). A pipekit op returns a list, so its output can be inspected, cached, hashed and passed to a Graph node twice. Map.iter and Prefetch are the lazy exceptions, for streams.

  4. Carriers are opaque. An op indexes containers and calls operators; it never reads inside an item.

  5. One input per call. A toolz function that takes two values (binop(acc, item), merge_with(func, *dicts)) takes one tuple in pipekit, because Sequential passes one carrier.

  6. Strict by default. Zip raises on unequal lengths; toolz and the builtin zip truncate.

functoolz

toolzpipekit-ops statusNote
identityexists as Identity
applyout of scopeapply(f, *args) is f(*args)
thread_first, thread_lastout of scopeClojure threading macros; pipe and | cover them
memoizeexists as Cache, alias Memoize; key= added (P4)toolz’s key argument is a function of the call’s arguments; pipekit’s is an operator on the input
composeexists as compose
compose_leftexists as compose_left
compout of scopean alias of compose in toolz
pipeexists as pipe
complementexists as complement (a function) and as Not(pred) (P1)the existing function returns a closure; Not is the operator form, for use inside Filter and AssertThat
juxtexists as juxt (a function returning a closure) and Fanout (an operator, dict output)juxt is not an Operator, so it cannot sit in a Sequential; see decision O13
doexists as Tap, Sink, and Log (P5)
curryout of scopethe constructor is the partial application
flipout of scopepure helper
exceptsexists as Try, Coalesce

itertoolz

toolzpipekit-ops statusNote
map (builtin)exists as Map (P2)the execution engine
filter (builtin)exists as Filter (P1)
removeexists as Remove (P1)
reduce (functools)exists as Reduce (P1)op takes one (acc, item) tuple
sorted (builtin)exists as SortBy (P1)named for its key, as GroupBy and CountBy are
accumulateout of scoperunning totals over a list are rare in pipelines; write an operator
groupbyexists as GroupBy (P1)
reducebyout of scopeGroupBy(key) | ValMap(Reduce(op))
countby (recipes)exists as CountBy (P1)
frequenciesout of scopeCountBy(Identity())
partitionby (recipes)out of scoperuns of equal keys; rare; write an operator
merge_sortedout of scopepure helper
interleaveout of scopepure helper
uniqueexists as Unique (P1)
isiterable, isdistinctout of scopepredicates on values; pure helpers
takeexists as Take (P1)for dry runs over a large search
drop, take_nth, tailout of scopepure helpers
first, second, last, nthexists as Get(0), Get(1), Get(-1), Get(n) (P1)on lists; first on a lazy iterator is out of scope
getexists as Get (P1)same split as toolz: a tuple of keys returns a tuple
pluckout of scopeMap(Get(key))
concatexists as Concat (P1)replaces the planned Flatten
concatvout of scopeConcat() on a tuple
mapcatout of scopeMap(op) | Concat()
cons, interposeout of scopepure helpers
iterateexists as Until (P3)bounded: max_iter is required
sliding_windowout of scopetime windows over carriers belong to pipekit-cycle (WindowedCycle) and pipekit-array
partitionout of scopePartitionAll with a length check
partition_allexists as PartitionAll (P1)replaces the planned Chunk
countexists as Count (P1)
joinout of scopea relational join; use a table library
diffout of scopepure helper
topkout of scopeSortBy(key, reverse=True) | Take(k)
peek, peeknout of scopeiterator plumbing; ops return lists
random_sampleout of scopea seeded sampler needs an RNG in the config; belongs with the data loaders in pipekit-train
zip (builtin, not in toolz)exists as Zip (P1)strict by default

dicttoolz

toolzpipekit-ops statusNote
mergeexists as Merge (P1)later inputs win
merge_without of scopeGroupBy-style merges with a reducer are rare; write an operator
valmapexists as ValMap (P1)
keymapout of scopeRename covers the fixed case; computed keys are rare
itemmapout of scopepure helper
valfilter, keyfilter, itemfilterout of scopePick and Dissoc cover the fixed-key case
assocexists as Assoc (P1)the value is op(x), computed from the dict
dissocexists as Dissoc (P1)
assoc_inout of scopeUpdateIn(keys, Const(value), default=None)
update_inexists as UpdateIn (P1)replaces the planned OnKey
get_inexists as GetIn (P1)

curried and sandbox

toolzpipekit-ops statusNote
toolz.curried.*out of scopecurried copies of the names above
toolz.curried.operatorout of scopecurried operator module
partial (functools)out of scopethe constructor is the partial application
sandbox.foldexists as Fold (P2)toolz takes map= to parallelise; pipekit takes executor= and runs Map
sandbox.unzipout of scopepure helper; Zip on a transposed list
sandbox.EqualityHashKeyout of scopehashing helper; Unique(key=…) covers the use

Where toolz changed the plan

PlannedAfter reading toolzWhy
Chunk(n)PartitionAll(n)toolz partition_all has the exact semantics (last group may be short), and partition names the strict version; a new name would hide the lineage
FlattenConcattoolz concat flattens one level; “flatten” suggests full recursion, which is not what is wanted
OnKey(key, op)UpdateIn(keys, op) plus Assoc(key, op)update_in already handles nested paths and missing keys; assoc covers new keys
GetItemGet and GetIntoolz’s get / get_in split, single key vs path, avoids one class with two meanings
Renamekepttoolz has only keymap(func); a fixed mapping is what pipelines need and is JSON
Pickkept, with Dissoc beside ittoolz uses keyfilter(lambda k: k in keys); a named op is clearer and serialisable
observer Countiterable Counttoolz count counts the items of an iterable; an observer that counts calls would reuse the name with another meaning, so call counts go to Log
Foldkept, after sandbox.foldtoolz separates the fold from the map that distributes it, which is exactly the Map + executor split here
Until(op, pred, max_iter)kepttoolz iterate is infinite and lazy; a pipeline needs a bound
Progressdroppedtoolz has none; progress is a property of Map, see decision O11