https://github.com/neverendingqs/pyiterable
Python comes with some nice built-in methods for operating on iterables, but it can get messy really quickly if you want to transform an iterable multiple times. Write more expressive code by chaining built-in transformations with this module.
https://github.com/neverendingqs/pyiterable
functional-programming python
Last synced: 7 months ago
JSON representation
Python comes with some nice built-in methods for operating on iterables, but it can get messy really quickly if you want to transform an iterable multiple times. Write more expressive code by chaining built-in transformations with this module.
- Host: GitHub
- URL: https://github.com/neverendingqs/pyiterable
- Owner: neverendingqs
- License: mit
- Created: 2015-09-05T21:47:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-18T20:32:08.000Z (over 9 years ago)
- Last Synced: 2025-04-17T18:25:32.180Z (7 months ago)
- Topics: functional-programming, python
- Language: Python
- Size: 85 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://travis-ci.org/neverendingqs/pyiterable)
[](https://coveralls.io/github/neverendingqs/pyiterable?branch=master)
# Pyiterable
Python comes with some nice built-in methods for operating on iterables, but it can get messy really quickly if you want to transform an iterable multiple times. Write more expressive code by chaining built-in transformations with this module.
Get it via `pip install pyiterable`!
## Example
from pyiterable import Iterable
...
values = Iterable(["1", "2", "5", "9"])
sum = (values
.map(lambda x: int(x))
.filter(lambda x: x > 4)
.reduce(lambda a, b: a + b)
)
## Inspiration
* [C#'s Enumerable class](https://msdn.microsoft.com/en-us/library/system.linq.enumerable.aspx)
* [Apache Spark RDD Operations](http://spark.apache.org/docs/latest/programming-guide.html#rdd-operations)
* [Java stream package](https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html)
## Links
* API docs: [http://pyiterable.readthedocs.io/en/stable/](http://pyiterable.readthedocs.io/en/stable/)
* Travis CI: [https://travis-ci.org/neverendingqs/pyiterable](https://travis-ci.org/neverendingqs/pyiterable)
* Coveralls: [https://coveralls.io/github/neverendingqs/pyiterable](https://coveralls.io/github/neverendingqs/pyiterable)
* Source: [https://github.com/neverendingqs/pyiterable](https://github.com/neverendingqs/pyiterable)
* Package: [https://pypi.python.org/pypi/pyiterable/](https://pypi.python.org/pypi/pyiterable/)