streamable 2.1.0b0__tar.gz → 2.1.0b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {streamable-2.1.0b0 → streamable-2.1.0b1}/PKG-INFO +6 -5
- {streamable-2.1.0b0 → streamable-2.1.0b1}/README.md +4 -4
- {streamable-2.1.0b0 → streamable-2.1.0b1}/pyproject.toml +1 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/__init__.py +3 -3
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_afunctions.py +5 -8
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_aiterators.py +373 -251
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_functions.py +8 -9
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_iterators.py +137 -127
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_stream.py +67 -32
- streamable-2.1.0b1/streamable/_tools/_afuture.py +100 -0
- streamable-2.1.0b1/streamable/_tools/_async.py +14 -0
- streamable-2.1.0b1/streamable/_tools/_context.py +69 -0
- streamable-2.1.0b1/streamable/_tools/_error.py +26 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_func.py +4 -4
- streamable-2.1.0b1/streamable/_tools/_future.py +100 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_iter.py +40 -17
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_observation.py +1 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_sentinel.py +0 -1
- streamable-2.1.0b1/streamable/_tools/_star.py +65 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_aiter.py +10 -8
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_eq.py +25 -39
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_iter.py +2 -3
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/PKG-INFO +6 -5
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/SOURCES.txt +1 -1
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/requires.txt +1 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_buffer.py +10 -4
- streamable-2.1.0b1/tests/test_closing.py +829 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_do.py +2 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_eq.py +5 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_flatten.py +5 -6
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_group.py +78 -16
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_map.py +29 -4
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_observe.py +89 -2
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_other.py +217 -11
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_readme.py +6 -7
- streamable-2.1.0b1/tests/test_ref_cycles.py +199 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_repr.py +3 -4
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_tools.py +13 -5
- streamable-2.1.0b0/streamable/_tools/_afuture.py +0 -81
- streamable-2.1.0b0/streamable/_tools/_async.py +0 -20
- streamable-2.1.0b0/streamable/_tools/_context.py +0 -32
- streamable-2.1.0b0/streamable/_tools/_error.py +0 -42
- streamable-2.1.0b0/streamable/_tools/_future.py +0 -75
- streamable-2.1.0b0/streamable/_tools/_star.py +0 -82
- streamable-2.1.0b0/tests/test_aclose.py +0 -245
- streamable-2.1.0b0/tests/test_ref_cycles.py +0 -85
- {streamable-2.1.0b0 → streamable-2.1.0b1}/LICENSE +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/setup.cfg +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/__init__.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_logging.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_validation.py +1 -1
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/py.typed +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/__init__.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_base.py +2 -2
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_involves_async.py +2 -2
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_repr.py +3 -3
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/dependency_links.txt +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/top_level.txt +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_catch.py +1 -1
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_filter.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_skip.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_take.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_throttle.py +1 -1
- {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_visitor.py +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamable
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.0b1
|
|
4
4
|
Summary: sync/async iterable streams for Python
|
|
5
5
|
Author-email: ebonnal <bonnal.enzo.dev@gmail.com>
|
|
6
6
|
License: Apache 2.
|
|
@@ -13,6 +13,7 @@ Requires-Dist: httpx==0.28.1; python_version >= "3.9" and extra == "dev"
|
|
|
13
13
|
Requires-Dist: mypy==1.18.2; python_version >= "3.9" and extra == "dev"
|
|
14
14
|
Requires-Dist: mypy-extensions==1.0.0; python_version >= "3.9" and extra == "dev"
|
|
15
15
|
Requires-Dist: polars==1.36.1; python_version >= "3.9" and extra == "dev"
|
|
16
|
+
Requires-Dist: pyright==1.1.414; python_version >= "3.9" and extra == "dev"
|
|
16
17
|
Requires-Dist: pytest==7.4.4; python_version >= "3.9" and extra == "dev"
|
|
17
18
|
Requires-Dist: pytest-asyncio==0.21.2; python_version >= "3.9" and extra == "dev"
|
|
18
19
|
Requires-Dist: pytest-cov==7.0.0; python_version >= "3.9" and extra == "dev"
|
|
@@ -42,7 +43,7 @@ Dynamic: license-file
|
|
|
42
43
|
[](https://www.python.org/downloads/release/python-3820/)
|
|
43
44
|
[](https://pypi.org/project/streamable/)
|
|
44
45
|
[](https://anaconda.org/conda-forge/streamable)
|
|
45
|
-
[](https://codecov.io/gh/ebonnal/streamable)
|
|
46
47
|
[](https://streamable.readthedocs.io/en/latest/api.html)
|
|
47
48
|
|
|
48
49
|
|
|
@@ -128,7 +129,7 @@ A `stream` can be iterated several times if its source allows it.
|
|
|
128
129
|
|
|
129
130
|
Operations return a new `stream`.
|
|
130
131
|
|
|
131
|
-
Operations allow iteration to resume after an
|
|
132
|
+
Operations allow iteration to resume after an `Exception`.
|
|
132
133
|
|
|
133
134
|
Operations accept both sync and async functions.
|
|
134
135
|
|
|
@@ -594,9 +595,9 @@ During an async iteration, these operations spawn child tasks:
|
|
|
594
595
|
|
|
595
596
|
When the iteration is complete, all the child tasks are done.
|
|
596
597
|
|
|
597
|
-
When the iterator is destroyed before it is exhausted, the pending child tasks
|
|
598
|
+
When the iterator is destroyed before it is exhausted, the pending child tasks terminate at a subsequent cycle of the event loop.
|
|
598
599
|
|
|
599
|
-
`stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly
|
|
600
|
+
`stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly terminate any pending child tasks:
|
|
600
601
|
|
|
601
602
|
```python
|
|
602
603
|
from contextlib import aclosing
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://www.python.org/downloads/release/python-3820/)
|
|
8
8
|
[](https://pypi.org/project/streamable/)
|
|
9
9
|
[](https://anaconda.org/conda-forge/streamable)
|
|
10
|
-
[](https://codecov.io/gh/ebonnal/streamable)
|
|
11
11
|
[](https://streamable.readthedocs.io/en/latest/api.html)
|
|
12
12
|
|
|
13
13
|
|
|
@@ -93,7 +93,7 @@ A `stream` can be iterated several times if its source allows it.
|
|
|
93
93
|
|
|
94
94
|
Operations return a new `stream`.
|
|
95
95
|
|
|
96
|
-
Operations allow iteration to resume after an
|
|
96
|
+
Operations allow iteration to resume after an `Exception`.
|
|
97
97
|
|
|
98
98
|
Operations accept both sync and async functions.
|
|
99
99
|
|
|
@@ -559,9 +559,9 @@ During an async iteration, these operations spawn child tasks:
|
|
|
559
559
|
|
|
560
560
|
When the iteration is complete, all the child tasks are done.
|
|
561
561
|
|
|
562
|
-
When the iterator is destroyed before it is exhausted, the pending child tasks
|
|
562
|
+
When the iterator is destroyed before it is exhausted, the pending child tasks terminate at a subsequent cycle of the event loop.
|
|
563
563
|
|
|
564
|
-
`stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly
|
|
564
|
+
`stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly terminate any pending child tasks:
|
|
565
565
|
|
|
566
566
|
```python
|
|
567
567
|
from contextlib import aclosing
|
|
@@ -19,6 +19,7 @@ dev = [
|
|
|
19
19
|
"mypy==1.18.2; python_version >= '3.9'",
|
|
20
20
|
"mypy-extensions==1.0.0; python_version >= '3.9'",
|
|
21
21
|
"polars==1.36.1; python_version >= '3.9'",
|
|
22
|
+
"pyright==1.1.414; python_version >= '3.9'",
|
|
22
23
|
"pytest==7.4.4; python_version >= '3.9'",
|
|
23
24
|
"pytest-asyncio==0.21.2; python_version >= '3.9'",
|
|
24
25
|
"pytest-cov==7.0.0; python_version >= '3.9'",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from streamable._stream import stream
|
|
2
|
-
from streamable._tools._star import star
|
|
3
|
-
from streamable._tools._observation import Observation
|
|
4
2
|
from streamable._tools._iter import ClosableAsyncIterator
|
|
3
|
+
from streamable._tools._observation import Observation
|
|
4
|
+
from streamable._tools._star import star
|
|
5
5
|
|
|
6
6
|
Stream = stream
|
|
7
7
|
|
|
@@ -12,4 +12,4 @@ ClosableAsyncIterator.__module__ = __name__
|
|
|
12
12
|
|
|
13
13
|
__all__ = ["stream", "star", "Observation", "ClosableAsyncIterator"]
|
|
14
14
|
|
|
15
|
-
__version__ = "2.1.
|
|
15
|
+
__version__ = "2.1.0b1"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from concurrent.futures import Executor
|
|
2
1
|
import datetime
|
|
2
|
+
from concurrent.futures import Executor
|
|
3
3
|
from inspect import iscoroutinefunction
|
|
4
4
|
from operator import itemgetter
|
|
5
5
|
from typing import (
|
|
@@ -15,12 +15,11 @@ from typing import (
|
|
|
15
15
|
cast,
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
-
from streamable._tools._iter import ClosableAsyncIterator
|
|
19
|
-
from streamable._tools._observation import Observation
|
|
20
|
-
|
|
21
18
|
from streamable import _aiterators
|
|
22
19
|
from streamable._tools._async import AsyncFunction
|
|
23
20
|
from streamable._tools._func import asyncify
|
|
21
|
+
from streamable._tools._iter import ClosableAsyncIterator
|
|
22
|
+
from streamable._tools._observation import Observation
|
|
24
23
|
|
|
25
24
|
T = TypeVar("T")
|
|
26
25
|
U = TypeVar("U")
|
|
@@ -84,9 +83,7 @@ def group(
|
|
|
84
83
|
if by is None:
|
|
85
84
|
return _aiterators.GroupAsyncIterator(upstream, up_to=up_to)
|
|
86
85
|
return _aiterators.FlattenAsyncIterator(
|
|
87
|
-
_aiterators.GroupByAsyncIterator(
|
|
88
|
-
upstream, by=cast(AsyncFunction[T, U], asyncify(by)), up_to=up_to
|
|
89
|
-
)
|
|
86
|
+
_aiterators.GroupByAsyncIterator(upstream, by=asyncify(by), up_to=up_to)
|
|
90
87
|
)
|
|
91
88
|
if by is None:
|
|
92
89
|
return _aiterators.MapAsyncIterator(
|
|
@@ -115,7 +112,7 @@ def map(
|
|
|
115
112
|
if iscoroutinefunction(into):
|
|
116
113
|
return _aiterators.AsyncConcurrentMapAsyncIterator(
|
|
117
114
|
upstream,
|
|
118
|
-
|
|
115
|
+
into,
|
|
119
116
|
concurrency=cast(int, concurrency),
|
|
120
117
|
as_completed=as_completed,
|
|
121
118
|
)
|