锁定你的功能!
piniverse的Python项目详细描述
皮尼弗斯
Piniverse是一个简单的库,可以通过编程编排Python的函数调用。在
目录
功能支持
- 拓扑排序中python包中pinned函数的执行
- 有向无环图的可视化
先决条件
- Python 3.7
入门
安装
$ pip install piniverse
基本用法
Piniverse检查包中的固定函数。在
^{pr2}$要编排您想要的功能,请锁定它们!每个固定的函数都有一个任务标识符,如果适用,还有一个后续的指向标识符。在
# workspace/
from piniverse import Pinned
@Pinned(
task='1',
toward='2',
arguments={
args: ['Hello World']
kwargs: {'content': 'Programming exercise...'}
}
)
def simple_print(title: str, content: str = '') -> None:
message = """
Title: {}
Content:
{}
""".format(title, content)
print(message)
@Pinned(
task='2',
arguments={
args: ['A pretty Hello World']
kwargs: {'content': 'A pretty programming exercise!'
}
)
def pretty_print(title: str, content: str = '') -> None:
message = """
Pretty Title: {}
Pretty Content:
{}
""".format(title, content)
print(message)
要执行固定功能,请计划并应用!在
# script.py
import piniverse
import workspace
piniverse.plan(workspace)
piniverse.apply()
// Title: Hello World
// Content:
// Programming exercise...
// Title: A pretty Hello World
// Content:
// A pretty programming exercise
用户界面
Piniverse还提供任务定义的直观可视化。在
# script.py
pinverse.plan(workspace, plan_view=True)
局限性
目前,Piniverse只支持独立函数。在
捐款
捐款是非常受欢迎的!查看contribution documentation。在
- 项目
标签: