cocoindex 0.1.51__cp312-cp312-win_amd64.whl → 0.1.52__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.
cocoindex/__init__.py CHANGED
@@ -2,7 +2,9 @@
2
2
  Cocoindex is a framework for building and running indexing pipelines.
3
3
  """
4
4
 
5
- from . import functions, sources, storages, cli, utils
5
+ from . import functions, sources, targets, cli, utils
6
+
7
+ from . import targets as storages # Deprecated: Use targets instead
6
8
 
7
9
  from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
8
10
  from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
@@ -21,6 +23,7 @@ __all__ = [
21
23
  "_engine",
22
24
  "functions",
23
25
  "sources",
26
+ "targets",
24
27
  "storages",
25
28
  "cli",
26
29
  "utils",
Binary file
cocoindex/cli.py CHANGED
@@ -247,8 +247,7 @@ def show(app_flow_specifier: str, color: bool, verbose: bool) -> None:
247
247
  )
248
248
  def setup(app_target: str, force: bool) -> None:
249
249
  """
250
- Check and apply backend setup changes for flows, including the internal and target storage
251
- (to export).
250
+ Check and apply backend setup changes for flows, including the internal storage and target (to export to).
252
251
 
253
252
  APP_TARGET: path/to/app.py or installed_module.
254
253
  """
cocoindex/flow.py CHANGED
@@ -327,7 +327,7 @@ class DataCollector:
327
327
  def export(
328
328
  self,
329
329
  name: str,
330
- target_spec: op.StorageSpec,
330
+ target_spec: op.TargetSpec,
331
331
  /,
332
332
  *,
333
333
  primary_key_fields: Sequence[str],
@@ -340,7 +340,7 @@ class DataCollector:
340
340
 
341
341
  `vector_index` is for backward compatibility only. Please use `vector_indexes` instead.
342
342
  """
343
- if not isinstance(target_spec, op.StorageSpec):
343
+ if not isinstance(target_spec, op.TargetSpec):
344
344
  raise ValueError(
345
345
  "export() can only be called on a CocoIndex target storage"
346
346
  )
cocoindex/op.py CHANGED
@@ -19,7 +19,7 @@ class OpCategory(Enum):
19
19
 
20
20
  FUNCTION = "function"
21
21
  SOURCE = "source"
22
- STORAGE = "storage"
22
+ TARGET = "target"
23
23
  DECLARATION = "declaration"
24
24
 
25
25
 
@@ -52,8 +52,8 @@ class FunctionSpec(metaclass=SpecMeta, category=OpCategory.FUNCTION): # pylint:
52
52
  """A function spec. All its subclass can be instantiated similar to a dataclass, i.e. ClassName(field1=value1, field2=value2, ...)"""
53
53
 
54
54
 
55
- class StorageSpec(metaclass=SpecMeta, category=OpCategory.STORAGE): # pylint: disable=too-few-public-methods
56
- """A storage spec. All its subclass can be instantiated similar to a dataclass, i.e. ClassName(field1=value1, field2=value2, ...)"""
55
+ class TargetSpec(metaclass=SpecMeta, category=OpCategory.TARGET): # pylint: disable=too-few-public-methods
56
+ """A target spec. All its subclass can be instantiated similar to a dataclass, i.e. ClassName(field1=value1, field2=value2, ...)"""
57
57
 
58
58
 
59
59
  class DeclarationSpec(metaclass=SpecMeta, category=OpCategory.DECLARATION): # pylint: disable=too-few-public-methods
@@ -1,4 +1,4 @@
1
- """All builtin storages."""
1
+ """All builtin targets."""
2
2
 
3
3
  from dataclasses import dataclass
4
4
  from typing import Sequence
@@ -9,8 +9,8 @@ from .auth_registry import AuthEntryReference
9
9
  from .setting import DatabaseConnectionSpec
10
10
 
11
11
 
12
- class Postgres(op.StorageSpec):
13
- """Storage powered by Postgres and pgvector."""
12
+ class Postgres(op.TargetSpec):
13
+ """Target powered by Postgres and pgvector."""
14
14
 
15
15
  database: AuthEntryReference[DatabaseConnectionSpec] | None = None
16
16
  table_name: str | None = None
@@ -25,8 +25,8 @@ class QdrantConnection:
25
25
 
26
26
 
27
27
  @dataclass
28
- class Qdrant(op.StorageSpec):
29
- """Storage powered by Qdrant - https://qdrant.tech/."""
28
+ class Qdrant(op.TargetSpec):
29
+ """Target powered by Qdrant - https://qdrant.tech/."""
30
30
 
31
31
  collection_name: str
32
32
  connection: AuthEntryReference[QdrantConnection] | None = None
@@ -52,7 +52,7 @@ class NodeFromFields:
52
52
 
53
53
  @dataclass
54
54
  class ReferencedNode:
55
- """Storage spec for a graph node."""
55
+ """Target spec for a graph node."""
56
56
 
57
57
  label: str
58
58
  primary_key_fields: Sequence[str]
@@ -95,7 +95,7 @@ class Neo4jConnection:
95
95
  db: str | None = None
96
96
 
97
97
 
98
- class Neo4j(op.StorageSpec):
98
+ class Neo4j(op.TargetSpec):
99
99
  """Graph storage powered by Neo4j."""
100
100
 
101
101
  connection: AuthEntryReference[Neo4jConnection]
@@ -119,7 +119,7 @@ class KuzuConnection:
119
119
  api_server_url: str
120
120
 
121
121
 
122
- class Kuzu(op.StorageSpec):
122
+ class Kuzu(op.TargetSpec):
123
123
  """Graph storage powered by Kuzu."""
124
124
 
125
125
  connection: AuthEntryReference[KuzuConnection]
cocoindex/utils.py CHANGED
@@ -2,12 +2,10 @@ from .flow import Flow
2
2
  from .setting import get_app_namespace
3
3
 
4
4
 
5
- def get_target_storage_default_name(
6
- flow: Flow, target_name: str, delimiter: str = "__"
7
- ) -> str:
5
+ def get_target_default_name(flow: Flow, target_name: str, delimiter: str = "__") -> str:
8
6
  """
9
7
  Get the default name for a target.
10
- It's used as the underlying storage name (e.g. a table, a collection, etc.) followed by most storage backends, if not explicitly specified.
8
+ It's used as the underlying target name (e.g. a table, a collection, etc.) followed by most targets, if not explicitly specified.
11
9
  """
12
10
  return (
13
11
  get_app_namespace(trailing_delimiter=delimiter)
@@ -15,3 +13,8 @@ def get_target_storage_default_name(
15
13
  + delimiter
16
14
  + target_name
17
15
  )
16
+
17
+
18
+ get_target_storage_default_name = (
19
+ get_target_default_name # Deprecated: Use get_target_default_name instead
20
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.51
3
+ Version: 0.1.52
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
@@ -130,7 +130,7 @@ def text_embedding_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoind
130
130
  # Export collected data to a vector index.
131
131
  doc_embeddings.export(
132
132
  "doc_embeddings",
133
- cocoindex.storages.Postgres(),
133
+ cocoindex.targets.Postgres(),
134
134
  primary_key_fields=["filename", "location"],
135
135
  vector_indexes=[
136
136
  cocoindex.VectorIndexDef(
@@ -1,28 +1,28 @@
1
- cocoindex-0.1.51.dist-info/METADATA,sha256=VWHNukHF17O5re8ldifAS_BV1WTtfh4Iv8HDP_6ADIo,10040
2
- cocoindex-0.1.51.dist-info/WHEEL,sha256=2Rq0eWWH7u9Ffm_ZQEcE2_DVE8if9XSfMophnE-xWmc,96
3
- cocoindex-0.1.51.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
- cocoindex-0.1.51.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
5
- cocoindex/__init__.py,sha256=1-ymMFyNmEMpYyWfpOTsh84C4pYnNVeVHfrzusaINdk,1766
6
- cocoindex/_engine.cp312-win_amd64.pyd,sha256=P0AnfNs1uowQRJAOB0qDEfc3MzXuLPcVC7VI8syrOvM,61389312
1
+ cocoindex-0.1.52.dist-info/METADATA,sha256=w1y1PEmcaZ6TQ9zqEPUmEkONXE55pMJRLK_5q5fPI6c,10039
2
+ cocoindex-0.1.52.dist-info/WHEEL,sha256=2Rq0eWWH7u9Ffm_ZQEcE2_DVE8if9XSfMophnE-xWmc,96
3
+ cocoindex-0.1.52.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.1.52.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
5
+ cocoindex/__init__.py,sha256=0cJBLw3MQX7MeuurZ49TV96zdKkSCva9atqxJZG0U2M,1853
6
+ cocoindex/_engine.cp312-win_amd64.pyd,sha256=tjGnONsEDLHnbh8a7DHQNu19gI4yB-RJqlBN3GPr1-A,61389312
7
7
  cocoindex/auth_registry.py,sha256=LojDKoX0ccO-G3bboFMlAti50_t5GK9BS0ouPJZfyUs,745
8
- cocoindex/cli.py,sha256=Sp_Hq3hyLU1JtQNHwlKEhReoGqNjJoAWhIGt_Q9kZDk,18800
8
+ cocoindex/cli.py,sha256=G69aDjYiT6wWJIG2l-VQAslfdxVE_OmkWQzZdR3KXiw,18798
9
9
  cocoindex/convert.py,sha256=3OInFkmwi8RxdyAJsCLEdMa8tmmnX0Q1I0JFsInXDLo,9037
10
- cocoindex/flow.py,sha256=ElTNrp9cxUZiKSvLMRwjU9rNQUn2d9zxryJzCxCFx4I,30985
10
+ cocoindex/flow.py,sha256=Dt6lzzhZgnnNbFOZ0smeDy6SlBCBofneoCBZ-T3rtIg,30983
11
11
  cocoindex/functions.py,sha256=3l7POrvuk5DVIwGUgCODAi-JNFJ1_WLTOg6Yn-uZ0IE,2471
12
12
  cocoindex/index.py,sha256=GrqTm1rLwICQ8hadtNvJAxVg7GWMvtMmFcbiNtNzmP0,569
13
13
  cocoindex/lib.py,sha256=o2UGq3eWsZbK5nusZEU7Y0R6NTbT0i03G2ye8N6ATNg,3015
14
14
  cocoindex/llm.py,sha256=sI46pXpTmOLOBOBpqCB2pnwDHz4PdVyEPBKZuIxObpU,372
15
- cocoindex/op.py,sha256=qSf2-zGd77YVXDC8UWUyAtDIHklNrRaFn1ZvLK5T64g,12148
15
+ cocoindex/op.py,sha256=Jk1KfRNBY4TEsbbhWHB5pEzNcMo_2T-FQR1Y75OUVhU,12143
16
16
  cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  cocoindex/runtime.py,sha256=saKEZntVwUVQNASRhiO9bHRVIFmQccemq2f9mo4mo1A,1090
18
18
  cocoindex/setting.py,sha256=dRNdX-rPBn321zGx6GGoSMggS4F2879A6EBLOUbX8R4,3717
19
19
  cocoindex/setup.py,sha256=nqJAEGQH-5yTulEy3aCAa9khbuiaqD81ZZUdeM3K_lo,799
20
20
  cocoindex/sources.py,sha256=4hxsntuyClp_jKH4oZbx3iE3UM4P2bZTpWy28dqdyFY,1375
21
- cocoindex/storages.py,sha256=WrfpGcOImFXH0DTEdBPRmL4GwyO62lfANMd6rTejxuQ,2939
21
+ cocoindex/targets.py,sha256=7FfG9kuEf5KTXtLwXMFaPFIut3PsIbpb3XIEjjeF7Bg,2931
22
22
  cocoindex/tests/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
23
23
  cocoindex/tests/test_convert.py,sha256=tIOFqF2LzHvW7v5Ny-JWAUhzvpskDOedHKmOTrQpEUw,29774
24
24
  cocoindex/tests/test_optional_database.py,sha256=dnzmTgaJf37D3q8fQsjP5UDER6FYETaUokDnFBMLtIk,8755
25
25
  cocoindex/tests/test_typing.py,sha256=9Fc_GALPinF9PdVlaO1_fFLi12dc7cNaV8XJma0f-2s,12818
26
26
  cocoindex/typing.py,sha256=geA2nOq_frf9NGB_XpNDOHTviAitRbgYH5OWQ59VOgQ,12780
27
- cocoindex/utils.py,sha256=RLyawj_M4ZDL-gwJ16e5p2AcFYIL50DlMkfZyKaNB2o,520
28
- cocoindex-0.1.51.dist-info/RECORD,,
27
+ cocoindex/utils.py,sha256=U3W39zD2uZpXX8v84tJD7sRmbC5ar3z_ljAP1cJrYXI,618
28
+ cocoindex-0.1.52.dist-info/RECORD,,