FlowerPower 0.9.12.4__py3-none-any.whl → 1.0.0b1__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.
- flowerpower/__init__.py +17 -2
- flowerpower/cfg/__init__.py +201 -149
- flowerpower/cfg/base.py +122 -24
- flowerpower/cfg/pipeline/__init__.py +254 -0
- flowerpower/cfg/pipeline/adapter.py +66 -0
- flowerpower/cfg/pipeline/run.py +40 -11
- flowerpower/cfg/pipeline/schedule.py +69 -79
- flowerpower/cfg/project/__init__.py +149 -0
- flowerpower/cfg/project/adapter.py +57 -0
- flowerpower/cfg/project/job_queue.py +165 -0
- flowerpower/cli/__init__.py +92 -35
- flowerpower/cli/job_queue.py +878 -0
- flowerpower/cli/mqtt.py +49 -4
- flowerpower/cli/pipeline.py +576 -381
- flowerpower/cli/utils.py +55 -0
- flowerpower/flowerpower.py +12 -7
- flowerpower/fs/__init__.py +20 -2
- flowerpower/fs/base.py +350 -26
- flowerpower/fs/ext.py +797 -216
- flowerpower/fs/storage_options.py +1097 -55
- flowerpower/io/base.py +13 -18
- flowerpower/io/loader/__init__.py +28 -0
- flowerpower/io/loader/deltatable.py +7 -10
- flowerpower/io/metadata.py +1 -0
- flowerpower/io/saver/__init__.py +28 -0
- flowerpower/io/saver/deltatable.py +4 -3
- flowerpower/job_queue/__init__.py +252 -0
- flowerpower/job_queue/apscheduler/__init__.py +11 -0
- flowerpower/job_queue/apscheduler/_setup/datastore.py +110 -0
- flowerpower/job_queue/apscheduler/_setup/eventbroker.py +93 -0
- flowerpower/job_queue/apscheduler/manager.py +1063 -0
- flowerpower/job_queue/apscheduler/setup.py +524 -0
- flowerpower/job_queue/apscheduler/trigger.py +169 -0
- flowerpower/job_queue/apscheduler/utils.py +309 -0
- flowerpower/job_queue/base.py +382 -0
- flowerpower/job_queue/rq/__init__.py +10 -0
- flowerpower/job_queue/rq/_trigger.py +37 -0
- flowerpower/job_queue/rq/concurrent_workers/gevent_worker.py +226 -0
- flowerpower/job_queue/rq/concurrent_workers/thread_worker.py +231 -0
- flowerpower/job_queue/rq/manager.py +1449 -0
- flowerpower/job_queue/rq/setup.py +150 -0
- flowerpower/job_queue/rq/utils.py +69 -0
- flowerpower/pipeline/__init__.py +5 -0
- flowerpower/pipeline/base.py +118 -0
- flowerpower/pipeline/io.py +407 -0
- flowerpower/pipeline/job_queue.py +505 -0
- flowerpower/pipeline/manager.py +1586 -0
- flowerpower/pipeline/registry.py +560 -0
- flowerpower/pipeline/runner.py +560 -0
- flowerpower/pipeline/visualizer.py +142 -0
- flowerpower/plugins/mqtt/__init__.py +12 -0
- flowerpower/plugins/mqtt/cfg.py +16 -0
- flowerpower/plugins/mqtt/manager.py +789 -0
- flowerpower/settings.py +110 -0
- flowerpower/utils/logging.py +21 -0
- flowerpower/utils/misc.py +57 -9
- flowerpower/utils/sql.py +122 -24
- flowerpower/utils/templates.py +18 -142
- flowerpower/web/app.py +0 -0
- flowerpower-1.0.0b1.dist-info/METADATA +324 -0
- flowerpower-1.0.0b1.dist-info/RECORD +94 -0
- {flowerpower-0.9.12.4.dist-info → flowerpower-1.0.0b1.dist-info}/WHEEL +1 -1
- flowerpower/cfg/pipeline/tracker.py +0 -14
- flowerpower/cfg/project/open_telemetry.py +0 -8
- flowerpower/cfg/project/tracker.py +0 -11
- flowerpower/cfg/project/worker.py +0 -19
- flowerpower/cli/scheduler.py +0 -309
- flowerpower/event_handler.py +0 -23
- flowerpower/mqtt.py +0 -525
- flowerpower/pipeline.py +0 -2419
- flowerpower/scheduler.py +0 -680
- flowerpower/tui.py +0 -79
- flowerpower/utils/datastore.py +0 -186
- flowerpower/utils/eventbroker.py +0 -127
- flowerpower/utils/executor.py +0 -58
- flowerpower/utils/trigger.py +0 -140
- flowerpower-0.9.12.4.dist-info/METADATA +0 -575
- flowerpower-0.9.12.4.dist-info/RECORD +0 -70
- /flowerpower/{cfg/pipeline/params.py → cli/worker.py} +0 -0
- {flowerpower-0.9.12.4.dist-info → flowerpower-1.0.0b1.dist-info}/entry_points.txt +0 -0
- {flowerpower-0.9.12.4.dist-info → flowerpower-1.0.0b1.dist-info}/top_level.txt +0 -0
flowerpower/cli/scheduler.py
DELETED
@@ -1,309 +0,0 @@
|
|
1
|
-
import typer
|
2
|
-
|
3
|
-
from ..scheduler import SchedulerManager # Adjust import as needed
|
4
|
-
from .utils import \
|
5
|
-
parse_dict_or_list_param # Assuming you have this utility function
|
6
|
-
|
7
|
-
# Create a Typer app for scheduler commands
|
8
|
-
app = typer.Typer(help="Scheduler management commands")
|
9
|
-
|
10
|
-
|
11
|
-
@app.command()
|
12
|
-
def start_worker(
|
13
|
-
name: str | None = None,
|
14
|
-
base_dir: str | None = None,
|
15
|
-
background: bool = False,
|
16
|
-
storage_options: str | None = None,
|
17
|
-
):
|
18
|
-
"""
|
19
|
-
Start a scheduler worker.
|
20
|
-
|
21
|
-
Args:
|
22
|
-
name: Name of the scheduler
|
23
|
-
base_dir: Base directory for the scheduler
|
24
|
-
background: Run in background
|
25
|
-
storage_options: Storage options as JSON or key=value pairs
|
26
|
-
"""
|
27
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
28
|
-
|
29
|
-
with SchedulerManager(
|
30
|
-
name, base_dir, storage_options=parsed_storage_options
|
31
|
-
) as manager:
|
32
|
-
manager.start_worker(background=background)
|
33
|
-
|
34
|
-
|
35
|
-
@app.command()
|
36
|
-
def remove_all_schedules(
|
37
|
-
name: str | None = None,
|
38
|
-
base_dir: str | None = None,
|
39
|
-
storage_options: str | None = None,
|
40
|
-
):
|
41
|
-
"""
|
42
|
-
Remove all schedules from the scheduler.
|
43
|
-
|
44
|
-
Args:
|
45
|
-
name: Name of the scheduler
|
46
|
-
base_dir: Base directory for the scheduler
|
47
|
-
storage_options: Storage options as JSON or key=value pairs
|
48
|
-
"""
|
49
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
50
|
-
|
51
|
-
with SchedulerManager(
|
52
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
53
|
-
) as manager:
|
54
|
-
manager.remove_all_schedules()
|
55
|
-
|
56
|
-
|
57
|
-
# @app.command()
|
58
|
-
# def add_schedule(
|
59
|
-
# name: str | None = None,
|
60
|
-
# base_dir: str | None = None,
|
61
|
-
# storage_options: str | None = None,
|
62
|
-
# trigger_type: str = "cron",
|
63
|
-
# **kwargs,
|
64
|
-
# ) -> str:
|
65
|
-
# """
|
66
|
-
# Add a schedule to the scheduler.
|
67
|
-
|
68
|
-
# Args:
|
69
|
-
# name: Name of the scheduler
|
70
|
-
# base_dir: Base directory for the scheduler
|
71
|
-
# storage_options: Storage options as JSON or key=value pairs
|
72
|
-
# trigger_type: Type of trigger (cron, interval, etc.)
|
73
|
-
# **kwargs: Additional schedule parameters
|
74
|
-
# """
|
75
|
-
# parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
76
|
-
|
77
|
-
# with SchedulerManager(name, base_dir, role="scheduler") as manager:
|
78
|
-
# schedule_id = manager.add_schedule(
|
79
|
-
# storage_options=parsed_storage_options, type=trigger_type, **kwargs
|
80
|
-
# )
|
81
|
-
|
82
|
-
# typer.echo(f"Schedule added with ID: {schedule_id}")
|
83
|
-
# return schedule_id
|
84
|
-
|
85
|
-
|
86
|
-
# @app.command()
|
87
|
-
# def add_job(
|
88
|
-
# name: str | None = None,
|
89
|
-
# base_dir: str | None = None,
|
90
|
-
# storage_options: str | None = None,
|
91
|
-
# **kwargs,
|
92
|
-
# ) -> str:
|
93
|
-
# """
|
94
|
-
# Add a job to the scheduler.
|
95
|
-
|
96
|
-
# Args:
|
97
|
-
# name: Name of the scheduler
|
98
|
-
# base_dir: Base directory for the scheduler
|
99
|
-
# storage_options: Storage options as JSON or key=value pairs
|
100
|
-
# **kwargs: Job parameters
|
101
|
-
# """
|
102
|
-
# parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
103
|
-
|
104
|
-
# with SchedulerManager(name, base_dir, role="scheduler") as manager:
|
105
|
-
# job_id = manager.add_job(storage_options=parsed_storage_options, **kwargs)
|
106
|
-
|
107
|
-
# typer.echo(f"Job added with ID: {job_id}")
|
108
|
-
# return str(job_id)
|
109
|
-
|
110
|
-
|
111
|
-
# @app.command()
|
112
|
-
# def run_job(
|
113
|
-
# name: str | None = None,
|
114
|
-
# base_dir: str | None = None,
|
115
|
-
# storage_options: str | None = None,
|
116
|
-
# **kwargs,
|
117
|
-
# ):
|
118
|
-
# """
|
119
|
-
# Run a job and return its result.
|
120
|
-
|
121
|
-
# Args:
|
122
|
-
# name: Name of the scheduler
|
123
|
-
# base_dir: Base directory for the scheduler
|
124
|
-
# storage_options: Storage options as JSON or key=value pairs
|
125
|
-
# **kwargs: Job parameters
|
126
|
-
# """
|
127
|
-
# parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
128
|
-
|
129
|
-
# with SchedulerManager(name, base_dir, role="scheduler") as manager:
|
130
|
-
# result = manager.run_job(storage_options=parsed_storage_options, **kwargs)
|
131
|
-
|
132
|
-
# typer.echo("Job result:")
|
133
|
-
# typer.echo(result)
|
134
|
-
# return result
|
135
|
-
|
136
|
-
|
137
|
-
@app.command()
|
138
|
-
def get_schedules(
|
139
|
-
name: str | None = None,
|
140
|
-
base_dir: str | None = None,
|
141
|
-
storage_options: str | None = None,
|
142
|
-
):
|
143
|
-
"""
|
144
|
-
Get all schedules from the scheduler.
|
145
|
-
|
146
|
-
Args:
|
147
|
-
name: Name of the scheduler
|
148
|
-
base_dir: Base directory for the scheduler
|
149
|
-
storage_options: Storage options as JSON or key=value pairs
|
150
|
-
"""
|
151
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
152
|
-
|
153
|
-
with SchedulerManager(
|
154
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
155
|
-
) as manager:
|
156
|
-
schedules = manager.get_schedules()
|
157
|
-
|
158
|
-
typer.echo("Schedules:")
|
159
|
-
for schedule in schedules:
|
160
|
-
typer.echo(schedule)
|
161
|
-
return schedules
|
162
|
-
|
163
|
-
|
164
|
-
@app.command()
|
165
|
-
def get_tasks(
|
166
|
-
name: str | None = None,
|
167
|
-
base_dir: str | None = None,
|
168
|
-
storage_options: str | None = None,
|
169
|
-
):
|
170
|
-
"""
|
171
|
-
Get all tasks from the scheduler.
|
172
|
-
|
173
|
-
Args:
|
174
|
-
name: Name of the scheduler
|
175
|
-
base_dir: Base directory for the scheduler
|
176
|
-
storage_options: Storage options as JSON or key=value pairs
|
177
|
-
"""
|
178
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
179
|
-
|
180
|
-
with SchedulerManager(
|
181
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
182
|
-
) as manager:
|
183
|
-
tasks = manager.get_tasks()
|
184
|
-
|
185
|
-
typer.echo("Tasks:")
|
186
|
-
for task in tasks:
|
187
|
-
typer.echo(task)
|
188
|
-
return tasks
|
189
|
-
|
190
|
-
|
191
|
-
@app.command()
|
192
|
-
def get_jobs(
|
193
|
-
name: str | None = None,
|
194
|
-
base_dir: str | None = None,
|
195
|
-
storage_options: str | None = None,
|
196
|
-
):
|
197
|
-
"""
|
198
|
-
Get all jobs from the scheduler.
|
199
|
-
|
200
|
-
Args:
|
201
|
-
name: Name of the scheduler
|
202
|
-
base_dir: Base directory for the scheduler
|
203
|
-
storage_options: Storage options as JSON or key=value pairs
|
204
|
-
"""
|
205
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
206
|
-
|
207
|
-
with SchedulerManager(
|
208
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
209
|
-
) as manager:
|
210
|
-
jobs = manager.get_jobs()
|
211
|
-
|
212
|
-
typer.echo("Jobs:")
|
213
|
-
for job in jobs:
|
214
|
-
typer.echo(job)
|
215
|
-
return jobs
|
216
|
-
|
217
|
-
|
218
|
-
@app.command()
|
219
|
-
def get_job_result(
|
220
|
-
job_id: str,
|
221
|
-
name: str | None = None,
|
222
|
-
base_dir: str | None = None,
|
223
|
-
storage_options: str | None = None,
|
224
|
-
):
|
225
|
-
"""
|
226
|
-
Get the result of a specific job.
|
227
|
-
|
228
|
-
Args:
|
229
|
-
job_id: ID of the job
|
230
|
-
name: Name of the scheduler
|
231
|
-
base_dir: Base directory for the scheduler
|
232
|
-
storage_options: Storage options as JSON or key=value pairs
|
233
|
-
"""
|
234
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
235
|
-
|
236
|
-
with SchedulerManager(
|
237
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
238
|
-
) as manager:
|
239
|
-
result = manager.get_job_result(job_id)
|
240
|
-
|
241
|
-
typer.echo("Job Result:")
|
242
|
-
typer.echo(result)
|
243
|
-
return result
|
244
|
-
|
245
|
-
|
246
|
-
@app.command()
|
247
|
-
def show_schedules(
|
248
|
-
name: str | None = None,
|
249
|
-
base_dir: str | None = None,
|
250
|
-
storage_options: str | None = None,
|
251
|
-
):
|
252
|
-
"""
|
253
|
-
Show all schedules in the scheduler.
|
254
|
-
|
255
|
-
Args:
|
256
|
-
name: Name of the scheduler
|
257
|
-
base_dir: Base directory for the scheduler
|
258
|
-
storage_options: Storage options as JSON or key=value pairs
|
259
|
-
"""
|
260
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
261
|
-
|
262
|
-
with SchedulerManager(
|
263
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
264
|
-
) as manager:
|
265
|
-
manager.show_schedules()
|
266
|
-
|
267
|
-
|
268
|
-
@app.command()
|
269
|
-
def show_jobs(
|
270
|
-
name: str | None = None,
|
271
|
-
base_dir: str | None = None,
|
272
|
-
storage_options: str | None = None,
|
273
|
-
):
|
274
|
-
"""
|
275
|
-
Show all jobs in the scheduler.
|
276
|
-
|
277
|
-
Args:
|
278
|
-
name: Name of the scheduler
|
279
|
-
base_dir: Base directory for the scheduler
|
280
|
-
storage_options: Storage options as JSON or key=value pairs
|
281
|
-
"""
|
282
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
283
|
-
|
284
|
-
with SchedulerManager(
|
285
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
286
|
-
) as manager:
|
287
|
-
manager.show_jobs()
|
288
|
-
|
289
|
-
|
290
|
-
@app.command()
|
291
|
-
def show_tasks(
|
292
|
-
name: str | None = None,
|
293
|
-
base_dir: str | None = None,
|
294
|
-
storage_options: str | None = None,
|
295
|
-
):
|
296
|
-
"""
|
297
|
-
Show all tasks in the scheduler.
|
298
|
-
|
299
|
-
Args:
|
300
|
-
name: Name of the scheduler
|
301
|
-
base_dir: Base directory for the scheduler
|
302
|
-
storage_options: Storage options as JSON or key=value pairs
|
303
|
-
"""
|
304
|
-
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict") or {}
|
305
|
-
|
306
|
-
with SchedulerManager(
|
307
|
-
name, base_dir, role="scheduler", storage_options=parsed_storage_options
|
308
|
-
) as manager:
|
309
|
-
manager.show_tasks()
|
flowerpower/event_handler.py
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# from apscheduler import (
|
2
|
-
# Event,
|
3
|
-
# JobAcquired,
|
4
|
-
# JobAdded,
|
5
|
-
# JobRemoved,
|
6
|
-
# JobDeserializationFailed,
|
7
|
-
# ScheduleAdded,
|
8
|
-
# ScheduleDeserializationFailed,
|
9
|
-
# ScheduleRemoved,
|
10
|
-
# SchedulerStopped,
|
11
|
-
# SchedulerStarted,
|
12
|
-
# ScheduleUpdated,
|
13
|
-
# TaskAdded,
|
14
|
-
# TaskRemoved,
|
15
|
-
# TaskUpdated,
|
16
|
-
# )
|
17
|
-
# from loguru import logger
|
18
|
-
|
19
|
-
# def job_added(event: Event):
|
20
|
-
# logger.info(event.timestamp)
|
21
|
-
# logger.info(event.job_id)
|
22
|
-
# logger.info(event.task_id)
|
23
|
-
# logger.info(event.schedule_id)
|