Generate crossing-free subprojects for HomLab project JSON files.
Project description
HomLab.Gen
HomLab.Gen 用于读取 HomLab 项目 JSON,消除图中的交叉点,并生成所有可能的无交叉子图。
安装
开发安装:
python -m pip install -e .
构建发布包:
python -m pip install build
python -m build
构建产物会输出到 dist/。
命令行使用
安装后可以使用 homlab-gen:
homlab-gen path/to/project.json
默认输出:
sub_diagram/:所有生成的子项目 JSON。erase.json:删除原交叉边并插入角点后的中间文件。progress.txt:生成进度。error.log:错误日志。
也可以显式指定这些路径:
homlab-gen path/to/project.json path/to/error.log --tmp path/to/erase.json --progress path/to/progress.txt
只清理旧的 sub_diagram/ 目录:
homlab-gen path/to/project.json --erase-only
兼容旧参数名:
homlab-gen path/to/project.json --dryrun
Python API
from homlab_gen import generate_subprojects
exit_code = generate_subprojects("path/to/project.json")
exit_code 为 0 表示成功,为 1 表示失败。失败原因会写入错误日志。
文档
更多细节放在 docs/:
开发检查
python -m unittest
python -m build
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
homlab_gen-0.1.1.tar.gz
(12.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file homlab_gen-0.1.1.tar.gz.
File metadata
- Download URL: homlab_gen-0.1.1.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94a1b762e7e3ecda58ec5c4483a7e534eb301df74fe8bf5efb6d6faba72ce0ac
|
|
| MD5 |
409b52f12a38de22ee65bb10c26cb31b
|
|
| BLAKE2b-256 |
7d244f3c9d7ba19641a443ab2a12a70dbef87273384d142c4396a3656500ce97
|
File details
Details for the file homlab_gen-0.1.1-py3-none-any.whl.
File metadata
- Download URL: homlab_gen-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1309911747418c7d1075816ea635de519158da869cc149782367bb2dbd0faa52
|
|
| MD5 |
4b3f9312dbd1ab053ac2dd39d9477a56
|
|
| BLAKE2b-256 |
ec41e8a294981adbac31730a5cf8d196fc4c1373214f46057c7a2d3e48cb1e49
|