cocoindex 0.1.67__pp311-pypy311_pp73-manylinux_2_28_aarch64.whl → 0.1.69__pp311-pypy311_pp73-manylinux_2_28_aarch64.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.
cocoindex/__init__.py CHANGED
@@ -10,7 +10,7 @@ from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
10
10
  from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
11
11
  from .flow import flow_def
12
12
  from .flow import EvaluateAndDumpOptions, GeneratedField
13
- from .flow import FlowLiveUpdater, FlowLiveUpdaterOptions
13
+ from .flow import FlowLiveUpdater, FlowLiveUpdaterOptions, FlowUpdaterStatusUpdates
14
14
  from .flow import add_flow_def, remove_flow
15
15
  from .flow import update_all_flows_async, setup_all_flows, drop_all_flows
16
16
  from .lib import init, start_server, stop
@@ -54,6 +54,7 @@ __all__ = [
54
54
  "GeneratedField",
55
55
  "FlowLiveUpdater",
56
56
  "FlowLiveUpdaterOptions",
57
+ "FlowUpdaterStatusUpdates",
57
58
  "add_flow_def",
58
59
  "remove_flow",
59
60
  "update_all_flows_async",
cocoindex/flow.py CHANGED
@@ -534,6 +534,18 @@ class FlowLiveUpdaterOptions:
534
534
  print_stats: bool = False
535
535
 
536
536
 
537
+ class FlowUpdaterStatusUpdates(NamedTuple):
538
+ """
539
+ Status updates for a flow updater.
540
+ """
541
+
542
+ # Sources that are still active, i.e. not stopped processing.
543
+ active_sources: list[str]
544
+
545
+ # Sources with updates since last time.
546
+ updated_sources: list[str]
547
+
548
+
537
549
  class FlowLiveUpdater:
538
550
  """
539
551
  A live updater for a flow.
@@ -587,7 +599,26 @@ class FlowLiveUpdater:
587
599
  """
588
600
  Wait for the live updater to finish. Async version.
589
601
  """
590
- await self._get_engine_live_updater().wait()
602
+ await self._get_engine_live_updater().wait_async()
603
+
604
+ def next_status_updates(self) -> FlowUpdaterStatusUpdates:
605
+ """
606
+ Get the next status updates.
607
+
608
+ It blocks until there's a new status updates, including the processing finishes for a bunch of source updates,
609
+ and live updater stops (aborted, or no more sources to process).
610
+ """
611
+ return execution_context.run(self.next_status_updates_async())
612
+
613
+ async def next_status_updates_async(self) -> FlowUpdaterStatusUpdates:
614
+ """
615
+ Get the next status updates. Async version.
616
+ """
617
+ updates = await self._get_engine_live_updater().next_status_updates_async()
618
+ return FlowUpdaterStatusUpdates(
619
+ active_sources=updates.active_sources,
620
+ updated_sources=updates.updated_sources,
621
+ )
591
622
 
592
623
  def abort(self) -> None:
593
624
  """
@@ -879,10 +910,7 @@ def update_all_flows(
879
910
  """
880
911
  Update all flows.
881
912
  """
882
- return cast(
883
- dict[str, _engine.IndexUpdateInfo],
884
- execution_context.run(update_all_flows_async(options)),
885
- )
913
+ return execution_context.run(update_all_flows_async(options))
886
914
 
887
915
 
888
916
  async def update_all_flows_async(
@@ -958,7 +986,7 @@ class TransformFlow(Generic[T]):
958
986
  def _flow_info(self) -> TransformFlowInfo:
959
987
  if self._lazy_flow_info is not None:
960
988
  return self._lazy_flow_info
961
- return cast(TransformFlowInfo, execution_context.run(self._flow_info_async()))
989
+ return execution_context.run(self._flow_info_async())
962
990
 
963
991
  async def _flow_info_async(self) -> TransformFlowInfo:
964
992
  if self._lazy_flow_info is not None:
@@ -1037,7 +1065,7 @@ class TransformFlow(Generic[T]):
1037
1065
  """
1038
1066
  Evaluate the transform flow.
1039
1067
  """
1040
- return cast(T, execution_context.run(self.eval_async(*args, **kwargs)))
1068
+ return execution_context.run(self.eval_async(*args, **kwargs))
1041
1069
 
1042
1070
  async def eval_async(self, *args: Any, **kwargs: Any) -> T:
1043
1071
  """
cocoindex/runtime.py CHANGED
@@ -5,7 +5,10 @@ manner.
5
5
 
6
6
  import threading
7
7
  import asyncio
8
- from typing import Any, Coroutine
8
+ from typing import Any, Coroutine, TypeVar
9
+
10
+
11
+ T = TypeVar("T")
9
12
 
10
13
 
11
14
  class _ExecutionContext:
@@ -26,7 +29,7 @@ class _ExecutionContext:
26
29
  ).start()
27
30
  return self._event_loop
28
31
 
29
- def run(self, coro: Coroutine[Any, Any, Any]) -> Any:
32
+ def run(self, coro: Coroutine[Any, Any, T]) -> T:
30
33
  """Run a coroutine in the event loop, blocking until it finishes. Return its result."""
31
34
  return asyncio.run_coroutine_threadsafe(coro, self.event_loop).result()
32
35
 
@@ -1,17 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.67
3
+ Version: 0.1.69
4
4
  Requires-Dist: click>=8.1.8
5
5
  Requires-Dist: rich>=14.0.0
6
6
  Requires-Dist: python-dotenv>=1.1.0
7
7
  Requires-Dist: watchfiles>=1.1.0
8
8
  Requires-Dist: numpy>=1.23.2
9
- Requires-Dist: pytest ; extra == 'test'
9
+ Requires-Dist: pytest ; extra == 'dev'
10
10
  Requires-Dist: ruff ; extra == 'dev'
11
+ Requires-Dist: mypy ; extra == 'dev'
11
12
  Requires-Dist: pre-commit ; extra == 'dev'
12
13
  Requires-Dist: sentence-transformers>=3.3.1 ; extra == 'embeddings'
13
14
  Requires-Dist: cocoindex[embeddings] ; extra == 'all'
14
- Provides-Extra: test
15
15
  Provides-Extra: dev
16
16
  Provides-Extra: embeddings
17
17
  Provides-Extra: all
@@ -36,16 +36,36 @@ Project-URL: Homepage, https://cocoindex.io/
36
36
  [![License](https://img.shields.io/badge/license-Apache%202.0-5B5BD6?logoColor=white)](https://opensource.org/licenses/Apache-2.0)
37
37
  [![PyPI version](https://img.shields.io/pypi/v/cocoindex?color=5B5BD6)](https://pypi.org/project/cocoindex/)
38
38
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/cocoindex)](https://pypistats.org/packages/cocoindex)
39
-
40
39
  [![CI](https://github.com/cocoindex-io/cocoindex/actions/workflows/CI.yml/badge.svg?event=push&color=5B5BD6)](https://github.com/cocoindex-io/cocoindex/actions/workflows/CI.yml)
41
40
  [![release](https://github.com/cocoindex-io/cocoindex/actions/workflows/release.yml/badge.svg?event=push&color=5B5BD6)](https://github.com/cocoindex-io/cocoindex/actions/workflows/release.yml)
42
41
  [![Discord](https://img.shields.io/discord/1314801574169673738?logo=discord&color=5B5BD6&logoColor=white)](https://discord.com/invite/zpA9S2DR7s)
42
+
43
+ </div>
44
+
45
+ <div align="center">
46
+ <a href="https://trendshift.io/repositories/13939" target="_blank"><img src="https://trendshift.io/api/badge/repositories/13939" alt="cocoindex-io%2Fcocoindex | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
43
47
  </div>
44
48
 
49
+
45
50
  Ultra performant data transformation framework for AI, with core engine written in Rust. Support incremental processing and data lineage out-of-box. Exceptional developer velocity. Production-ready at day 0.
46
51
 
47
52
  ⭐ Drop a star to help us grow!
48
53
 
54
+ <div align="center">
55
+
56
+ <!-- Keep these links. Translations will automatically update with the README. -->
57
+ [Deutsch](https://readme-i18n.com/cocoindex-io/cocoindex?lang=de) |
58
+ [English](https://readme-i18n.com/cocoindex-io/cocoindex?lang=en) |
59
+ [Español](https://readme-i18n.com/cocoindex-io/cocoindex?lang=es) |
60
+ [français](https://readme-i18n.com/cocoindex-io/cocoindex?lang=fr) |
61
+ [日本語](https://readme-i18n.com/cocoindex-io/cocoindex?lang=ja) |
62
+ [한국어](https://readme-i18n.com/cocoindex-io/cocoindex?lang=ko) |
63
+ [Português](https://readme-i18n.com/cocoindex-io/cocoindex?lang=pt) |
64
+ [Русский](https://readme-i18n.com/cocoindex-io/cocoindex?lang=ru) |
65
+ [中文](https://readme-i18n.com/cocoindex-io/cocoindex?lang=zh)
66
+
67
+ </div>
68
+
49
69
  </br>
50
70
 
51
71
  <p align="center">
@@ -59,7 +79,7 @@ CocoIndex makes it super easy to transform data with AI workloads, and keep sour
59
79
  </br>
60
80
 
61
81
  <p align="center">
62
- <img src="https://cocoindex.io/images/venn-features.png" alt="CocoIndex Features" width='480'>
82
+ <img src="https://cocoindex.io/images/venn-features.png" alt="CocoIndex Features" width='400'>
63
83
  </p>
64
84
 
65
85
  </br>
@@ -1,20 +1,20 @@
1
- cocoindex-0.1.67.dist-info/METADATA,sha256=SJIeiMwnbmOKiJSenH-DSoPatDM3bh6SD7B08GdI5Xs,10172
2
- cocoindex-0.1.67.dist-info/WHEEL,sha256=7zxhuuBJUuil6R_MfVJvTZXJmNSPMntESIcLB40BBxA,116
3
- cocoindex-0.1.67.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
- cocoindex-0.1.67.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
- cocoindex/__init__.py,sha256=nr-W-LX0e9EX6ZVMbf0MRF0EhtntqADOdwc9F2nwfWw,2004
6
- cocoindex/_engine.pypy311-pp73-aarch64-linux-gnu.so,sha256=nOqpmAbzeM8wldW2-tw-H1QRxMGy-wsSoFjvLEq2OaY,64916448
1
+ cocoindex-0.1.69.dist-info/METADATA,sha256=zrovdJq1T7tqAOwvXq0lf8AaVJ5_mU3YpsIAZ-fxDYY,11216
2
+ cocoindex-0.1.69.dist-info/WHEEL,sha256=7zxhuuBJUuil6R_MfVJvTZXJmNSPMntESIcLB40BBxA,116
3
+ cocoindex-0.1.69.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.1.69.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
+ cocoindex/__init__.py,sha256=AChibZmC8DYGLKesIYjqF5ZxR-SECwFXJ7usTDBl5Lk,2062
6
+ cocoindex/_engine.pypy311-pp73-aarch64-linux-gnu.so,sha256=KdD-X3Pv3Rmhf3EW14bIhqcv8PFdDi5R0qFQ50p8Xw0,68447136
7
7
  cocoindex/auth_registry.py,sha256=1XqO7ibjmBBd8i11XSJTvTgdz8p1ptW-ZpuSgo_5zzk,716
8
8
  cocoindex/cli.py,sha256=-gp639JSyQN6YjnhGqCakIzYoSSqXxQMbxbkcYGP0QY,22359
9
9
  cocoindex/convert.py,sha256=RYfRUungabr-dHakG4k2kDvYambxHFljAmTuPQeQths,13117
10
- cocoindex/flow.py,sha256=MFPtfJBVTjQ56d7vUn2LvtY30Vg4q2rY6nqvjjJL1kQ,35085
10
+ cocoindex/flow.py,sha256=XS63KkRr8JV8Mxg3KzW2Y7Y-GyUlaFTdRrw_sc7l0H4,36046
11
11
  cocoindex/functions.py,sha256=Ih1rtaTvZzQ2wucCOSpzSUu2-eu0mgtBVi1mh9M-Buw,3162
12
12
  cocoindex/index.py,sha256=j93B9jEvvLXHtpzKWL88SY6wCGEoPgpsQhEGHlyYGFg,540
13
13
  cocoindex/lib.py,sha256=f--9dAYd84CZosbDZqNW0oGbBLsY3dXiUTR1VrfQ_QY,817
14
14
  cocoindex/llm.py,sha256=WxmWUbNcf9HOCM5xkbDeFs9lF67M3mr810B7deDDc-8,673
15
15
  cocoindex/op.py,sha256=r_Usx7Jqh49Cck3tsYLx2vLRNUZArkQP_g7bIID6LPU,11809
16
16
  cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- cocoindex/runtime.py,sha256=bAdHYaXFWiiUWyAgzmKTeaAaRR0D_AmaqVCIdPO-v00,1056
17
+ cocoindex/runtime.py,sha256=povilB3HH3y1JF-yxKwU-pD8n2WnAqyQxIgvXXHNc60,1080
18
18
  cocoindex/setting.py,sha256=ADuv7RaWd9k-m3V0Cfy2jmaCt6DupJCviWdOm0CTiVw,4734
19
19
  cocoindex/setup.py,sha256=7uIHKN4FOCuoidPXcKyGTrkqpkl9luL49-6UcnMxYzw,3068
20
20
  cocoindex/sources.py,sha256=8MR_oyr7t0m-gUFq7FO6HHM-tDLmQSBAjheFXJzRd8g,1733
@@ -25,4 +25,4 @@ cocoindex/tests/test_optional_database.py,sha256=snAmkNa6wtOSaxoZE1HgjvL5v_ylitt
25
25
  cocoindex/tests/test_typing.py,sha256=NB4nUzoumOF_wGFa4D2Xf6d0bUVtOiSXyb78M1pYSG4,14827
26
26
  cocoindex/typing.py,sha256=MO9HkrNpargvMPvpkd7jgSu2R-21KE_NaB9-WI4YOZA,13241
27
27
  cocoindex/utils.py,sha256=hUhX-XV6XGCtJSEIpBOuDv6VvqImwPlgBxztBTw7u0U,598
28
- cocoindex-0.1.67.dist-info/RECORD,,
28
+ cocoindex-0.1.69.dist-info/RECORD,,