cocoindex 0.1.30__cp312-cp312-win_amd64.whl → 0.1.32__cp312-cp312-win_amd64.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.
Binary file
cocoindex/cli.py CHANGED
@@ -1,7 +1,9 @@
1
+ import asyncio
1
2
  import click
2
3
  import datetime
3
4
 
4
5
  from rich.console import Console
6
+ from rich.table import Table
5
7
 
6
8
  from . import flow, lib, setting
7
9
  from .setup import sync_setup, drop_setup, flow_names_with_setup, apply_setup_changes
@@ -56,11 +58,26 @@ def ls(show_all: bool):
56
58
  @click.option("--color/--no-color", default=True)
57
59
  def show(flow_name: str | None, color: bool):
58
60
  """
59
- Show the flow spec in a readable format with colored output.
61
+ Show the flow spec in a readable format with colored output,
62
+ including the schema.
60
63
  """
61
- fl = _flow_by_name(flow_name)
64
+ flow = _flow_by_name(flow_name)
62
65
  console = Console(no_color=not color)
63
- console.print(fl._render_text())
66
+ console.print(flow._render_text())
67
+
68
+ table = Table(
69
+ title=f"Schema for Flow: {flow.name}",
70
+ show_header=True,
71
+ header_style="bold magenta"
72
+ )
73
+ table.add_column("Field", style="cyan")
74
+ table.add_column("Type", style="green")
75
+ table.add_column("Attributes", style="yellow")
76
+
77
+ for field_name, field_type, attr_str in flow._render_schema():
78
+ table.add_row(field_name, field_type, attr_str)
79
+
80
+ console.print(table)
64
81
 
65
82
  @cli.command()
66
83
  def setup():
cocoindex/flow.py CHANGED
@@ -503,6 +503,9 @@ class Flow:
503
503
  return self._format_flow(flow_dict)
504
504
  except json.JSONDecodeError:
505
505
  return Text(flow_spec_str)
506
+
507
+ def _render_schema(self) -> list[tuple[str, str, str]]:
508
+ return self._lazy_engine_flow().get_schema()
506
509
 
507
510
  def __str__(self):
508
511
  return str(self._render_text())
cocoindex/setting.py CHANGED
@@ -47,7 +47,7 @@ class ServerSettings:
47
47
  """Settings for the cocoindex server."""
48
48
 
49
49
  # The address to bind the server to.
50
- address: str = "127.0.0.1:8080"
50
+ address: str = "127.0.0.1:49344"
51
51
 
52
52
  # The origins of the clients (e.g. CocoInsight UI) to allow CORS from.
53
53
  cors_origins: list[str] | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.30
3
+ Version: 0.1.32
4
4
  Requires-Dist: sentence-transformers>=3.3.1
5
5
  Requires-Dist: click>=8.1.8
6
6
  Requires-Dist: rich>=14.0.0
@@ -1,10 +1,10 @@
1
- cocoindex-0.1.30.dist-info/METADATA,sha256=ISVp8Ocpqg9n4IdI4pIugzjX6ALux71KBNeVOo8vx3o,8237
2
- cocoindex-0.1.30.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
3
- cocoindex-0.1.30.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
1
+ cocoindex-0.1.32.dist-info/METADATA,sha256=njnFCZ1wUIwUzKYAlFJjK64Ndna2W0m9zFG7pw9xflc,8237
2
+ cocoindex-0.1.32.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
3
+ cocoindex-0.1.32.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
4
4
  cocoindex/auth_registry.py,sha256=-EhwmyIwJLPZthPOvEK21TfMbxQtndRbogk8q7y4XuU,716
5
- cocoindex/cli.py,sha256=A0Si5GrByQ-4JQcvFZjCX3QU4bvFdmHxxMmoylw-xms,8609
5
+ cocoindex/cli.py,sha256=OucRz5IvX_LNHMiK4JFukfuyx8w-mbKq959O4XGHw14,9124
6
6
  cocoindex/convert.py,sha256=M8wRr38AgPpd43eklyWpNMaAvKHsIEyy_L3IlU7Q0oA,6095
7
- cocoindex/flow.py,sha256=W3qKuKHd_XIfSXZNSDhxUSAQFCalXTx-pVPudTCX1Uo,23590
7
+ cocoindex/flow.py,sha256=XNUNQyWzAsh4hlbJgn3tZfVVsjBPVywEyuqS8wcbCZU,23711
8
8
  cocoindex/functions.py,sha256=m7R8gNVK5RcavPY37d2lkRXwLBdMblZexCJ0JYcruss,1881
9
9
  cocoindex/index.py,sha256=32iiQI60VKhRRHle17rpoEVa_tsAHnyXXXnrLaX68uQ,557
10
10
  cocoindex/lib.py,sha256=w0SumLvn2xfuQOgzLZDnQLur_GZ9DMAKOFo9NKF8q1k,2406
@@ -13,7 +13,7 @@ cocoindex/op.py,sha256=PeoBddukU5vOBvUrFPC6fYH35L59THy9ZXVm_Vc2ng0,10998
13
13
  cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  cocoindex/query.py,sha256=GU3V8AoSK--xOU2yX0Ao-Rz1t3mlrsJ4JIhzsLVwFH8,3297
15
15
  cocoindex/runtime.py,sha256=WwyDSpJhvaHjnxH4q6r2MVftJB-QkNVH_TxZLxuDtFw,1009
16
- cocoindex/setting.py,sha256=eHi1h3M6bSgG-7OMm_DDJ_MMY3X-PVL0S5IzxnhjjGQ,2431
16
+ cocoindex/setting.py,sha256=UiTAWLvVEMsM-p31c20ciWVetmPcZsLhHQ74P5jGChA,2432
17
17
  cocoindex/setup.py,sha256=euHPZ9-7a68DV4PbdK2A0cZ9ECa6vT4qBraY3WKZk4s,512
18
18
  cocoindex/sources.py,sha256=4JWsW7sjFuiizaxOkxXJpZgVmVgF9ys9ATvvRY-SBjE,966
19
19
  cocoindex/storages.py,sha256=oJcY_zZx1wXjoJ_gitSvaFTUqhL6lUJihZQivvMMZ5U,2292
@@ -21,5 +21,5 @@ cocoindex/tests/test_convert.py,sha256=l5VpBgDw8F-0eMT_kEitUQTyI5newGnxqsm3gb6c2
21
21
  cocoindex/tests/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
22
22
  cocoindex/typing.py,sha256=WAmrgFwKRcoGB0aqRl2yk1cUey08HHQPgXyRRzmfN8c,8820
23
23
  cocoindex/__init__.py,sha256=FZo8bM7rmJ3Ppg_ysAjjlWxiHPQPrNNwyHb4V-onXT0,673
24
- cocoindex/_engine.cp312-win_amd64.pyd,sha256=oJ0slwF77wDR2dJjEt2My8sIrxBLvoG6lXC4MZHvZBg,58830848
25
- cocoindex-0.1.30.dist-info/RECORD,,
24
+ cocoindex/_engine.cp312-win_amd64.pyd,sha256=L8Zi86TIWEqQBaDr1SmKD-CpYsWhXEFNmJJ-tYOw8VE,55947776
25
+ cocoindex-0.1.32.dist-info/RECORD,,