I would like to mention the [`streamable`](https://github.com/ebonnal/streamable) module I wrote (would love to get feedback!):
Your example would look like:
```python
from streamable import Stream
path: str = ...
class Angle:
def __init__(self, line: str): ...
def foo(angle: Angle) -> bool: ...
def cosine(angle: Angle) -> float: ...
key, value = max(
Stream(lambda: open(path, "r"))
.map(Angle)
.filter(foo)
.map(lambda angle: (angle, cosine(angle))),
key=lambda pair: pair[1]
)
```
- this is a ***typed*** module with 100% code coverage and no dependency
- the `Stream[T]` class extends `Iterable[T]`
- a stream is ***immutable***
- operations are ***lazily evaluated*** and cover concurrency, grouping/flattening, exceptions catching, rate limiting, iteration progress logging, ...
I would like to mention the [`streamable`](https://github.com/ebonnal/streamable) module I wrote (would love to get feedback!):
Your example would look like:
```python
from streamable import Stream
Stream(lambda: ["foo", "bar"]).foreach(print).exhaust()
```
```none
foo
bar
```
- this is a ***typed*** module with 100% code coverage and no dependency
- the `Stream[T]` class extends `Iterable[T]`
- a stream is ***immutable***
- operations are ***lazily evaluated*** and cover concurrency, grouping/flattening, exceptions catching, rate limiting, iteration progress logging, ...