ddeutil-workflow 0.0.25__py3-none-any.whl → 0.0.26__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.
@@ -1 +1 @@
1
- __version__: str = "0.0.25"
1
+ __version__: str = "0.0.26"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ddeutil-workflow
3
- Version: 0.0.25
3
+ Version: 0.0.26
4
4
  Summary: Lightweight workflow orchestration with less dependencies
5
5
  Author-email: ddeutils <korawich.anu@gmail.com>
6
6
  License: MIT
@@ -26,7 +26,6 @@ Requires-Dist: ddeutil>=0.4.3
26
26
  Requires-Dist: ddeutil-io[toml,yaml]>=0.2.3
27
27
  Requires-Dist: pydantic==2.10.4
28
28
  Requires-Dist: python-dotenv==1.0.1
29
- Requires-Dist: typer==0.15.1
30
29
  Requires-Dist: schedule<2.0.0,==1.2.2
31
30
  Provides-Extra: api
32
31
  Requires-Dist: fastapi<1.0.0,>=0.115.0; extra == "api"
@@ -80,20 +79,10 @@ This project need `ddeutil` and `ddeutil-io` extension namespace packages.
80
79
  If you want to install this package with application add-ons, you should add
81
80
  `app` in installation;
82
81
 
83
- | Usecase | Install Optional | Support |
84
- |-------------------|------------------------------------------|--------------------|
85
- | Python & CLI | `pip install ddeutil-workflow` | :heavy_check_mark: |
86
- | FastAPI Server | `pip install ddeutil-workflow[api]` | :heavy_check_mark: |
87
-
88
- > :egg: **Docker Images** supported:
89
- >
90
- > | Docker Image | Python Version | Support |
91
- > |-----------------------------|----------------|---------|
92
- > | ddeutil-workflow:latest | `3.9` | :x: |
93
- > | ddeutil-workflow:python3.10 | `3.10` | :x: |
94
- > | ddeutil-workflow:python3.11 | `3.11` | :x: |
95
- > | ddeutil-workflow:python3.12 | `3.12` | :x: |
96
- > | ddeutil-workflow:python3.12 | `3.13` | :x: |
82
+ | Usecase | Install Optional | Support |
83
+ |----------------|------------------------------------------|--------------------|
84
+ | Python | `pip install ddeutil-workflow` | :heavy_check_mark: |
85
+ | FastAPI Server | `pip install ddeutil-workflow[api]` | :heavy_check_mark: |
97
86
 
98
87
  ## :beers: Usage
99
88
 
@@ -215,12 +204,6 @@ This package able to run as a application service for receive manual trigger
215
204
  from the master node via RestAPI or use to be Scheduler background service
216
205
  like crontab job but via Python API.
217
206
 
218
- ### CLI
219
-
220
- ```shell
221
- (venv) $ ddeutil-workflow schedule
222
- ```
223
-
224
207
  ### API Server
225
208
 
226
209
  ```shell
@@ -1,8 +1,7 @@
1
- ddeutil/workflow/__about__.py,sha256=t4IIhCiioD7q4m2ksb5i3WtaGFGCRBYpETJrirYC7s8,28
1
+ ddeutil/workflow/__about__.py,sha256=YOPdjr7wsJbawVBpWp1ZSxpo-8M9kGnIdMF9N0v_4HM,28
2
2
  ddeutil/workflow/__cron.py,sha256=uA8XcbY_GwA9rJSHaHUaXaJyGDObJN0ZeYlJSinL8y8,26880
3
3
  ddeutil/workflow/__init__.py,sha256=49eGrCuchPVZKMybRouAviNhbulK_F6VwCmLm76hIss,1478
4
4
  ddeutil/workflow/__types.py,sha256=Ia7f38kvL3NibwmRKi0wQ1ud_45Z-SojYGhNJwIqcu8,3713
5
- ddeutil/workflow/cli.py,sha256=Ik14rFFxE9u20uOgCa4Vx7fNuKXVsWJg7gZb15sGans,2878
6
5
  ddeutil/workflow/conf.py,sha256=YY2zZ_qv9JkTDs_73bkyrF1n1cqBINuxzMxbBjzYw-8,15361
7
6
  ddeutil/workflow/cron.py,sha256=75A0hqevvouziKoLALncLJspVAeki9qCH3zniAJaxzY,7513
8
7
  ddeutil/workflow/exceptions.py,sha256=P56K7VD3etGm9y-k_GXrzEyqsTCaz9EJazTIshZDf9g,943
@@ -17,9 +16,8 @@ ddeutil/workflow/api/__init__.py,sha256=F53NMBWtb9IKaDWkPU5KvybGGfKAcbehgn6TLBwH
17
16
  ddeutil/workflow/api/api.py,sha256=Md1cz3Edc7_uz63s_L_i-R3IE4mkO3aTADrX8GOGU-Y,5644
18
17
  ddeutil/workflow/api/repeat.py,sha256=zyvsrXKk-3-_N8ZRZSki0Mueshugum2jtqctEOp9QSc,4927
19
18
  ddeutil/workflow/api/route.py,sha256=MQXtkF5uM_ZL1SGDuXFzgkNkbT5cpAXVNRp6mvewupM,7447
20
- ddeutil_workflow-0.0.25.dist-info/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
21
- ddeutil_workflow-0.0.25.dist-info/METADATA,sha256=Rt11UMGcXyYWwXcxb-p0LgelfUFi7DaM_lQwFVX1Mtw,14641
22
- ddeutil_workflow-0.0.25.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
23
- ddeutil_workflow-0.0.25.dist-info/entry_points.txt,sha256=0BVOgO3LdUdXVZ-CiHHDKxzEk2c8J30jEwHeKn2YCWI,62
24
- ddeutil_workflow-0.0.25.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
25
- ddeutil_workflow-0.0.25.dist-info/RECORD,,
19
+ ddeutil_workflow-0.0.26.dist-info/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
20
+ ddeutil_workflow-0.0.26.dist-info/METADATA,sha256=MD2MuUFEap5vrkRukNQzf2pLGnZI1QZh9CkmIo5ZVyU,14075
21
+ ddeutil_workflow-0.0.26.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
22
+ ddeutil_workflow-0.0.26.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
23
+ ddeutil_workflow-0.0.26.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.7.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
ddeutil/workflow/cli.py DELETED
@@ -1,108 +0,0 @@
1
- # ------------------------------------------------------------------------------
2
- # Copyright (c) 2022 Korawich Anuttra. All rights reserved.
3
- # Licensed under the MIT License. See LICENSE in the project root for
4
- # license information.
5
- # ------------------------------------------------------------------------------
6
- from __future__ import annotations
7
-
8
- import json
9
- import sys
10
- from datetime import datetime
11
- from typing import Annotated, Optional
12
-
13
- from ddeutil.core import str2list
14
- from typer import Argument, Typer, echo
15
-
16
- from .conf import config
17
-
18
- cli: Typer = Typer()
19
-
20
-
21
- @cli.command()
22
- def run(
23
- workflow: Annotated[
24
- str,
25
- Argument(help="A workflow name that want to run manually"),
26
- ],
27
- params: Annotated[
28
- str,
29
- Argument(
30
- help="A json string for parameters of this workflow execution.",
31
- ),
32
- ],
33
- ):
34
- """Run workflow workflow manually with an input custom parameters that able
35
- to receive with workflow params config.
36
- """
37
- echo(f"Running workflow name: ({type(workflow)}) {workflow!r}")
38
- echo(f"... with Parameters: ({type(params)}) {params!r}")
39
-
40
- from .result import Result
41
- from .workflow import Workflow
42
-
43
- try:
44
- wf: Workflow = Workflow.from_loader(name=workflow)
45
- rs: Result = wf.execute(params=json.loads(params))
46
- except Exception as err:
47
- echo(str(err))
48
- sys.exit(1)
49
-
50
- echo(f"Result: {rs}")
51
- sys.exit(0)
52
-
53
-
54
- @cli.command()
55
- def schedule(
56
- stop: Annotated[
57
- Optional[datetime],
58
- Argument(
59
- formats=["%Y-%m-%d", "%Y-%m-%d %H:%M:%S"],
60
- help="A stopping datetime that want to stop on schedule app.",
61
- ),
62
- ] = None,
63
- excluded: Annotated[
64
- Optional[str],
65
- Argument(help="A list of exclude workflow name in str."),
66
- ] = None,
67
- externals: Annotated[
68
- Optional[str],
69
- Argument(
70
- help="A json string for parameters of this workflow execution."
71
- ),
72
- ] = None,
73
- ):
74
- """Start workflow scheduler that will call workflow function from scheduler
75
- module.
76
- """
77
- excluded: list[str] = str2list(excluded) if excluded else []
78
- echo(f"... with Excluded Parameters: {excluded!r}")
79
- externals: str = externals or "{}"
80
-
81
- # NOTE: Convert timezone on the stop date.
82
- if stop:
83
- stop: datetime = stop.astimezone(tz=config.tz)
84
-
85
- from .scheduler import schedule_runner
86
-
87
- try:
88
- # NOTE: Start running workflow scheduler application.
89
- workflow_rs: list[str] = schedule_runner(
90
- stop=stop, excluded=excluded, externals=json.loads(externals)
91
- )
92
- echo(f"Schedule with CLI run success with: {workflow_rs}")
93
- except Exception as err:
94
- echo(str(err))
95
- sys.exit(1)
96
-
97
- sys.exit(0)
98
-
99
-
100
- @cli.callback()
101
- def main():
102
- """
103
- Manage workflow with CLI.
104
- """
105
-
106
-
107
- if __name__ == "__main__":
108
- cli()
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- ddeutil-workflow = ddeutil.workflow.cli:cli