Name | feldera JSON |
Version |
0.113.0
JSON |
| download |
home_page | None |
Summary | The feldera python client |
upload_time | 2025-07-26 07:36:36 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | MIT |
keywords |
feldera
python
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Feldera Python SDK
Feldera Python is the Feldera SDK for Python developers.
## Installation
```bash
pip install feldera
```
### Installing from Github
```bash
pip install git+https://github.com/feldera/feldera#subdirectory=python
```
Similarly, to install from a specific branch:
```bash
$ pip install git+https://github.com/feldera/feldera@{BRANCH_NAME}#subdirectory=python
```
Replace `{BRANCH_NAME}` with the name of the branch you want to install from.
### Installing from Local Directory
If you have cloned the Feldera repo, you can install the python SDK as follows:
```bash
# the Feldera Python SDK is present inside the python/ directory
pip install python/
```
## Documentation
The Python SDK documentation is available at
[Feldera Python SDK Docs](https://docs.feldera.com/python).
To build the html documentation run:
Ensure that you have sphinx installed. If not, install it using `pip install sphinx`.
Then run the following commands:
```bash
cd docs
sphinx-apidoc -o . ../feldera
make html
```
To clean the build, run `make clean`.
## Testing
To run unit tests:
```bash
cd python && python3 -m pytest tests/
```
- This will detect and run all test files that match the pattern `test_*.py` or
`*_test.py`.
- By default, the tests expect a running Feldera instance at `http://localhost:8080`.
To override the default endpoint, set the `FELDERA_BASE_URL` environment variable.
To run tests from a specific file:
```bash
(cd python && python3 -m pytest ./tests/path-to-file.py)
```
#### Running Tests
The tests validate end-to-end correctness of SQL functionality. To
run the tests use:
```bash
cd python
PYTHONPATH=`pwd` ./tests/run-all-tests.sh
```
### Reducing Compilation Cycles
To reduce redundant compilation cycles during testing:
* **Inherit from `SharedTestPipeline`** instead of `unittest.TestCase`.
* **Define DDLs** (e.g., `CREATE TABLE`, `CREATE VIEW`) in the **docstring** of each test method.
* All DDLs from all test functions in the class are combined and compiled into a single pipeline.
* If a table or view is already defined in one test, it can be used directly in others without redefinition.
* Ensure that all table and view names are unique within the class.
* Use `@enterprise_only` on tests that require Enterprise features. Their DDLs will be skipped on OSS builds.
* Use `self.set_runtime_config(...)` to override the default pipeline config.
* Reset it at the end using `self.reset_runtime_config()`.
* Access the shared pipeline via `self.pipeline`.
#### Example
```python
from tests.shared_test_pipeline import SharedTestPipeline
class TestAverage(SharedTestPipeline):
def test_average(self):
"""
CREATE TABLE students(id INT, name STRING);
CREATE MATERIALIZED VIEW v AS SELECT * FROM students;
"""
...
self.pipeline.start()
self.pipeline.input_pandas("students", df)
self.pipeline.wait_for_completion(True)
...
```
## Linting and formatting
Use [Ruff] to run the lint checks that will be executed by the
precommit hook when a PR is submitted:
```bash
ruff check python/
```
To reformat the code in the same way as the precommit hook:
```bash
ruff format
```
[Ruff]: https://github.com/astral-sh/ruff
Raw data
{
"_id": null,
"home_page": null,
"name": "feldera",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "feldera, python",
"author": null,
"author_email": "Feldera Team <dev@feldera.com>",
"download_url": "https://files.pythonhosted.org/packages/70/8f/9789c9dcf5f4a6e4cbfa11b3234e5ad9026d72c69885a12a1fbdc079269e/feldera-0.113.0.tar.gz",
"platform": null,
"description": "# Feldera Python SDK\n\nFeldera Python is the Feldera SDK for Python developers.\n\n## Installation\n\n```bash\npip install feldera\n```\n\n### Installing from Github\n\n```bash\npip install git+https://github.com/feldera/feldera#subdirectory=python\n```\n\nSimilarly, to install from a specific branch:\n\n```bash\n$ pip install git+https://github.com/feldera/feldera@{BRANCH_NAME}#subdirectory=python\n```\n\nReplace `{BRANCH_NAME}` with the name of the branch you want to install from.\n\n### Installing from Local Directory\n\nIf you have cloned the Feldera repo, you can install the python SDK as follows:\n\n```bash\n# the Feldera Python SDK is present inside the python/ directory\npip install python/\n```\n\n## Documentation\n\nThe Python SDK documentation is available at\n[Feldera Python SDK Docs](https://docs.feldera.com/python).\n\nTo build the html documentation run:\n\nEnsure that you have sphinx installed. If not, install it using `pip install sphinx`.\n\nThen run the following commands:\n\n```bash\ncd docs\nsphinx-apidoc -o . ../feldera\nmake html\n```\n\nTo clean the build, run `make clean`.\n\n## Testing\n\nTo run unit tests:\n\n```bash\ncd python && python3 -m pytest tests/\n```\n\n- This will detect and run all test files that match the pattern `test_*.py` or\n `*_test.py`.\n- By default, the tests expect a running Feldera instance at `http://localhost:8080`.\n To override the default endpoint, set the `FELDERA_BASE_URL` environment variable.\n\nTo run tests from a specific file:\n\n```bash\n(cd python && python3 -m pytest ./tests/path-to-file.py)\n```\n\n#### Running Tests\n\nThe tests validate end-to-end correctness of SQL functionality. To\nrun the tests use:\n\n```bash\ncd python\nPYTHONPATH=`pwd` ./tests/run-all-tests.sh\n```\n\n### Reducing Compilation Cycles\n\nTo reduce redundant compilation cycles during testing:\n\n* **Inherit from `SharedTestPipeline`** instead of `unittest.TestCase`.\n* **Define DDLs** (e.g., `CREATE TABLE`, `CREATE VIEW`) in the **docstring** of each test method.\n * All DDLs from all test functions in the class are combined and compiled into a single pipeline.\n * If a table or view is already defined in one test, it can be used directly in others without redefinition.\n * Ensure that all table and view names are unique within the class.\n* Use `@enterprise_only` on tests that require Enterprise features. Their DDLs will be skipped on OSS builds.\n* Use `self.set_runtime_config(...)` to override the default pipeline config.\n * Reset it at the end using `self.reset_runtime_config()`.\n* Access the shared pipeline via `self.pipeline`.\n\n#### Example\n\n```python\nfrom tests.shared_test_pipeline import SharedTestPipeline\n\nclass TestAverage(SharedTestPipeline):\n def test_average(self):\n \"\"\"\n CREATE TABLE students(id INT, name STRING);\n CREATE MATERIALIZED VIEW v AS SELECT * FROM students;\n \"\"\"\n ...\n self.pipeline.start()\n self.pipeline.input_pandas(\"students\", df)\n self.pipeline.wait_for_completion(True)\n ...\n```\n\n## Linting and formatting\n\nUse [Ruff] to run the lint checks that will be executed by the\nprecommit hook when a PR is submitted:\n\n```bash\nruff check python/\n```\n\nTo reformat the code in the same way as the precommit hook:\n\n```bash\nruff format\n```\n\n[Ruff]: https://github.com/astral-sh/ruff\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The feldera python client",
"version": "0.113.0",
"project_urls": {
"Documentation": "https://docs.feldera.com/python",
"Homepage": "https://www.feldera.com",
"Issues": "https://github.com/feldera/feldera/issues",
"Repository": "https://github.com/feldera/feldera"
},
"split_keywords": [
"feldera",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7769b309554c13f0899a1d04d3d3c8e9be9e04e2aa01749651234a701c00a2f8",
"md5": "4acd113dab779749e5021bbc48b299e8",
"sha256": "3dca2f92412db4710d876d82b5c388dd881ca5935ec08be1f7def8bed31b36b9"
},
"downloads": -1,
"filename": "feldera-0.113.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4acd113dab779749e5021bbc48b299e8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 32464,
"upload_time": "2025-07-26T07:36:34",
"upload_time_iso_8601": "2025-07-26T07:36:34.970695Z",
"url": "https://files.pythonhosted.org/packages/77/69/b309554c13f0899a1d04d3d3c8e9be9e04e2aa01749651234a701c00a2f8/feldera-0.113.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "708f9789c9dcf5f4a6e4cbfa11b3234e5ad9026d72c69885a12a1fbdc079269e",
"md5": "ebc1ac0b450bc117173219538ed415c9",
"sha256": "8e96cd70cf3d2109b0ad578fa848e2ace9eaea5c1e46233921bbb4ab2479b995"
},
"downloads": -1,
"filename": "feldera-0.113.0.tar.gz",
"has_sig": false,
"md5_digest": "ebc1ac0b450bc117173219538ed415c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 35178,
"upload_time": "2025-07-26T07:36:36",
"upload_time_iso_8601": "2025-07-26T07:36:36.369491Z",
"url": "https://files.pythonhosted.org/packages/70/8f/9789c9dcf5f4a6e4cbfa11b3234e5ad9026d72c69885a12a1fbdc079269e/feldera-0.113.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 07:36:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "feldera",
"github_project": "feldera",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "feldera"
}