Skip to main content

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_code0 表示成功,为 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.2.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

homlab_gen-0.1.2-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file homlab_gen-0.1.2.tar.gz.

File metadata

  • Download URL: homlab_gen-0.1.2.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

Hashes for homlab_gen-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ad818c10cbd5ae4ad36266863006dfdee52bdc575e2d95a9306b4a1fed4da867
MD5 ec29e8d3fce2203663c5f0d039beffd3
BLAKE2b-256 cc9f16da7b89e16cdd8b7668334dec6be38b14381f9b746146b84c2d52946079

See more details on using hashes here.

File details

Details for the file homlab_gen-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: homlab_gen-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for homlab_gen-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3c16cf9ccf3990385c6d52241a9d84084f289dec5ab8c2242ee96678b1ce84d
MD5 da8406f8cd7014df818fb66908dc88bb
BLAKE2b-256 ecd8280588ab0e10146a7234ecc1c1e718ae00f5c79f3a9f6855a553ba882ca5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page