streamable 2.1.0b0__tar.gz → 2.1.0b2__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.0b2/MANIFEST.in +1 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/PKG-INFO +22 -6
- {streamable-2.1.0b0 → streamable-2.1.0b2}/README.md +4 -4
- {streamable-2.1.0b0 → streamable-2.1.0b2}/pyproject.toml +19 -1
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/__init__.py +3 -3
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_afunctions.py +5 -8
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_aiterators.py +373 -251
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_functions.py +8 -9
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_iterators.py +137 -127
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_stream.py +67 -32
- streamable-2.1.0b2/streamable/_tools/_afuture.py +100 -0
- streamable-2.1.0b2/streamable/_tools/_async.py +14 -0
- streamable-2.1.0b2/streamable/_tools/_context.py +69 -0
- streamable-2.1.0b2/streamable/_tools/_error.py +26 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_tools/_func.py +4 -4
- streamable-2.1.0b2/streamable/_tools/_future.py +100 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_tools/_iter.py +40 -17
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_tools/_observation.py +1 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_tools/_sentinel.py +0 -1
- streamable-2.1.0b2/streamable/_tools/_star.py +65 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/visitors/_aiter.py +10 -8
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/visitors/_eq.py +25 -39
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/visitors/_iter.py +2 -3
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable.egg-info/PKG-INFO +22 -6
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable.egg-info/SOURCES.txt +2 -20
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable.egg-info/requires.txt +1 -0
- 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_buffer.py +0 -85
- streamable-2.1.0b0/tests/test_catch.py +0 -269
- streamable-2.1.0b0/tests/test_do.py +0 -29
- streamable-2.1.0b0/tests/test_eq.py +0 -141
- streamable-2.1.0b0/tests/test_filter.py +0 -23
- streamable-2.1.0b0/tests/test_flatten.py +0 -141
- streamable-2.1.0b0/tests/test_group.py +0 -248
- streamable-2.1.0b0/tests/test_map.py +0 -179
- streamable-2.1.0b0/tests/test_observe.py +0 -273
- streamable-2.1.0b0/tests/test_other.py +0 -319
- streamable-2.1.0b0/tests/test_readme.py +0 -384
- streamable-2.1.0b0/tests/test_ref_cycles.py +0 -85
- streamable-2.1.0b0/tests/test_repr.py +0 -127
- streamable-2.1.0b0/tests/test_skip.py +0 -53
- streamable-2.1.0b0/tests/test_take.py +0 -86
- streamable-2.1.0b0/tests/test_throttle.py +0 -73
- streamable-2.1.0b0/tests/test_tools.py +0 -90
- streamable-2.1.0b0/tests/test_visitor.py +0 -52
- {streamable-2.1.0b0 → streamable-2.1.0b2}/LICENSE +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/setup.cfg +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_tools/__init__.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_tools/_logging.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/_tools/_validation.py +1 -1
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/py.typed +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/visitors/__init__.py +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/visitors/_base.py +2 -2
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/visitors/_involves_async.py +2 -2
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable/visitors/_repr.py +3 -3
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable.egg-info/dependency_links.txt +0 -0
- {streamable-2.1.0b0 → streamable-2.1.0b2}/streamable.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
prune tests
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamable
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.0b2
|
|
4
4
|
Summary: sync/async iterable streams for Python
|
|
5
5
|
Author-email: ebonnal <bonnal.enzo.dev@gmail.com>
|
|
6
|
-
License: Apache
|
|
6
|
+
License: Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://github.com/ebonnal/streamable
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Framework :: AsyncIO
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
|
+
Classifier: Typing :: Typed
|
|
8
23
|
Requires-Python: >=3.8
|
|
9
24
|
Description-Content-Type: text/markdown
|
|
10
25
|
License-File: LICENSE
|
|
@@ -13,6 +28,7 @@ Requires-Dist: httpx==0.28.1; python_version >= "3.9" and extra == "dev"
|
|
|
13
28
|
Requires-Dist: mypy==1.18.2; python_version >= "3.9" and extra == "dev"
|
|
14
29
|
Requires-Dist: mypy-extensions==1.0.0; python_version >= "3.9" and extra == "dev"
|
|
15
30
|
Requires-Dist: polars==1.36.1; python_version >= "3.9" and extra == "dev"
|
|
31
|
+
Requires-Dist: pyright==1.1.414; python_version >= "3.9" and extra == "dev"
|
|
16
32
|
Requires-Dist: pytest==7.4.4; python_version >= "3.9" and extra == "dev"
|
|
17
33
|
Requires-Dist: pytest-asyncio==0.21.2; python_version >= "3.9" and extra == "dev"
|
|
18
34
|
Requires-Dist: pytest-cov==7.0.0; python_version >= "3.9" and extra == "dev"
|
|
@@ -42,7 +58,7 @@ Dynamic: license-file
|
|
|
42
58
|
[](https://www.python.org/downloads/release/python-3820/)
|
|
43
59
|
[](https://pypi.org/project/streamable/)
|
|
44
60
|
[](https://anaconda.org/conda-forge/streamable)
|
|
45
|
-
[](https://codecov.io/gh/ebonnal/streamable)
|
|
46
62
|
[](https://streamable.readthedocs.io/en/latest/api.html)
|
|
47
63
|
|
|
48
64
|
|
|
@@ -128,7 +144,7 @@ A `stream` can be iterated several times if its source allows it.
|
|
|
128
144
|
|
|
129
145
|
Operations return a new `stream`.
|
|
130
146
|
|
|
131
|
-
Operations allow iteration to resume after an
|
|
147
|
+
Operations allow iteration to resume after an `Exception`.
|
|
132
148
|
|
|
133
149
|
Operations accept both sync and async functions.
|
|
134
150
|
|
|
@@ -594,9 +610,9 @@ During an async iteration, these operations spawn child tasks:
|
|
|
594
610
|
|
|
595
611
|
When the iteration is complete, all the child tasks are done.
|
|
596
612
|
|
|
597
|
-
When the iterator is destroyed before it is exhausted, the pending child tasks
|
|
613
|
+
When the iterator is destroyed before it is exhausted, the pending child tasks terminate at a subsequent cycle of the event loop.
|
|
598
614
|
|
|
599
|
-
`stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly
|
|
615
|
+
`stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly terminate any pending child tasks:
|
|
600
616
|
|
|
601
617
|
```python
|
|
602
618
|
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
|
|
@@ -7,10 +7,27 @@ name = "streamable"
|
|
|
7
7
|
dynamic = ["version"]
|
|
8
8
|
description = "sync/async iterable streams for Python"
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
|
-
license = { text = "Apache
|
|
10
|
+
license = { text = "Apache-2.0" }
|
|
11
11
|
authors = [{ name = "ebonnal", email = "bonnal.enzo.dev@gmail.com" }]
|
|
12
12
|
urls = { Homepage = "https://github.com/ebonnal/streamable" }
|
|
13
13
|
requires-python = ">=3.8"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Framework :: AsyncIO",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Programming Language :: Python :: 3.8",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Programming Language :: Python :: 3.14",
|
|
28
|
+
"Programming Language :: Python :: 3.15",
|
|
29
|
+
"Typing :: Typed",
|
|
30
|
+
]
|
|
14
31
|
dependencies = []
|
|
15
32
|
|
|
16
33
|
[project.optional-dependencies]
|
|
@@ -19,6 +36,7 @@ dev = [
|
|
|
19
36
|
"mypy==1.18.2; python_version >= '3.9'",
|
|
20
37
|
"mypy-extensions==1.0.0; python_version >= '3.9'",
|
|
21
38
|
"polars==1.36.1; python_version >= '3.9'",
|
|
39
|
+
"pyright==1.1.414; python_version >= '3.9'",
|
|
22
40
|
"pytest==7.4.4; python_version >= '3.9'",
|
|
23
41
|
"pytest-asyncio==0.21.2; python_version >= '3.9'",
|
|
24
42
|
"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.0b2"
|
|
@@ -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
|
)
|