Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AI Northstar Tech Vector io ExportWeaviate

From Leeroopedia
Knowledge Sources
Domains Export, Vector_Database, Weaviate
Last Updated 2026-10-15 00:00 GMT

Overview

Concrete tool for exporting vector data from Weaviate Cloud Services to the VDF format, provided by the vector-io library.

Description

The ExportWeaviate class is a concrete subclass of ExportVDB that implements vector data export from a Weaviate Cloud Services (WCS) instance. It connects via the official weaviate Python client using connect_to_wcs with API key authentication.

The export flow accepts a WCS URL and API key, lists all collection classes available on the instance, and allows the user to select which classes to export. The get_data method iterates selected classes and aggregates total object counts.

Note: This implementation is incomplete. The get_data method only computes object counts via aggregate.over_atotal — it does not fetch actual objects, save parquet files, or write VDF_META.json. It is listed as "In Progress" in the README.

Usage

Import this class when you need to export vector data from a Weaviate Cloud Services instance to the VDF format. The class is auto-registered as the weaviate subcommand of the export_vdf CLI via DB_NAME_SLUG = DBNames.WEAVIATE.

Code Reference

Source Location

Signature

class ExportWeaviate(ExportVDB):
    DB_NAME_SLUG = DBNames.WEAVIATE

    @classmethod
    def make_parser(cls, subparsers):
        """Register CLI subparser with Weaviate-specific arguments:
        --url, --api_key, --classes
        """

    @classmethod
    def export_vdb(cls, args: dict) -> "ExportWeaviate":
        """Factory classmethod: collect URL/API key, list classes, run get_data()."""

    def __init__(self, args: dict):
        """Initialize and connect to WCS via weaviate.connect_to_wcs()."""

    def get_index_names(self) -> List[str]:
        """Return user-selected classes, or all classes if none specified."""

    def get_data(self):
        """Iterate class names, aggregate total object counts per class."""

Import

from vdf_io.export_vdf.weaviate_export import ExportWeaviate

I/O Contract

Inputs

Name Type Required Description
args dict Yes CLI argument dict
args.url str Yes Weaviate Cloud Services instance URL
args.api_key str Yes Weaviate API key (collected via env WEAVIATE_API_KEY or prompt)
args.classes str No Comma-separated class names to export (all if not specified)

Outputs

Name Type Description
ExportWeaviate instance ExportWeaviate Returned by export_vdb() for metadata extraction
all_classes List[str] All collection class names on the instance
total_count int Total object count per class (printed)

Usage Examples

Programmatic Export

from vdf_io.export_vdf.weaviate_export import ExportWeaviate

# 1. Prepare arguments
args = {
    "url": "https://my-instance.weaviate.network",
    "api_key": "my_weaviate_api_key",
    "model_name": "text-embedding-ada-002",
}

# 2. Run the export (connects to WCS, lists classes, fetches counts)
weaviate_export = ExportWeaviate.export_vdb(args)

# 3. Access available classes
print(weaviate_export.all_classes)

Selecting Specific Classes

from vdf_io.export_vdf.weaviate_export import ExportWeaviate

# 1. Prepare arguments with specific classes
args = {
    "url": "https://my-instance.weaviate.network",
    "api_key": "my_weaviate_api_key",
    "classes": "Article,Author",
    "model_name": "text-embedding-ada-002",
}

# 2. Run the export for selected classes only
weaviate_export = ExportWeaviate.export_vdb(args)

Related Pages

Implements Principle

Requires Environment

Related Implementations

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment