junban 1.0.0__tar.gz → 1.0.2__tar.gz
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.
- junban-1.0.2/PKG-INFO +94 -0
- {junban-1.0.0 → junban-1.0.2}/README.md +3 -2
- junban-1.0.2/junban.egg-info/PKG-INFO +94 -0
- junban-1.0.2/pyproject.toml +14 -0
- junban-1.0.0/PKG-INFO +0 -7
- junban-1.0.0/junban.egg-info/PKG-INFO +0 -7
- junban-1.0.0/pyproject.toml +0 -6
- {junban-1.0.0 → junban-1.0.2}/LICENSE +0 -0
- {junban-1.0.0 → junban-1.0.2}/junban/__init__.py +0 -0
- {junban-1.0.0 → junban-1.0.2}/junban/pipeline.py +0 -0
- {junban-1.0.0 → junban-1.0.2}/junban/pipeline_context.py +0 -0
- {junban-1.0.0 → junban-1.0.2}/junban/pipeline_step.py +0 -0
- {junban-1.0.0 → junban-1.0.2}/junban.egg-info/SOURCES.txt +0 -0
- {junban-1.0.0 → junban-1.0.2}/junban.egg-info/dependency_links.txt +0 -0
- {junban-1.0.0 → junban-1.0.2}/junban.egg-info/top_level.txt +0 -0
- {junban-1.0.0 → junban-1.0.2}/setup.cfg +0 -0
junban-1.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: junban
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Junban – Simple Sequential Python Workflows
|
|
5
|
+
Author-email: Sebastian Franz <sebastian.franz@tum.de>
|
|
6
|
+
Project-URL: Issues, https://github.com/biocentral/junban/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/biocentral/junban
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# Junban (順番) – Simple Sequential Python Workflows
|
|
14
|
+
|
|
15
|
+
Junban (english: order) is a lightweight library for defining and executing sequential (scientific) workflows in Python.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Junban is available via [pypi](https://pypi.org/project/junban/):
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
pip install junban
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Example
|
|
26
|
+
|
|
27
|
+
Here is a simple example showing how to define a context and two steps. It showcases how context is passed between steps
|
|
28
|
+
and how entry/exit assumptions (verification) are handled.
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from dataclasses import dataclass
|
|
32
|
+
from junban.pipeline import Pipeline
|
|
33
|
+
from junban.pipeline_step import PipelineStep
|
|
34
|
+
from junban.pipeline_context import PipelineContext
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# 1. Define your context by inheriting from PipelineContext
|
|
38
|
+
@dataclass
|
|
39
|
+
class MyContext(PipelineContext):
|
|
40
|
+
value: int = 0
|
|
41
|
+
is_processed: bool = False
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# 2. Create pipeline steps by inheriting from PipelineStep
|
|
45
|
+
class IncrementStep(PipelineStep[MyContext]):
|
|
46
|
+
def _check_entry_assumptions(self, context: MyContext) -> bool:
|
|
47
|
+
# Verification before step execution
|
|
48
|
+
return context.value == 0
|
|
49
|
+
|
|
50
|
+
def _execute(self, context: MyContext) -> MyContext:
|
|
51
|
+
# Core logic of the step
|
|
52
|
+
context.value += 1
|
|
53
|
+
return context
|
|
54
|
+
|
|
55
|
+
def _check_exit_assumptions(self, context: MyContext) -> bool:
|
|
56
|
+
# Verification after step execution
|
|
57
|
+
return context.value == 1
|
|
58
|
+
|
|
59
|
+
def get_start_message(self) -> str:
|
|
60
|
+
return "Incrementing value..."
|
|
61
|
+
|
|
62
|
+
def get_end_message(self) -> str:
|
|
63
|
+
return "Value incremented."
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class ProcessStep(PipelineStep[MyContext]):
|
|
67
|
+
def _check_entry_assumptions(self, context: MyContext) -> bool:
|
|
68
|
+
return context.value > 0
|
|
69
|
+
|
|
70
|
+
def _execute(self, context: MyContext) -> MyContext:
|
|
71
|
+
context.is_processed = True
|
|
72
|
+
return context
|
|
73
|
+
|
|
74
|
+
def _check_exit_assumptions(self, context: MyContext) -> bool:
|
|
75
|
+
return context.is_processed is True
|
|
76
|
+
|
|
77
|
+
def get_start_message(self) -> str:
|
|
78
|
+
return "Processing..."
|
|
79
|
+
|
|
80
|
+
def get_end_message(self) -> str:
|
|
81
|
+
return "Processed."
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# 3. Initialize and execute the pipeline
|
|
85
|
+
if __name__ == "__main__":
|
|
86
|
+
context = MyContext()
|
|
87
|
+
pipeline = Pipeline(
|
|
88
|
+
steps=[IncrementStep(), ProcessStep()],
|
|
89
|
+
name="ExamplePipeline"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
final_context = pipeline.execute(context)
|
|
93
|
+
print(f"Final value: {final_context.value}, Processed: {final_context.is_processed}")
|
|
94
|
+
```
|
|
@@ -4,9 +4,10 @@ Junban (english: order) is a lightweight library for defining and executing sequ
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
Junban is available via pypi:
|
|
8
|
-
```python
|
|
7
|
+
Junban is available via [pypi](https://pypi.org/project/junban/):
|
|
9
8
|
|
|
9
|
+
```shell
|
|
10
|
+
pip install junban
|
|
10
11
|
```
|
|
11
12
|
|
|
12
13
|
## Quick Example
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: junban
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Junban – Simple Sequential Python Workflows
|
|
5
|
+
Author-email: Sebastian Franz <sebastian.franz@tum.de>
|
|
6
|
+
Project-URL: Issues, https://github.com/biocentral/junban/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/biocentral/junban
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# Junban (順番) – Simple Sequential Python Workflows
|
|
14
|
+
|
|
15
|
+
Junban (english: order) is a lightweight library for defining and executing sequential (scientific) workflows in Python.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Junban is available via [pypi](https://pypi.org/project/junban/):
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
pip install junban
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Example
|
|
26
|
+
|
|
27
|
+
Here is a simple example showing how to define a context and two steps. It showcases how context is passed between steps
|
|
28
|
+
and how entry/exit assumptions (verification) are handled.
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from dataclasses import dataclass
|
|
32
|
+
from junban.pipeline import Pipeline
|
|
33
|
+
from junban.pipeline_step import PipelineStep
|
|
34
|
+
from junban.pipeline_context import PipelineContext
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# 1. Define your context by inheriting from PipelineContext
|
|
38
|
+
@dataclass
|
|
39
|
+
class MyContext(PipelineContext):
|
|
40
|
+
value: int = 0
|
|
41
|
+
is_processed: bool = False
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# 2. Create pipeline steps by inheriting from PipelineStep
|
|
45
|
+
class IncrementStep(PipelineStep[MyContext]):
|
|
46
|
+
def _check_entry_assumptions(self, context: MyContext) -> bool:
|
|
47
|
+
# Verification before step execution
|
|
48
|
+
return context.value == 0
|
|
49
|
+
|
|
50
|
+
def _execute(self, context: MyContext) -> MyContext:
|
|
51
|
+
# Core logic of the step
|
|
52
|
+
context.value += 1
|
|
53
|
+
return context
|
|
54
|
+
|
|
55
|
+
def _check_exit_assumptions(self, context: MyContext) -> bool:
|
|
56
|
+
# Verification after step execution
|
|
57
|
+
return context.value == 1
|
|
58
|
+
|
|
59
|
+
def get_start_message(self) -> str:
|
|
60
|
+
return "Incrementing value..."
|
|
61
|
+
|
|
62
|
+
def get_end_message(self) -> str:
|
|
63
|
+
return "Value incremented."
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class ProcessStep(PipelineStep[MyContext]):
|
|
67
|
+
def _check_entry_assumptions(self, context: MyContext) -> bool:
|
|
68
|
+
return context.value > 0
|
|
69
|
+
|
|
70
|
+
def _execute(self, context: MyContext) -> MyContext:
|
|
71
|
+
context.is_processed = True
|
|
72
|
+
return context
|
|
73
|
+
|
|
74
|
+
def _check_exit_assumptions(self, context: MyContext) -> bool:
|
|
75
|
+
return context.is_processed is True
|
|
76
|
+
|
|
77
|
+
def get_start_message(self) -> str:
|
|
78
|
+
return "Processing..."
|
|
79
|
+
|
|
80
|
+
def get_end_message(self) -> str:
|
|
81
|
+
return "Processed."
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# 3. Initialize and execute the pipeline
|
|
85
|
+
if __name__ == "__main__":
|
|
86
|
+
context = MyContext()
|
|
87
|
+
pipeline = Pipeline(
|
|
88
|
+
steps=[IncrementStep(), ProcessStep()],
|
|
89
|
+
name="ExamplePipeline"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
final_context = pipeline.execute(context)
|
|
93
|
+
print(f"Final value: {final_context.value}, Processed: {final_context.is_processed}")
|
|
94
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "junban"
|
|
3
|
+
version = "1.0.2"
|
|
4
|
+
description = "Junban – Simple Sequential Python Workflows"
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "Sebastian Franz", email = "sebastian.franz@tum.de"},
|
|
7
|
+
]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
dependencies = []
|
|
11
|
+
|
|
12
|
+
[project.urls]
|
|
13
|
+
Issues = "https://github.com/biocentral/junban/issues"
|
|
14
|
+
Repository = "https://github.com/biocentral/junban"
|
junban-1.0.0/PKG-INFO
DELETED
junban-1.0.0/pyproject.toml
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|