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:uv pip install filament-py.
Connect
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 withfilament.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:
token. For a local server with
authentication disabled, pass neither.
Create and run a pipeline
A connector is an available integration, such assample or stdout. A
connection is a configured instance you create using that connector. The
workflow is:
- Create source and sink connections.
- Discover the source’s resources and select which ones to include.
- Create a pipeline and save its graph.
- Submit a run.
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:
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
request_options={"max_retries": 2} on the call.