Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Name files for their main export, transforming Python names from PascalCase to underscore_case. For example, the file that defines the EAVFilter class should be named eav_filter.py.
29 changes: 29 additions & 0 deletions examples/eav_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os

from cvec import CVec, EAVFilter


def main() -> None:
cvec = CVec(
host=os.environ.get(
"CVEC_HOST", "https://your-subdomain.cvector.dev"
), # Replace with your API host
api_key=os.environ.get("CVEC_API_KEY", "your-api-key"),
)

# Example: Query with numeric range filter
print("\nQuerying with numeric range filter...")
rows = cvec.select_from_eav_id(
table_id="00000000-0000-0000-0000-000000000000",
column_ids=["abcd", "defg", "hijk"],
filters=[
EAVFilter(column_id="abcd", numeric_min=45992, numeric_max=45993),
],
)
print(f"Found {len(rows)} rows with abcd in range [45992, 45993)")
for row in rows:
print(f"- {row}")


if __name__ == "__main__":
main()
27 changes: 27 additions & 0 deletions examples/show_eav_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""Show EAV tables and columns."""

import os

from cvec import CVec


def main() -> None:
cvec = CVec(
host=os.environ.get("CVEC_HOST", ""),
api_key=os.environ.get("CVEC_API_KEY", ""),
)

tables = cvec.get_eav_tables()
print(f"Found {len(tables)} EAV tables\n")

for table in tables:
print(f"{table.name} (id: {table.id})")
columns = cvec.get_eav_columns(table.id)
for column in columns:
print(f" - {column.name} ({column.type}, id: {column.eav_column_id})")
print()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cvec"
version = "1.2.0"
version = "1.3.0"
description = "SDK for CVector Energy"
authors = [{ name = "CVector", email = "support@cvector.energy" }]
readme = "README.md"
Expand Down
3 changes: 2 additions & 1 deletion src/cvec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .cvec import CVec
from .models import EAVColumn, EAVFilter, EAVTable

__all__ = ["CVec"]
__all__ = ["CVec", "EAVColumn", "EAVFilter", "EAVTable"]
Loading