Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

More tools

Project description

A set of utility functions for iterators, functions, and dictionaries.

[![Build Status](](


New BSD. See [License File](LICENSE.TXT).


toolz is on the Python Package Index (PyPi):

pip install toolz


easy_install toolz

Structure and Heritage

toolz is implemented in three parts:

[itertoolz](, for opertions on iterables. Examples: groupby, unique, interpose,

[functoolz](, for higher-order functions. Examples: memoize, curry, comp

[dicttoolz](, for operations on dictionaries. Examples: assoc, update-in, merge.

These functions come from the legacy of functional languages for list processing. They interoperate well to accomplish common complex tasks.


This builds a standard wordcount function from pieces within toolz:

>>> def stem(word):
...     """ Stem word to primitive form """
...     return word.lower().rstrip(",.!:;'-\"").lstrip("'\"")
>>> from toolz import comp, frequencies
>>> from functools import partial
>>> wordcount = comp(frequencies, partial(map, stem), str.split)
>>> sentence = "This cat jumped over this other cat!"
>>> wordcount(sentence)
{'this': 2, 'cat': 2, 'jumped': 1, 'over': 1, 'other': 1}


toolz supports Python 2.6+ and Python 3.2+ with a common codebase. It is pure Python and requires no dependencies beyond the standard library.

See Also

Contributions Welcome

toolz aims to be a repository for utility functions, particularly those that come from the functional programming and list processing traditions. We welcome contributions that fall within this scope and encourage users to scrape their files for functions that are broadly useful.

Please take a look at our [issue page]( for contribution ideas.

Project details

Download files

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

Files for toolz, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size toolz-0.2.1.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page