Library / SDK
pytoolz/toolz avatar
pytoolz/toolz

toolz: a functional standard library for Python, and what its maintenance status means for you

A functional standard library for Python.

5,156 stars287 forksPythonNOASSERTION

At a glance

What is it?
toolz packages iterator, function and dictionary utilities into one dependency-free library. It installs with pip install toolz and works on Python 3.9 and later, but the README states the project is alive yet inactive.
Who is it for?
Adopt toolz if you want small, composable helpers for iterables, dictionaries and higher-order functions without adding a dependency tree, and if you are comfortable with the maintenance posture the README describes: critical fixes, Python version bumps and security issues only. Do not adopt it expecting new features or quick review of contributions, and do not treat it as a data-parallel or lazy-evaluation engine.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 15 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 3, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What toolz is for, and who reaches for it

Python's standard library already ships itertools and functools, so the question is what a separate package adds. toolz answers with three modules that share a common style: itertoolz for operations on iterables (the README lists groupby, unique and interpose), functoolz for higher-order functions (memoize, curry, compose), and dicttoolz for dictionaries (assoc, update-in, merge). The README describes these as coming "from the legacy of functional languages for list processing" and notes that they interoperate to accomplish common complex tasks.

The audience is narrower than "everyone writing Python". You get value from toolz if you write pipelines of small transformations, if you find yourself reaching for a helper to group or deduplicate a stream, or if you want currying and composition without adopting a larger framework. It is pure Python and requires nothing beyond the standard library, which matters when the alternative is pulling a dependency tree into a service that only needs two functions. The README calls it "a lightweight dependency", and that framing is the honest pitch.

The three modules and how composition actually works

The mechanism is plain function composition over ordinary Python objects. There is no runtime, no scheduler and no lazy graph. itertoolz functions consume and produce iterables, dicttoolz functions take and return dicts, and functoolz functions wrap other callables. Because everything is a normal Python value, you can nest calls by hand or build the pipeline with compose.

The README's wordcount example shows the intended data flow in one line: a stem function strips punctuation and lowercases, str.split breaks the sentence, the curried map applies stem to each word, and frequencies counts the results. Reading right to left, the sentence becomes a list of words, the words become stems, and the stems become a dictionary of counts. That is the whole architecture. Nothing is deferred and nothing is cached unless you ask for it.

The curried namespace is the part worth understanding before you adopt. Importing map from toolz.curried gives you a version that accepts its arguments in stages, which is what makes compose work cleanly with functions that normally take several arguments. If you import from plain toolz instead, you get the uncurried form. Mixing the two namespaces in one file is a common source of confusion, and the documentation splits them for that reason.

Installing toolz and building the wordcount example

The README gives a single install line. toolz is on the Python Package Index, so a normal pip install is all that is required, and the package supports Python 3.9 and later from a common codebase.

bash
pip install toolz

After installation, the quickest way to confirm the package is importable is to reproduce the README example. The stem function below is copied from the README, including the rstrip and lstrip calls that remove punctuation and stray quotes.

python
def stem(word):
    """ Stem word to primitive form """
    return word.lower().rstrip(",.!:;'-\"").lstrip("'\"")

from toolz import compose, frequencies
from toolz.curried import map
wordcount = compose(frequencies, map(stem), str.split)

Calling wordcount on the README's sample sentence should produce a dictionary mapping each stemmed word to its count, with "this" and "cat" appearing twice. If you see the counts, the install and the curried import both work.

A second example in the repository, examples/wordcount.py, follows the same pattern, and examples/fib.py and examples/graph.py cover other uses. Those files are the fastest way to see idiomatic toolz code without reading the API page end to end.

Where toolz stops being the right tool

The library is deliberately small, and that is also its boundary. It is not a dataframe engine, not a parallel execution layer, and not a streaming framework. If your iterables are large enough that memory matters, toolz will not save you on its own; the functions are ordinary Python and the README makes no performance claims. cytoolz, the Cython reimplementation described in the README as a drop-in replacement, is where the project points for that concern.

The maintenance posture is the second limitation, and it is stated plainly rather than implied. The README says the project "is alive but inactive", that the original maintainers have mostly moved on, and that they will commit to critical bug fixes, Python version bumps and security issues. Contributions beyond that are not planned for review. That is an unusually candid paragraph, and it should shape how you depend on toolz: fine as a stable utility layer, poor as a place to send a pull request for a feature you need next quarter.

There is also a licensing detail worth noticing. The README says "New BSD" and links to the license file, while pyproject.toml declares license = "BSD-3-Clause". The repository metadata shown here reports the license as NOASSERTION, which means automated tooling did not match it to a known identifier. If your organization scans licenses automatically, expect a manual review step.

toolz versus cytoolz and the standard library

The closest alternative is cytoolz, and the difference is implementation rather than API. The README states that cytoolz is a reimplementation of toolz in Cython and a drop-in replacement for the pure Python version. In practice that means the same function names and the same call patterns, with the work done in compiled code instead of interpreted Python. Choosing between them is a build and deployment decision: cytoolz needs a compilation step, while toolz installs as pure Python anywhere a wheel or source install works.

The other comparison is the standard library itself. itertools and functools overlap with parts of toolz, and the README lists both under See Also alongside Underscore.js, Ruby's Enumerable and Clojure. The honest distinction is coverage and naming. toolz collects dictionary helpers such as assoc and update-in that have no functools equivalent, and it groups iterator helpers under names that read better in a pipeline. If your needs are covered by itertools, adding toolz buys convenience, not capability.

Maintenance, releases and upgrade cost

The last push to the repository was on 2026-09-18, and the most recent release listed is 1.1.0 from 2025-10-17, following 1.0.0 in 2024. The release cadence is slow by design. The README's project status paragraph explains why: the maintainers view toolz as mostly complete and intend to keep it alive for critical fixes, Python version bumps and security issues.

For an adopter, that translates into low upgrade cost and low upgrade frequency. The package is pure Python with no dependencies beyond the standard library, so a version bump rarely forces changes elsewhere in your tree. The pyproject.toml requires Python 3.9 or newer and lists classifiers through Python 3.15, which tells you the maintainers track new interpreter releases even if they do not add features.

Build tooling is worth a glance if you install from source. The build backend is setuptools with setuptools-git-versioning, and the version is dynamic rather than written in the file. A source install outside a git checkout can therefore behave differently from a wheel install from PyPI. Installing from PyPI avoids that entirely.

On licensing, the README says New BSD and pyproject.toml declares BSD-3-Clause. Both point at the same permissive family, but the NOASSERTION label in the repository metadata means you should read LICENSE.txt yourself rather than rely on a scanner's summary. This is a description of what the files say, not legal advice.

Editorial conclusion

Adopt toolz if you want small, composable helpers for iterables, dictionaries and higher-order functions without adding a dependency tree, and if you are comfortable with the maintenance posture the README describes: critical fixes, Python version bumps and security issues only. Do not adopt it expecting new features or quick review of contributions, and do not treat it as a data-parallel or lazy-evaluation engine. Before committing, verify that the functions you plan to use exist in the version you install, and check the release notes for 1.1.0 against your Python version.

Frequently asked questions

How do I install toolz?

The README gives one command: pip install toolz. The package is on the Python Package Index and supports Python 3.9 and later from a common codebase.

What is the difference between toolz and cytoolz?

The README states that cytoolz is a reimplementation of toolz in Cython and a drop-in replacement for the pure Python implementation. The API is the same; the difference is that cytoolz requires compilation while toolz is pure Python.

Is toolz still maintained?

The README says the project is alive but inactive, with the original maintainers mostly moved on. They commit to critical bug fixes, Python version bumps and security issues, and do not plan to spend much time reviewing other contributions.

Which Python versions does toolz support?

The README says toolz supports Python 3.9+ with a common codebase. The pyproject.toml sets requires-python to >=3.9 and lists classifiers through Python 3.15.

What is toolz licensed under?

The README says New BSD and links to the license file, while pyproject.toml declares license = "BSD-3-Clause". The repository metadata reports the license as NOASSERTION, so read LICENSE.txt directly.

Official sources

  1. Issues
  2. Project website
  3. pytoolz/toolz on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/pytoolz-toolz.svg)](https://hysenlabs.com/projects/pytoolz-toolz)