{"name":"CyToolz: High-Performance Functional Utilities for Python","description":"CyToolz is a high-performance Cython implementation of the popular Toolz library, offering functional utilities for iterables, functions, and dictionaries. It provides significant speed improvements, typically 2-5x faster than its pure Python counterpart, while maintaining the same API. This makes CyToolz an excellent choice for data processing tasks requiring efficiency and low memory usage.","github":"https://github.com/pytoolz/cytoolz","url":"https://osrepos.com/repo/pytoolz-cytoolz","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/pytoolz-cytoolz","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/pytoolz-cytoolz.md","json":"https://osrepos.com/repo/pytoolz-cytoolz.json","topics":["Python","functional programming","performance","utilities","Cython","data processing","iterators"],"keywords":["Python","functional programming","performance","utilities","Cython","data processing","iterators"],"stars":null,"summary":"CyToolz is a high-performance Cython implementation of the popular Toolz library, offering functional utilities for iterables, functions, and dictionaries. It provides significant speed improvements, typically 2-5x faster than its pure Python counterpart, while maintaining the same API. This makes CyToolz an excellent choice for data processing tasks requiring efficiency and low memory usage.","content":"## Introduction\n\nCyToolz is a powerful library that provides high-performance functional utilities for Python. It is a Cython implementation of the well-known `toolz` package, designed to offer significant speed enhancements for common data manipulation tasks involving iterables, functions, and dictionaries. By leveraging Cython, CyToolz delivers a faster alternative, often 2-5 times quicker than the pure Python `toolz` library, making it ideal for performance-critical applications and large datasets. It seamlessly integrates with other Python libraries like `itertools` and `functools`, promoting a functional programming style.\n\n## Installation\n\nGetting started with CyToolz is straightforward. You can install it directly from the Python Package Index (PyPI) using pip:\n\nbash\npip install cytoolz\n\n\nCyToolz supports Python 3.9+ and requires only CPython and a C compiler, making it a lightweight dependency for your projects.\n\n## Examples\n\nCyToolz implements the exact same API as the `toolz` library, meaning any examples or documentation for `toolz` apply directly to CyToolz. For comprehensive examples and API details, please refer to the official `toolz` documentation: [Toolz API Documentation](https://toolz.readthedocs.io/en/latest/api.html){:target=\"_blank\"}.\n\nHere's a simple example demonstrating a common functional utility, `compose`, which combines multiple functions:\n\npython\nfrom cytoolz import compose, partial\n\ndef increment(x):\n    return x + 1\n\ndef double(x):\n    return x * 2\n\n# Compose functions: double then increment\ncomposed_function = compose(increment, double)\nresult = composed_function(5) # (5 * 2) + 1 = 11\nprint(f\"Composed result: {result}\")\n\n# Using partial application\nadd_five = partial(lambda x, y: x + y, 5)\nprint(f\"Partial application: {add_five(10)}\") # 5 + 10 = 15\n\n\n## Why Use CyToolz?\n\nThe primary advantage of CyToolz is its **superior performance**. By reimplementing core `toolz` functionalities in Cython, it achieves substantial speedups, typically 2-5 times faster, with some operations showing even more dramatic improvements. This performance boost is crucial when dealing with very large or potentially infinite data streams, where every millisecond counts.\n\nBeyond speed, CyToolz also offers:\n*   **C API**: Provides a C API accessible to other Cython projects, enabling deeper integration and further performance optimizations.\n*   **Low Memory Usage**: Like `toolz`, it leverages the iterator protocol, returning iterators whenever possible to ensure efficient memory usage, especially for large datasets.\n*   **Lightweight**: Despite its performance benefits, CyToolz remains a minimal dependency, requiring only CPython and a C compiler.\n*   **Free-threading Support**: It includes experimental support and wheels for Python free-threading (introduced in Python 3.13), though users should exercise caution regarding thread-safety.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/pytoolz/cytoolz](https://github.com/pytoolz/cytoolz){:target=\"_blank\"}\n*   **Official Documentation**: [https://toolz.readthedocs.io](https://toolz.readthedocs.io){:target=\"_blank\"}\n*   **API Documentation**: [https://toolz.readthedocs.io/en/latest/api.html](https://toolz.readthedocs.io/en/latest/api.html){:target=\"_blank\"}\n*   **Mailing List**: [https://groups.google.com/forum/#!forum/pytoolz](https://groups.google.com/forum/#!forum/pytoolz){:target=\"_blank\"}","metrics":{"detailViews":3,"githubClicks":14},"dates":{"published":null,"modified":"2026-01-02T20:00:57.000Z"}}