spirit-link
使用
下面是一个示例。通常来说,我们根据需求 (Requirement) 进行项目开发,项目 (Project) 被拆分为一个或多个模块,模块 (Module) 被拆分为多个任务,任务(Task) 可以拆分为子任务:
- 项目
- 模块
- 任务
- 子任务
- 子任务的子任务
- 子任务
- 任务
- 模块
代码示例如下:
from spirit_link import *
项目(
"项目名",
[
模块(
"模块名",
[
任务("任务1"),
任务(
"任务2",
[
# 子任务
]
),
]
),
]
)
不管还是最顶层的项目,还是中间的模块,根部的任务,甚至是需求,这些都是节点 (Node)。节点之间可以创建依赖:
assert isinstance(项目, Node) and isinstance(任务, Node) and isinstance(需求, Node)
任务1.depends(任务2)
任务1.depends(项目3)
节点可以被用标签 (Tag)标记:
from enum import Enum
class 我的标签(标签, Enum):
情况1 = 1
情况2 = 2
任务1.tag(我的标签.情况1)
下面是一个例子:
from enum import Enum
from spirit_link import *
from spirit_link.backends.dot import build_graph, output
class 进度(Tag, Enum):
未开始 = 0
规划中 = 1
进行中 = 2
已完成 = 3
已验证 = 4
## 描述需求
A = 需求("A")
B = 项目(
"B",
[
模块(
"C",
[
任务("a1"),
任务("a2")
]
),
模块(
"D",
[
任务("a3"),
任务("a4"),
任务(
"a5",
children=[
任务("a5-1"),
任务("a5-2")
]
)
]
),
])
A.depends(B)
root = B
outliers = [A]
可以从中构建一个PDF:
spirit-link.exe test.py --o=test.pdf
得到下图:
Metadata
Release files for spirit-link 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spirit_link-0.1-py3-none-any.whl | Python 3 | none | any | Details for spirit_link-0.1-py3-none-any.whl |
Release files / spirit_link-0.1-py3-none-any.whl
| Download URL | spirit_link-0.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24b68e740ec1e74da106b4b01d010c86169932c98b493f217c147d2edbcb2a82
|
|
BLAKE2b-256 checksum How to use checksums |
ac43ebdb082beced738eaf2817768248598e94695188eb1e280512fe1a555b98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Security for spirit-link 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.