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.4.tar.gz (12.2 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.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: homlab_gen-0.1.4.tar.gz
  • Upload date:
  • Size: 12.2 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.4.tar.gz
Algorithm Hash digest
SHA256 b5ac76365dc6f121bdc51b68fbcac7ae785580a0780d7b930c1dce54781a00f4
MD5 73431aef20ae032d5c93f4cc801a1690
BLAKE2b-256 602493cb04fdd86d973216de5482459d80784b3aa4e7ad765b7fe50cb700beda

See more details on using hashes here.

File details

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

File metadata

  • Download URL: homlab_gen-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.1 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 59298bbf977c00bec4b8072326587e15c3cf5122dbe773742012ecc42bed7cc4
MD5 398ece53bdd59f8abb5ac79c3e7d0df4
BLAKE2b-256 ab32b28f32ac3692eea0c438be59137b30676e4bae6c9cf45b1919836a09b340

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