FlowerPower 1.0.0b1__py3-none-any.whl → 1.0.0b3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. flowerpower/__init__.py +2 -3
  2. flowerpower/cfg/__init__.py +10 -8
  3. flowerpower/cfg/pipeline/__init__.py +11 -7
  4. flowerpower/cfg/project/__init__.py +11 -8
  5. flowerpower/cfg/project/job_queue.py +10 -29
  6. flowerpower/cli/__init__.py +62 -28
  7. flowerpower/cli/job_queue.py +306 -123
  8. flowerpower/cli/mqtt.py +22 -16
  9. flowerpower/cli/pipeline.py +294 -114
  10. flowerpower/flowerpower.py +14 -8
  11. flowerpower/fs/__init__.py +7 -3
  12. flowerpower/fs/ext.py +6 -2
  13. flowerpower/io/base.py +17 -10
  14. flowerpower/io/loader/_duckdb.py +1 -0
  15. flowerpower/io/loader/deltatable.py +6 -2
  16. flowerpower/io/saver/deltatable.py +1 -2
  17. flowerpower/job_queue/__init__.py +16 -12
  18. flowerpower/job_queue/apscheduler/__init__.py +1 -1
  19. flowerpower/job_queue/apscheduler/manager.py +11 -6
  20. flowerpower/job_queue/apscheduler/utils.py +6 -4
  21. flowerpower/job_queue/base.py +1 -0
  22. flowerpower/job_queue/rq/__init__.py +1 -1
  23. flowerpower/job_queue/rq/manager.py +12 -3
  24. flowerpower/pipeline/io.py +11 -9
  25. flowerpower/pipeline/job_queue.py +5 -5
  26. flowerpower/pipeline/manager.py +35 -27
  27. flowerpower/pipeline/registry.py +26 -16
  28. flowerpower/pipeline/runner.py +3 -4
  29. flowerpower/plugins/mqtt/__init__.py +7 -7
  30. flowerpower/plugins/mqtt/cfg.py +3 -2
  31. flowerpower/plugins/mqtt/manager.py +25 -23
  32. flowerpower/utils/misc.py +6 -4
  33. flowerpower/utils/templates.py +1 -4
  34. {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/METADATA +1 -1
  35. {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/RECORD +38 -38
  36. {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/WHEEL +0 -0
  37. {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/entry_points.txt +0 -0
  38. {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/top_level.txt +0 -0
flowerpower/cli/mqtt.py CHANGED
@@ -1,11 +1,12 @@
1
- import typer
2
- import sys
3
- from ..plugins.mqtt import (
4
- start_listener as start_listener_,
5
- run_pipeline_on_message as run_pipeline_on_message_,
6
- )
7
- from .utils import parse_dict_or_list_param, load_hook
8
1
  import importlib
2
+ import sys
3
+
4
+ import typer
5
+
6
+ from ..plugins.mqtt import run_pipeline_on_message as run_pipeline_on_message_
7
+ from ..plugins.mqtt import start_listener as start_listener_
8
+ from .utils import load_hook, parse_dict_or_list_param
9
+
9
10
  app = typer.Typer(help="MQTT management commands")
10
11
 
11
12
 
@@ -78,13 +79,19 @@ def run_pipeline_on_message(
78
79
  client_id: str | None = None,
79
80
  client_id_suffix: str | None = None,
80
81
  config_hook: str | None = None,
81
- max_retries: int = typer.Option(3, help="Maximum number of retry attempts if pipeline execution fails"),
82
- retry_delay: float = typer.Option(1.0, help="Base delay between retries in seconds"),
83
- jitter_factor: float = typer.Option(0.1, help="Random factor (0-1) applied to delay for jitter"),
82
+ max_retries: int = typer.Option(
83
+ 3, help="Maximum number of retry attempts if pipeline execution fails"
84
+ ),
85
+ retry_delay: float = typer.Option(
86
+ 1.0, help="Base delay between retries in seconds"
87
+ ),
88
+ jitter_factor: float = typer.Option(
89
+ 0.1, help="Random factor (0-1) applied to delay for jitter"
90
+ ),
84
91
  ):
85
92
  """Run a pipeline on a message
86
93
 
87
- This command sets up an MQTT listener that executes a pipeline whenever a message is
94
+ This command sets up an MQTT listener that executes a pipeline whenever a message is
88
95
  received on the specified topic. The pipeline can be configured to retry on failure
89
96
  using exponential backoff with jitter for better resilience.
90
97
 
@@ -117,13 +124,13 @@ def run_pipeline_on_message(
117
124
  Examples:
118
125
  # Basic usage with a specific topic
119
126
  $ flowerpower mqtt run-pipeline-on-message my_pipeline --topic sensors/data
120
-
127
+
121
128
  # Configure retries for resilience
122
129
  $ flowerpower mqtt run-pipeline-on-message my_pipeline --topic sensors/data --max-retries 5 --retry-delay 2.0
123
-
130
+
124
131
  # Run as a job with custom MQTT settings
125
132
  $ flowerpower mqtt run-pipeline-on-message my_pipeline --topic events/process --as-job --qos 2 --host mqtt.example.com
126
-
133
+
127
134
  # Use a config hook to process messages
128
135
  $ flowerpower mqtt run-pipeline-on-message my_pipeline --topic data/incoming --config-hook process_message
129
136
 
@@ -136,10 +143,9 @@ def run_pipeline_on_message(
136
143
  parsed_storage_options = parse_dict_or_list_param(storage_options, "dict")
137
144
 
138
145
  config_hook_function = None
139
- if config_hook:
146
+ if config_hook:
140
147
  config_hook_function = load_hook(name, config_hook, base_dir, storage_options)
141
148
 
142
-
143
149
  run_pipeline_on_message_(
144
150
  name=name,
145
151
  topic=topic,