add colors!
build / build (push) Successful in 12s
pytest / pytest (push) Successful in 29s

This commit is contained in:
Matteo Rosati
2026-04-23 21:49:46 +02:00
parent 3fcc3904b4
commit a14edebafe
10 changed files with 24 additions and 12 deletions
+1
View File
@@ -1,5 +1,6 @@
from __future__ import annotations
from rich import print
from chromy.chroma_functions import count_collection
+2 -1
View File
@@ -1,9 +1,10 @@
from __future__ import annotations
from rich import print
from chromy.chroma_functions import create_collection
def handle_create_collection(collection: str) -> int:
collection_name = create_collection(collection)
print(f"Created collection '{collection_name}'.")
print(f"[bold green]Created[/]: collection '{collection_name}'.")
return 0
+3 -2
View File
@@ -1,5 +1,6 @@
from __future__ import annotations
from rich import print
from chromy.chroma_functions import delete_collection, delete_data
@@ -22,7 +23,7 @@ def _parse_where_clause(where_clause: str) -> dict[str, str]:
def handle_delete_collection(collection: str) -> int:
delete_collection(collection)
print(f"Deleted collection '{collection}'.")
print(f"[bold green]Deleted[/] collection '{collection}'.")
return 0
@@ -31,7 +32,7 @@ def handle_delete_records(collection: str, where_clause: str) -> int:
deleted = delete_data(collection, where)
condition, value = next(iter(where.items()))
print(
f"Deleted {deleted} record(s) from collection '{collection}' "
f"[bold green]Deleted[/] {deleted} record(s) from collection '{collection}' "
f"where {condition}={value}."
)
return 0
+3 -1
View File
@@ -2,6 +2,7 @@ from __future__ import annotations
import os
from pathlib import Path
from rich import print
from chromy.utilities import ingest_file
@@ -25,5 +26,6 @@ def _get_absolute_path(file: str) -> str:
def handle_import(collection: str, file: str) -> int:
records_added = ingest_file(collection, _get_absolute_path(file))
print(f"Added {records_added} records to collection '{collection}'.")
print(
f"[bold green]Added[/] {records_added} records to collection '{collection}'.")
return 0