Skip to main content
filament-py is the generated Python client for Filament’s API. It ships a synchronous Filament client and an asynchronous AsyncFilament client with the same methods, and requires Python 3.10 or newer.

Installation

Install filament-py from PyPI:
For an existing virtual environment, use uv pip install filament-py.

Connect

This connects to a server with authentication disabled; see Authentication for a deployed server. Request timeouts are set with Filament(..., timeout=30), in seconds.

Authentication

When the server runs with an identity provider, the SDK authenticates as a service account. Create one on the Members page of the web app, or with filament.service_account.create(...) while signed in as an admin. Both return a client id and a client secret; the secret is shown once. Pass them to the client. It mints an access token through the server and mints again as the token nears expiry, so nothing about the identity provider reaches your code:
A token minted elsewhere still works as token. For a local server with authentication disabled, pass neither.

Create and run a pipeline

A connector is an available integration, such as sample or stdout. A connection is a configured instance you create using that connector. The workflow is:
  1. Create source and sink connections.
  2. Discover the source’s resources and select which ones to include.
  3. Create a pipeline and save its graph.
  4. Submit a run.
This example routes five rows from each selected sample resource to stdout. It requires a running Filament deployment with a working execution backend.
pipeline.create(...) creates the pipeline’s metadata and pipeline.version.create(...) saves its graph; the backend assigns the version. Both steps are required before the first run. The sample source discovers users and orders. To route every resource without enumerating them, save one edge with resource omitted. Submitting a run returns its id and initial status without waiting for completion. Inspect a run with filament.run.get(run_id=run_id), or open the pipeline in the web app. The stdout sink writes rows to the worker’s logs. The runnable version lives in examples/smoke.py.

Async usage

AsyncFilament exposes the same resource groups and methods.

API groups

The SDK covers unary API methods. Streaming TailRun is not included.

Responses and pagination

Methods return generated models. pipeline.create(...) returns a response whose pipeline property holds the created pipeline. Fields omitted by the server are None, including lists, so iterate with response.pipelines or []. Protobuf 64-bit integer fields, such as timestamps and record counts, can be decimal strings; use int(value) when needed. List methods paginate explicitly:
Pass next_cursor as IngestionV1PaginationRequest(cursor=next_cursor, page_size=25) to fetch the next page while a cursor is present. Omitting pagination returns the full result set.

Errors and retries

Automatic retries are disabled because mutations are not generally idempotent. For a read you want retried, pass request_options={"max_retries": 2} on the call.