You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This builds a standard wordcount function from pieces within toolz:
>>>defstem(word):
... """ Stem word to primitive form """
... returnword.lower().rstrip(",.!:;'-\"").lstrip("'\"")
>>>fromtoolzimportcompose, frequencies>>>fromtoolz.curriedimportmap>>>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.8+ 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.
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 🚀