port-ocean 0.5.11__py3-none-any.whl → 0.5.12__py3-none-any.whl

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.

Potentially problematic release.


This version of port-ocean might be problematic. Click here for more details.

@@ -0,0 +1,49 @@
1
+ import typing
2
+
3
+ import aiostream
4
+
5
+
6
+ async def stream_async_iterators_tasks(
7
+ *tasks: typing.AsyncIterable[typing.Any],
8
+ ) -> typing.AsyncIterable[typing.Any]:
9
+ """
10
+ This function takes a list of async iterators and streams the results of each iterator as they are available.
11
+ By using this function you can combine multiple async iterators into a single stream of results, instead of waiting
12
+ for each iterator to finish before starting the next one.
13
+
14
+ Usage:
15
+ ```python
16
+ async def async_iterator1():
17
+ for i in range(10):
18
+ yield i
19
+ await asyncio.sleep(1)
20
+
21
+ async def async_iterator2():
22
+ for i in range(10, 20):
23
+ yield i
24
+ await asyncio.sleep(1)
25
+
26
+ async def main():
27
+ async for result in stream_async_iterators_tasks([async_iterator1(), async_iterator2()]):
28
+ print(result)
29
+ ```
30
+
31
+ Caution - Before using this function, make sure that the third-party API you are calling allows the number of
32
+ concurrent requests you are making. If the API has a rate limit, you may need to adjust the number of concurrent
33
+ requests to avoid hitting the rate limit.
34
+
35
+ :param tasks: A list of async iterators
36
+ :return: A stream of results
37
+ """
38
+ if not tasks:
39
+ raise StopAsyncIteration("No tasks provided")
40
+
41
+ if len(tasks) == 1:
42
+ async for batch_items in tasks[0]:
43
+ yield batch_items
44
+ return
45
+
46
+ combine = aiostream.stream.merge(tasks[0], *tasks[1:])
47
+ async with combine.stream() as streamer:
48
+ async for batch_items in streamer:
49
+ yield batch_items
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.5.11
3
+ Version: 0.5.12
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -21,11 +21,12 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Classifier: Topic :: Utilities
23
23
  Provides-Extra: cli
24
+ Requires-Dist: aiostream (>=0.5.2,<0.6.0)
24
25
  Requires-Dist: click (>=8.1.3,<9.0.0) ; extra == "cli"
25
26
  Requires-Dist: confluent-kafka (>=2.1.1,<3.0.0)
26
27
  Requires-Dist: cookiecutter (>=2.1.1,<3.0.0) ; extra == "cli"
27
28
  Requires-Dist: fastapi (>=0.100,<0.110)
28
- Requires-Dist: httpx (>=0.24.1,<0.25.0)
29
+ Requires-Dist: httpx (>=0.24.1,<0.28.0)
29
30
  Requires-Dist: jinja2-time (>=0.2.0,<0.3.0) ; extra == "cli"
30
31
  Requires-Dist: loguru (>=0.7.0,<0.8.0)
31
32
  Requires-Dist: pydantic (>=1.10.8,<2.0.0)
@@ -37,7 +38,7 @@ Requires-Dist: rich (>=13.4.1,<14.0.0) ; extra == "cli"
37
38
  Requires-Dist: six (>=1.16.0,<2.0.0)
38
39
  Requires-Dist: tomli (>=2.0.1,<3.0.0)
39
40
  Requires-Dist: urllib3 (>=1.26.16,<2.0.0)
40
- Requires-Dist: uvicorn (>=0.22.0,<0.23.0)
41
+ Requires-Dist: uvicorn (>=0.22,<0.30)
41
42
  Requires-Dist: werkzeug (>=2.3.4,<4.0.0)
42
43
  Project-URL: Repository, https://github.com/port-labs/Port-Ocean
43
44
  Description-Content-Type: text/markdown
@@ -116,13 +116,14 @@ port_ocean/run.py,sha256=vyShtqg_jEiE6M4SJpci6c4oRD9k2ztesAXEx_6Sc9M,1906
116
116
  port_ocean/sonar-project.properties,sha256=X_wLzDOkEVmpGLRMb2fg9Rb0DxWwUFSvESId8qpvrPI,73
117
117
  port_ocean/utils/__init__.py,sha256=KMGnCPXZJbNwtgxtyMycapkDz8tpSyw23MSYT3iVeHs,91
118
118
  port_ocean/utils/async_http.py,sha256=arnH458TExn2Dju_Sy6pHas_vF5RMWnOp-jBz5WAAcE,1226
119
+ port_ocean/utils/async_iterators.py,sha256=buFBiPdsqkNMCk91h6ZG8hJa181j7RjgHajbfgeB8A8,1608
119
120
  port_ocean/utils/cache.py,sha256=3KItZDE2yVrbVDr-hoM8lNna8s2dlpxhP4ICdLjH4LQ,2231
120
121
  port_ocean/utils/misc.py,sha256=2XmO8W0SgPjV0rd9HZvrHhoMlHprIwmMFsINxlAmgyw,1723
121
122
  port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,3231
122
123
  port_ocean/utils/signal.py,sha256=Fab0049Cjs69TPTQgvEvilaVZKACQr6tGkRdySjNCi8,1515
123
124
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
124
- port_ocean-0.5.11.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
125
- port_ocean-0.5.11.dist-info/METADATA,sha256=lenAr52R9wjALNxCczYMRqTVp9sevHnfbT9d10-9uj4,6516
126
- port_ocean-0.5.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
127
- port_ocean-0.5.11.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
128
- port_ocean-0.5.11.dist-info/RECORD,,
125
+ port_ocean-0.5.12.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
126
+ port_ocean-0.5.12.dist-info/METADATA,sha256=2D1NvU_qhmLVgbZBwOEYO4XIPRp2MFDazAVNDI01ADw,6554
127
+ port_ocean-0.5.12.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
128
+ port_ocean-0.5.12.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
129
+ port_ocean-0.5.12.dist-info/RECORD,,