List processing tools and functional utilities
Project description
A set of utility functions for iterators, functions, and dictionaries.
See the PyToolz documentation at https://toolz.readthedocs.io
LICENSE
New BSD. See License File.
Install
toolz is on the Python Package Index (PyPI):
pip install toolz
Structure and Heritage
toolz is implemented in three parts:
itertoolz, for operations on iterables. Examples: groupby, unique, interpose,
functoolz, for higher-order functions. Examples: memoize, curry, compose,
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.
Read our API Documentation for more details.
Example
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 compose, frequencies
>>> from toolz.curried import map
>>> wordcount = compose(frequencies, map(stem), str.split)
>>> sentence = "This cat jumped over this other cat!"
>>> wordcount(sentence)
{'this': 2, 'cat': 2, 'jumped': 1, 'over': 1, 'other': 1}
Dependencies
toolz supports Python 3.9+ with a common codebase. It is pure Python and requires no dependencies beyond the standard library.
It is, in short, a lightweight dependency.
CyToolz
The toolz project has been reimplemented in Cython. The cytoolz project is a drop-in replacement for the Pure Python implementation. See CyToolz GitHub Page for more details.
See Also
Underscore.js: A similar library for JavaScript
Enumerable: A similar library for Ruby
Clojure: A functional language whose standard library has several counterparts in toolz
itertools: The Python standard library for iterator tools
functools: The Python standard library for function tools
Project Status
This project is alive but inactive.
The original maintainers have mostly moved on to other endeavors. We’re still around for critical bug fixes, Python version bumps, and security issues and will commit to keeping the project alive (it’s highly depended upon). However, beyond that we don’t plan to spend much time reviewing contributions. We view Toolz as mostly complete.
We encourage enthusiasts to innovate in new and wonderful places 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toolz-1.1.0.tar.gz.
File metadata
- Download URL: toolz-1.1.0.tar.gz
- Upload date:
- Size: 52.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27a5c770d068c110d9ed9323f24f1543e83b2f300a687b7891c1a6d56b697b5b
|
|
| MD5 |
c6ba0b5adf0a988db621136eb7119c61
|
|
| BLAKE2b-256 |
11d6114b492226588d6ff54579d95847662fc69196bdeec318eb45393b24c192
|
Provenance
The following attestation bundles were made for toolz-1.1.0.tar.gz:
Publisher:
publish_pypi.yml on pytoolz/toolz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolz-1.1.0.tar.gz -
Subject digest:
27a5c770d068c110d9ed9323f24f1543e83b2f300a687b7891c1a6d56b697b5b - Sigstore transparency entry: 618329431
- Sigstore integration time:
-
Permalink:
pytoolz/toolz@568c2b8393973cd172a466546c9d95779c452438 -
Branch / Tag:
refs/tags/1.1.0 - Owner: https://github.com/pytoolz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@568c2b8393973cd172a466546c9d95779c452438 -
Trigger Event:
push
-
Statement type:
File details
Details for the file toolz-1.1.0-py3-none-any.whl.
File metadata
- Download URL: toolz-1.1.0-py3-none-any.whl
- Upload date:
- Size: 58.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15ccc861ac51c53696de0a5d6d4607f99c210739caf987b5d2054f3efed429d8
|
|
| MD5 |
1ce76b95c6c795a40f0114a10282eccb
|
|
| BLAKE2b-256 |
fb125911ae3eeec47800503a238d971e51722ccea5feb8569b735184d5fcdbc0
|
Provenance
The following attestation bundles were made for toolz-1.1.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on pytoolz/toolz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolz-1.1.0-py3-none-any.whl -
Subject digest:
15ccc861ac51c53696de0a5d6d4607f99c210739caf987b5d2054f3efed429d8 - Sigstore transparency entry: 618329437
- Sigstore integration time:
-
Permalink:
pytoolz/toolz@568c2b8393973cd172a466546c9d95779c452438 -
Branch / Tag:
refs/tags/1.1.0 - Owner: https://github.com/pytoolz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@568c2b8393973cd172a466546c9d95779c452438 -
Trigger Event:
push
-
Statement type: