Usage

from databridge.sync import DataBridge

# Without authentication
db = DataBridge()

# With authentication
db = DataBridge("databridge://owner_id:token@api.databridge.ai")

Constructor

Both clients share the same constructor parameters:

DataBridge(uri: Optional[str] = None, timeout: int = 30, is_local: bool = False)

Parameters

  • uri (str, optional): DataBridge URI in format “databridge://<owner_id>:<token>@<host>”. If not provided, connects to http://localhost:8000 without authentication.
  • timeout (int, optional): Request timeout in seconds. Defaults to 30.
  • is_local (bool, optional): Whether connecting to local development server. Defaults to False.

Methods

DataBridge provides the following methods. Each method page includes both synchronous and asynchronous versions.

Document Operations

Knowledge Graph Operations

Cache Operations

Client Management

Context Manager

Using the DataBridge client as a context manager ensures that resources are properly closed when the context exits.

with DataBridge() as db:
    doc = db.ingest_text("Sample content")