Python SDK Reference

The loxtep Python package provides synchronous and asynchronous clients for the Loxtep APIs. Its control-plane namespaces match the TypeScript SDK.

Client signature

Use the workspace factory for local projects or the constructor for explicit service configuration.

client = LoxtepClient.from_workspace(options=None)
explicit = LoxtepClient(**options)

Parameters

ParameterTypeDescription
api_urlstrPlatform API base URL for explicit configuration.
authdict[str, str]JWT or supported authentication configuration.
organization_idstr | NoneOptional organization scope.
project_idstr | NoneOptional project scope.
instance_idstr | NoneOptional runtime instance scope.

Returns

Both forms return a configured LoxtepClient; use AsyncLoxtepClient for awaitable control-plane calls.

Example usage loads the current workspace and its user.

client = LoxtepClient.from_workspace()
user = client.session.get_current_user()

Install

Install the base Python package with pip.

pip install loxtep

Install native stream support when your application reads or writes the rStreams data plane directly:

pip install 'loxtep[streams]'

Initialize a client

After the Node CLI has run loxtep login, loxtep init, and loxtep attach, use this workspace-aware initialization.

from loxtep import LoxtepClient

client = LoxtepClient.from_workspace()
user = client.session.get_current_user()

For a service, use explicit client configuration.

import os
from loxtep import LoxtepClient

client = LoxtepClient(
    api_url=os.environ["LOXTEP_API_URL"],
    auth={
        "type": "jwt",
        "token": os.environ["LOXTEP_AUTH_TOKEN"],
    },
    organization_id=os.environ.get("LOXTEP_ORGANIZATION_ID"),
    project_id=os.environ.get("LOXTEP_PROJECT_ID"),
    instance_id=os.environ.get("LOXTEP_INSTANCE_ID"),
)

Namespace map

Customer areaPython namespacePrimary resources
Orientationclient.sessionCurrent user and organization
Connectclient.connectConnectors and templates
Productsclient.workspaceProjects, instances, deployments
Productsclient.buildWorkflows, triggers, data products, targets
Meaning / Orgclient.defineShapes, schemas, quality, contracts, domains
Meaningclient.meaningVocabulary, ontology, proposals, packages
Inboxclient.reviewApprovals, improvements, context review
Useclient.queryCatalog, discovery, analytics
Observeclient.observeRuntime status, queues, deployments
Meaning / Useclient.contextProcedures, process intelligence, agent work

The hosted MCP Apps tool loxtep_package_review is not an additional Python namespace.

Products and Connect

Access projects, products, workflows, and connectors through their namespaces.

projects = client.workspace.projects.list()
products = client.build.data_products.list()
product = client.build.data_products.get("<data-product-id>")
workflows = client.build.workflows.list(project_id="<project-id>")

connectors = client.connect.connectors.list()
connector = client.connect.connectors.get("<connector-id>")

Do not use removed flat control-plane paths such as client.workflows, client.schemas, or client.targets. Use their job-aligned namespace.

Meaning and Inbox

Use Meaning, client.define, and Review namespaces for semantic work and decisions. The define namespace is a stable SDK identifier; customer navigation calls that area Meaning.

terms = client.meaning.thesaurus.list_terms()
concepts = client.meaning.ontology.list_concepts()
shapes = client.define.shapes.list()

pending = client.review.approvals.list_pending()
client.review.approvals.approve("<approval-id>")

Use the installed package's type hints and generated API documentation as the signature authority for a specific release.

Query governed data

Search the catalog and query a product through its governed product API.

hits = client.query.catalog.search("orders")
rows = client.build.data_products.query(
    "<data-product-id>",
    "SELECT * FROM t LIMIT 10",
)

Write and read events

Use the top-level reader and writer resolvers for application event I/O.

writer = client.get_writer("orders", transport_mode="default")
writer.write({"order_id": "ord-1", "status": "placed"})
writer.close()

reader = client.get_reader("orders")
for event in reader:
    print(event)

Choose default for durable, balanced writes (recommended). fast minimizes latency but may cost more. volume is optimized for sustained throughput and has delivery lag. Omitting transport_mode selects default.

Stream and replay are available through the product API:

for event in client.build.data_products.replay(
    "<data-product-id>",
    start="2026-10-01T00:00:00Z",
    end="2026-10-02T00:00:00Z",
):
    print(event)

Async client

Use the async client when the application already runs an event loop.

import asyncio
import os
from loxtep import AsyncLoxtepClient

async def main():
    async with AsyncLoxtepClient(
        api_url=os.environ["LOXTEP_API_URL"],
        auth={"type": "jwt", "token": os.environ["LOXTEP_AUTH_TOKEN"]},
    ) as client:
        products = await client.build.data_products.list()
        print(products)

asyncio.run(main())

Keep tokens outside source control. Use short-lived, scoped credentials for automation.