Metadata-Version: 2.4
Name: sloths
Version: 0.0.3
Summary: Lazy generator pipelines
Project-URL: Homepage, https://github.com/lirsacc/sloths-py
Project-URL: Repository, https://github.com/lirsacc/sloths-py.git
Author-email: Charles Lirsac <code@lirsac.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

sloths
======

Lazy iterator pipelines for Python.

`sloths` is a library providing a chainable interface to easily compose lazy iterator pipelines in Python. The interface is largely inspired by Rust's Iterator trait (although it's not a carbon copy).

The 2 primary goals of the library are:

- Provide an easy to use, chainable and typed API for composing generator pipelines.
- Make it easy to control peak memory usage and throuhgput on large source datasets or long running input streams.

```python
>>> from sloths import Stream
>>> Stream(range(100_000)).enumerate().filter(lambda x: x[1] % 3 == 0).skip(3).take(5).collect()
[(9, 9), (12, 12), (15, 15), (18, 18), (21, 21)]

```

For more examples see doctests within the code or [`usage.md`](./docs/usage.md).

Installation
------------

The project is released [on PyPI](https://pypi.org/project/sloths/).

```shell
pip install sloths
```
