Skip to main content

VictorDB Python Client

VictorDB is a Python client and ORM for high-performance vector and key-value databases. It provides a simple, flexible API for vector search, key-value storage, and object modeling, making it easy to build modern AI and data applications.

Features

  • Vector index operations: insert, search, delete
  • Key-value table operations: put, get, delete
  • ORM-style data modeling with secondary indexes
  • High-performance, binary protocol (CBOR)
  • Pluggable and extensible design

Installation

pip install victordb

Quick Start

from victordb.victor import VictorIndexClient, VictorTableClient, VictorSession, VictorBaseModel

# Connect to VictorDB server (vector index)
index_client = VictorIndexClient()
index_client.connect(host="localhost", port=9000)

# Insert a vector
index_client.insert(id=123, vector=[0.1, 0.2, 0.3])

# Search for similar vectors
results = index_client.search(vector=[0.1, 0.2, 0.3], topk=5)
print(results)

# Connect to VictorDB server (key-value table)
table_client = VictorTableClient()
table_client.connect(host="localhost", port=9001)

# Store and retrieve a value
table_client.put(b"mykey", b"myvalue")
value = table_client.get(b"mykey")
print(value)

ORM Example

Define your own models by inheriting from VictorBaseModel:

from victordb.victor import VictorSession, VictorTableClient, VictorBaseModel
from dataclasses import dataclass, field

@dataclass
class User(VictorBaseModel):
    __classname__ = "User"
    __indexed__ = ["email"]
    email: str = ""
    name: str = ""

# Connect to table and create session
table = VictorTableClient()
table.connect(host="localhost", port=9001)
session = VictorSession(table)

# Create and save a user
user = User(email="alice@example.com", name="Alice")
user.save(session)

# Query by indexed field
users = User.query_eq(session, "email", "alice@example.com")
print(users)

API Overview

VictorIndexClient

  • insert(id: int, vector: List[float]) -> int
  • delete(id: int) -> bool
  • search(vector: List[float], topk: int) -> List[Tuple[int, float]]

VictorTableClient

  • put(key: bytes, value: bytes) -> bool
  • get(key: bytes) -> Optional[bytes]
  • delete(key: bytes) -> bool
  • to_bytes(value: Any) -> bytes
  • from_bytes(data: bytes, target_type: str = 'auto') -> Any

VictorSession

  • new_id() -> int
  • kv_put(key: str, value: Any) -> None
  • kv_get(key: str, target_type='auto') -> Optional[Any]

VictorBaseModel

  • save(session: VictorSession) -> Self
  • delete(session: VictorSession) -> None
  • refresh(session: VictorSession) -> Self
  • get(session: VictorSession, id_: int) -> Optional[Self]
  • all_ids(session: VictorSession) -> List[int]
  • query_eq(session: VictorSession, field: str, value: Any) -> List[Self]

Metadata

Release files for victordb 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for victordb 1.0.1
File Size Uploaded
victordb-1.0.1.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for victordb 1.0.1
File Interpreter ABI Platform
victordb-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / victordb-1.0.1.tar.gz

Download URL victordb-1.0.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6ef9258a98fa7b48a578b48d263d61e8612ae1354350085775b176594ee0da02
BLAKE2b-256 checksum
How to use checksums
51bb6617b68dd4d45e0e10179ba295be8e24b2c9be58d6ead25af8e78a997511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / victordb-1.0.1-py3-none-any.whl

Download URL victordb-1.0.1-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca0f38f16aa211415ad4cf1d24fa07865535a16511b8ad6747a848e46352fd6b
BLAKE2b-256 checksum
How to use checksums
f153ee1dc3c6a787fae07b4cd7da1d0c271489e02fd99b4c413d7cb52435dcca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page