The feldera python client
Project description
Feldera Python SDK
The feldera Python package is the Python client for the Feldera HTTP API.
The Python SDK documentation is available at: https://docs.feldera.com/python
Getting started
Installation
uv pip install feldera
Example usage
The Python client interacts with the API server of the Feldera instance.
# File: example.py
from feldera import FelderaClient, PipelineBuilder, Pipeline
# Instantiate client
client = FelderaClient() # Default: http://localhost:8080 without authentication
# client = FelderaClient(url="https://localhost:8080", api_key="apikey:...", requests_verify="/path/to/tls.crt")
# (Re)create pipeline
name = "example"
sql = """
CREATE TABLE t1 (i1 INT) WITH ('materialized' = 'true');
CREATE MATERIALIZED VIEW v1 AS SELECT * FROM t1;
"""
print("(Re)creating pipeline...")
pipeline = PipelineBuilder(client, name, sql).create_or_replace()
pipeline.start()
print(f"Pipeline status: {pipeline.status()}")
pipeline.pause()
print(f"Pipeline status: {pipeline.status()}")
pipeline.stop(force=True)
# Find existing pipeline
pipeline = Pipeline.get(name, client)
pipeline.start()
print(f"Pipeline status: {pipeline.status()}")
pipeline.stop(force=True)
pipeline.clear_storage()
Run using:
uv run python example.py
Environment variables
Some default parameter values in the Python SDK can be overridden via environment variables.
Environment variables for FelderaClient(...)
export FELDERA_HOST="https://localhost:8080" # Overrides default for `url`
export FELDERA_API_KEY="apikey:..." # Overrides default for `api_key`
# The following together override default for `requests_verify`
# export FELDERA_TLS_INSECURE="false" # If set to "1", "true" or "yes" (all case-insensitive), disables TLS certificate verification
# export FELDERA_HTTPS_TLS_CERT="/path/to/tls.crt" # Custom TLS certificate
Environment variables for PipelineBuilder(...)
export FELDERA_RUNTIME_VERSION="..." # Overrides default for `runtime_version`
Development
Development assumes you have cloned the Feldera code repository.
Installation
cd python
# Optional: create and activate virtual environment if you don't have one
uv venv
source .venv/bin/activate
# Install in editable mode
uv pip install -e .
Formatting
Formatting requires the ruff package: uv pip install ruff
cd python
ruff check
ruff format
Tests
Running the test requires the pytest package: uv pip install pytest
# All tests
cd python
uv run python -m pytest tests/
# Specific tests directory
uv run python -m pytest tests/platform/
# Specific test file
uv run python -m pytest tests/platform/test_pipeline_crud.py
# Tip: add argument -x at the end for it to fail fast
For further information about the tests, please see tests/README.md.
Documentation
Building documentation requires the sphinx package: uv pip install sphinx
cd python/docs
sphinx-apidoc -o . ../feldera
make html
make clean # Cleanup afterwards
Installation from GitHub
Latest main branch:
uv pip install git+https://github.com/feldera/feldera#subdirectory=python
Different branch (replace BRANCH_NAME):
uv pip install git+https://github.com/feldera/feldera@BRANCH_NAME#subdirectory=python
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file feldera-0.229.0.tar.gz.
File metadata
- Download URL: feldera-0.229.0.tar.gz
- Upload date:
- Size: 45.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e1d9eeb443757e7819ffea6c5eff94f96c0290cfc5efd907a45c1b1aa6b69b4
|
|
| MD5 |
94388bcaa86b7f0c23c3202c7eb97a9b
|
|
| BLAKE2b-256 |
a39646a4b51efd4388ad171f42c806caff80157d0a450b2f466cd053e6346906
|
Provenance
The following attestation bundles were made for feldera-0.229.0.tar.gz:
Publisher:
ci-post-release.yml on feldera/feldera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
feldera-0.229.0.tar.gz -
Subject digest:
5e1d9eeb443757e7819ffea6c5eff94f96c0290cfc5efd907a45c1b1aa6b69b4 - Sigstore transparency entry: 855225699
- Sigstore integration time:
-
Permalink:
feldera/feldera@d78eda6430c65dba1a44d01604d7b6296552270f -
Branch / Tag:
refs/tags/v0.229.0 - Owner: https://github.com/feldera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-post-release.yml@d78eda6430c65dba1a44d01604d7b6296552270f -
Trigger Event:
release
-
Statement type:
File details
Details for the file feldera-0.229.0-py3-none-any.whl.
File metadata
- Download URL: feldera-0.229.0-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26717303aaa33cb08a5f2f0a372c3b086d6b7fab8dbf8438e71506ce7a0a32e0
|
|
| MD5 |
db983001065895c1181d718128c2d0c1
|
|
| BLAKE2b-256 |
2662d502bc42e4fd82dab28c573cdf85690ebfe3e04b1e2e1f7d030d4ce4769f
|
Provenance
The following attestation bundles were made for feldera-0.229.0-py3-none-any.whl:
Publisher:
ci-post-release.yml on feldera/feldera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
feldera-0.229.0-py3-none-any.whl -
Subject digest:
26717303aaa33cb08a5f2f0a372c3b086d6b7fab8dbf8438e71506ce7a0a32e0 - Sigstore transparency entry: 855225707
- Sigstore integration time:
-
Permalink:
feldera/feldera@d78eda6430c65dba1a44d01604d7b6296552270f -
Branch / Tag:
refs/tags/v0.229.0 - Owner: https://github.com/feldera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-post-release.yml@d78eda6430c65dba1a44d01604d7b6296552270f -
Trigger Event:
release
-
Statement type: