Skip to main content

Libra Boot Low

Libra 家族

仓库 定位
libra-boot-plus Java 微服务框架(SB3/Java17,starter 体系+业务模块+统一启动容器)
libra-boot-low Python 低代码生成器(YAML+Jinja2 一键生成全栈骨架,产物 SB3 合规)
libra-spring-boot-starter-toolkit Java 8 静态工具箱(数据库/HTTP/Redis 三大件,独立 v1.0.32)

基于 YAML 配置 + Jinja2 模板的低代码代码生成器,一键生成 Spring Boot + Vue3 完整业务骨架代码,覆盖后端(Java)、前端(Vue3)、SQL 建表、HTTP 测试脚本全产物链路。

快速上手

# 方式一:直接从源码运行
pip install -r requirements.txt

# 使用示例配置生成
python3 generator.py config/test/t1000.yml

# 或使用交互式菜单
bash run.sh

# 批量生成全部模块
bash run.sh --all

安装

通道 命令 状态
源码直跑 pip install -r requirements.txt 后 python3 generator.py ✅ 现可用
GitHub Release wheel pip install https://github.com/halavah/libra-boot-low/releases/latest/download/libra_boot_low-1.1.0-py3-none-any.whl ✅ 现可用
git 直装 pip install git+https://github.com/halavah/libra-boot-low.git ✅ 现可用
PyPI pip install libra-boot-low 🚧 Trusted Publishing 待项目页配置后自动开通

生成链路

YAML 配置  ──►  generator.py  ──►  module/gen_*.py  ──►  templates/{mode}/  ──►  out/{domain}/{code}/
  (yml/)         (主入口)          (模式生成器)         (Jinja2 模板)           (完整产物)

十二种生成模式

模式 说明 适用场景
single 单表 CRUD 简单业务表
single-with-file 单表 + 附件上传 带文件的业务表
multi-table 多表关联 主表带字典/配置表
multi-table-with-file 多表 + 附件 带文件的多表
master-detail 主从表(一对多) 订单-订单明细
master-detail-with-file 主从表 + 附件 带文件的主从
master-detail-modules 主从表(模块化) 子表独立成模块
master-detail-modules-with-file 主从模块化 + 附件 带文件的主从模块化
master-details-tabs 主多明细(页签) 一主多子页签切换
master-details-tabs-with-file 主多明细页签 + 附件 带文件的多明细
master-details-tabs-dialog 主多明细(页签弹窗) 弹窗编辑的复杂主从
master-details-tabs-dialog-with-file 页签弹窗 + 附件 带文件的页签弹窗

每种模式均有对应的 templates/{mode}/ 模板目录和 config/test/ 示例配置。

生成产物

每个模块按六段编号生成完整产物链:

out/{domain}/{code}/
├── 00-inbox/ 01-design/      # 生成物清单 + 设计说明
├── 02-sql/ 02-sql-scripts/   # 建表 DDL + SQL 执行脚本
├── 03-http/ 03-http-scripts/ # HTTP 接口测试用例 + 运行脚本
├── 04-server/                # Spring Boot 后端
│   ├── controller/ service/ mapper/  # 控制器/业务/MyBatis 数据层
│   └── entity/{param,po,vo}/         # 实体三件套
└── 05-web/                   # Vue3 前端
    ├── views/                # 页面组件
    └── service/              # API 调用

配置示例

# config/test/t1000.yml(节选——完整注释见该文件)
project:
  name: "Libra Boot Low"
  code: "demo"          # 项目编码(英文小写)
  version: "1.0.0"

modules:
  - name: "单表无附件"   # 模块中文名
    code: "t1000"       # 模块编码(英文小写)
    domain: "test"      # 业务域编码
    mode: "single"      # 生成模式(12 种之一)
    fields:             # 字段清单(type 决定 Java/SQL/Vue 三端类型)
      - { name: "title", label: "标题", type: "input", required: true }
      - { name: "status", label: "状态", type: "select" }
      - { name: "createTime", label: "创建时间", type: "date-year" }

CLI 参数

generator.py 参数:

参数 说明
config(位置参数) YAML 配置文件路径
output(位置参数) 输出目录(默认 ../../out)
--module <code> / -m 仅生成指定 code 的模块
--mode <mode> 覆盖 YAML 中的 mode
--validate / -v 仅校验配置,不生成
--list / -l 列出配置内的模块
--list-modes 列出全部 12 种支持的模式
--dry-run 预览将生成的文件列表,零落盘
--update-index / -u 仅重建 config/index.json 索引
--batch-timestamp <ts> 批量模式共享日志时间戳
--version 显示版本号

run.sh / run.ps1 启动器额外提供: 交互式菜单(无参数运行)、--all(批量生成全部模块)、--domain <name>(按域过滤)——由启动器循环调用 generator.py 实现。

技术栈

组件 说明
Python 3.9+ 运行环境
PyYAML 配置解析
Jinja2 模板渲染

项目结构

libra-boot-low/
├── generator.py            # 主入口
├── run.sh                  # Shell 交互式菜单
├── run.ps1                 # PowerShell 交互式菜单
├── module/                 # 核心生成模块
│   ├── config_loader.py    # YAML 配置加载
│   ├── field_builder.py    # 字段构建器
│   ├── template_renderer.py # Jinja2 渲染器
│   └── gen_*.py            # 各模式生成器
├── templates/              # Jinja2 模板(12 种模式)
│   ├── single/
│   ├── single-with-file/
│   ├── multi-table/
│   ├── master-detail/
│   └── ...
├── config/                 # YAML 配置文件
│   ├── README.md           # 配置说明
│   └── test/               # 示例配置

License

MIT

相关项目

Metadata

Release files for libra-boot-low 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libra-boot-low 1.1.1
File Size Uploaded Provenance Actions
libra_boot_low-1.1.1.tar.gz 56.0 kB With provenance Details for libra_boot_low-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for libra-boot-low 1.1.1
File Interpreter ABI Platform Actions
libra_boot_low-1.1.1-py3-none-any.whl Python 3 none any Details for libra_boot_low-1.1.1-py3-none-any.whl

Total release size: 141.3 kB

Release files / libra_boot_low-1.1.1.tar.gz

Download URL libra_boot_low-1.1.1.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e80fcc8de487a646e3dfe08865b5c05572c0cf4a44ec8d9540cad9e620c1924f
BLAKE2b-256 checksum
How to use checksums
6b6d1451a76bbed46c873f02a916571c3677a431c2cbd768fdbb836f72f3e253
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / libra_boot_low-1.1.1-py3-none-any.whl

Download URL libra_boot_low-1.1.1-py3-none-any.whl
Size 85.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24653dd4e4346f2fe4936c9d1243ab30d7dee1a1247fed9832c50bab90181464
BLAKE2b-256 checksum
How to use checksums
f7e9aa1507674ca3fca19f6c9d1983ff8ad8b58f35d1ccb435d549700d945a0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for libra-boot-low 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for libra_boot_low-1.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page