cocoindex 0.1.30__cp313-cp313-manylinux_2_28_aarch64.whl → 0.1.31__cp313-cp313-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/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())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.30
3
+ Version: 0.1.31
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,8 +1,8 @@
1
- cocoindex-0.1.30.dist-info/METADATA,sha256=DgYe-2f-9L1PE3WP9x8f0om8fr3-Zct3bi5vkGbD-q0,8107
2
- cocoindex-0.1.30.dist-info/WHEEL,sha256=XZQLb2xxOkDdeXZsM0HEHjf0m4YrfKgeit7Z5ruCJ1s,109
3
- cocoindex-0.1.30.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1
+ cocoindex-0.1.31.dist-info/METADATA,sha256=afCbcks5IBIzcWGwZJYO2VrjME8cSNVZzIOSS2Fto0g,8107
2
+ cocoindex-0.1.31.dist-info/WHEEL,sha256=XZQLb2xxOkDdeXZsM0HEHjf0m4YrfKgeit7Z5ruCJ1s,109
3
+ cocoindex-0.1.31.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
4
  cocoindex/convert.py,sha256=mBUTa_Ag39_ut-yE_jc1wqS3zLjtOm6QKet-bqJ-RWc,5947
5
- cocoindex/cli.py,sha256=57prYaE9iljBcEhV3EqyMMndPwHJsVApvKR9XhvFzLA,8387
5
+ cocoindex/cli.py,sha256=Vh8bNZ41yLr1l_jJR1Z_b7mY-dOvN-EbiCRxDvtIsRk,8885
6
6
  cocoindex/index.py,sha256=LssEOuZi6AqhwKtZM3QFeQpa9T-0ELi8G5DsrYKECvc,534
7
7
  cocoindex/llm.py,sha256=_3rtahuKcqcEHPkFSwhXOSrekZyGxVApPoYtlU_chcA,348
8
8
  cocoindex/query.py,sha256=8_3Lb_EVjZtl2ZyJNZGX16LoKXEd-PL8OjY-zs9GQeA,3205
@@ -18,8 +18,8 @@ cocoindex/runtime.py,sha256=jqRnWkkIlAhE04gi4y0Y5bzuq9FX4j0aVNU-nengLJk,980
18
18
  cocoindex/setup.py,sha256=W1HshwYk_K2aeLOVn_e62ZOXBO9yWsoUboRiH4SjF48,496
19
19
  cocoindex/typing.py,sha256=BI2vPw4Iu4S3aznNJQrfM2LZU_weGYASTXF1W3ZWh_Y,8568
20
20
  cocoindex/storages.py,sha256=MFMsfyOCYMggTWeWrOi82miqOXQmiUuqq828x5htBr0,2207
21
- cocoindex/flow.py,sha256=5W0tuDy_oc54lEmELvQAujx9f_20CSynZCF5vuNlbYw,22919
21
+ cocoindex/flow.py,sha256=KVbB_Ebm0IpJgZxV4BLg30fjIPmsGFhrtmQOBqCZaIk,23037
22
22
  cocoindex/op.py,sha256=OGYRYl7gPa7X7iSU30iTrCzvqRBu7jQqfvN4vjG__dA,10730
23
23
  cocoindex/__init__.py,sha256=8atBT1HjclUOeiXd7TSzZWaqOR4x_qr5epvCKB7Z7oY,661
24
- cocoindex/_engine.cpython-313-aarch64-linux-gnu.so,sha256=9mFvu-Y_WxJ1vm0iRDWg5vj7gaWQCVUEFFgrKxoJ2dY,64130960
25
- cocoindex-0.1.30.dist-info/RECORD,,
24
+ cocoindex/_engine.cpython-313-aarch64-linux-gnu.so,sha256=oT_yRkqEJ4RZFkugC0XJbkWdr0FNu4N4G5QnntCZxWg,64046048
25
+ cocoindex-0.1.31.dist-info/RECORD,,