Skip to main content

DODIL Python SDK

Project description

DODIL Python SDK

The DODIL Python SDK lets you interact with DODIL services from Python.

Currently supported services:

  • VNG: multi-modal vector ingestion
  • VBase: vector database (Milvus-backed)
  • VSpace: integrated embedding + storage structure

Install

pip install dodil

Quick start

Create a client using a service account:

from dodil import Client

c = Client(
    profile="staging",  # or "prod"
    service_account_id="...",
    service_account_secret="...",
)

VBase (connect + list collections):

from dodil import VBaseConfig

vbase = c.vbase.connect(
    VBaseConfig(
        host="vbase-db-<id>.infra.dodil.cloud",
        port=443,
        scheme="https",
        db_name="db_<id>",
    )
)

print(vbase.list_collections())

vbase.close()
c.close()

VSpace

For varied use cases involving embedding + storage, the SDK provides a VSpace structure. This allows you to embed texts via VNG and store/search them in VBase with single commands.

1) Initialize VSpace

space = c.vspace.connect()
col_name = space.setup(dim=1024)  # Setup space with desired embedding dimension

2) Index data

from dodil.vng import EmbeddingTask

space.add(
    data=[
        "apple",
        "banana",
        # Example: embedding an image from URL
        "https://example.com/cherry.jpg"
    ],
    ids=[1, 2, 3],  # Optional manually assigned IDs
    vng_task=EmbeddingTask.INDEX
)

3) Search data

# Search with text
results = space.search(
    query="fruit",
    limit=5,
    vng_task=EmbeddingTask.QUERY,
    output_fields=["text", "id"]
)

print(f"Found {len(results)} results:")
for i, hit in enumerate(results):
    print(f"\nResult {i+1}:")
    print(f"  Score: {hit.get('distance'):.4f}")

4) Visualize

space.visualize()

Documentation

Examples

Check out the examples/ directory for more usage scenarios:


Development

uv sync
pytest

Contributing

We welcome issues and pull requests.

–	Keep public APIs stable (prefer additive changes).
–	Maintain backward compatibility where possible.
-	Add tests for bug fixes and new features.
-	Format and lint before opening a PR.

Project conventions

-	Root client: Client
-	Services are accessed through handles (e.g. client.vng, client.vbase).
-	Bound service clients are created via .connect(...)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dodil-0.0.8.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dodil-0.0.8-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

Details for the file dodil-0.0.8.tar.gz.

File metadata

  • Download URL: dodil-0.0.8.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.0 CPython/3.14.2 Darwin/25.2.0

File hashes

Hashes for dodil-0.0.8.tar.gz
Algorithm Hash digest
SHA256 1e32cf2b3503795dd1705534845e67748a4cc41d37f7d12332da0020d775c007
MD5 673f5bc2cafb6c482c17968c5523f52e
BLAKE2b-256 2f1805d47f9f2b827cf85cbf46a92c7eb92f08ddc5bf93b1be2a54b1fdea10c9

See more details on using hashes here.

File details

Details for the file dodil-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: dodil-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 37.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.0 CPython/3.14.2 Darwin/25.2.0

File hashes

Hashes for dodil-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1d8227a752493918da2c3f52c11e5d1784c09dfbe670ec32f18991af12638142
MD5 a3bceb8d9ef7e71446c7879ec11bfb37
BLAKE2b-256 a056f1b07729e958b9ecc46d3a806791dfeda50270ebba576090b2e67c07e8f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page