pyarch
v0.0.2
生成Python軟件包的動態類圖的工具,以促進其開發和維護。
動機:
PYARCH可以作為GitHub工作流程的一部分執行。
| 屬性 | 描述 | 必需的 | 預設 |
|---|---|---|---|
input | 包裝源代碼的目錄 | 真的 | |
output | 目錄保存生成的HTML文件 | 錯誤的 | .pyarch/output |
title | 自定義HTML標題 | 錯誤的 | Python package architecture |
header | 自定義HTML標頭 | 錯誤的 | Python package architecture |
footer | 自定義HTML頁腳 | 錯誤的 | <p style="font-size:15px">Built with ❤️ by <a href="https://www.dkisler.com" target=_blank>Dmitry Kisler - dkisler.com</a></p> |
output :生成的HTML文件的路徑。以下github工作流程可用於生成軟件包架構圖並使用github頁面發布。
name : " Pyarch Pages "
on :
workflow_dispatch :
permissions :
contents : read
pages : write
id-token : write
concurrency :
group : " pages "
cancel-in-progress : false
jobs :
pyarch-pages :
runs-on : ubuntu-20.04
steps :
# assumption: the workflow is running in the python package repo
- uses : actions/checkout@v3
with :
fetch-depth : 0
- name : Generate HTML
uses : kislerdm/[email protected]
with :
# Change to the path with the package's source files
input : src
title : " Architecture of my package "
header : " Architecture of my package "
output : public
- name : Setup Pages
uses : actions/configure-pages@v3
- name : Upload artifact
uses : actions/upload-pages-artifact@v2
with :
path : ' public '
- name : Deploy to GitHub Pages
id : deployment
uses : actions/deploy-pages@v2 先決條件:
步驟
/usr/local/bin pyarch --version
請注意,將需要Sudo許可。另外,可以在沒有step 2情況下執行腳本:
python3 pyarch --version
演示
需要注意捲髮。
sudo curl -SLo /usr/local/bin/pyarch https://github.com/kislerdm/pyarch/releases/download/v0.0.1/pyarch &&
pyarch --version
輸出:
version: 0.0.1
先決條件:
按照Sklearn的動態體系結構圖生成網頁的步驟:
mkdir sklearn-diagram && cd sklearn-diagram
git clone [email protected]:scikit-learn/scikit-learn.git code
pyreverse -Akmy -o puml -d . --ignore=test,tests code/sklearn
pyarch -i . -o . -v --title="sklearn architecture" --header="sklearn architecture"
目錄預計將具有以下結構:
.
├── code
├── classes.puml
├── packages.puml
└── index.html
使用Web-browser打開index.html :

該項目是根據麻省理工學院許可證分發的 - 隨時隨意使用它。
請打開GitHub問題和/或PR,並提供更改建議進行協作。