Generate project folders/files from JSON tree (via tree2json)
Project description
tree2proj
tree2proj 是一个用于根据 JSON 格式的目录树结构,自动生成对应的文件夹和文件 的 Python 工具。它依赖 tree2json 包,将项目结构从类似 tree 命令的文本解析为 JSON 后,再由本工具落地为真实的项目结构。
✨ 功能亮点
- 根据目录树结构生成完整项目目录
- 支持命令行(CLI)快速构建项目骨架
📦 安装方法
确保 Python ≥ 3.7,先安装 tree2proj:
pip install tree2proj
🧰 用法说明
✅ 方式 1:Python 调用
from tree2json import Tree2Json
from builder import ProjBuilder
tree_str = """
bbb
├── 5个创新模块.pdf
├── AIproject
| ├── mnist.zip
| └── 论文
├── bihui_pic
| └── ccccz
├── Blender 4.3.lnk
├── 钉钉.lnk
└── 飞书.lnk
"""
parser = Tree2Json()
parser.from_string(tree_str)
builder = ProjBuilder(parser.to_dict())
builder.create_fs()
✅ 方式 2:命令行使用(CLI)
tree2proj tree.json
或自定义生成路径:
tree2proj tree.json --output ./my_project
🧩 依赖项
tree2json≥ 0.1.3
📝 许可协议
本项目遵循 MIT 开源许可证。欢迎自由使用与修改。
📬 联系作者
作者:@knighthood
欢迎提 Issue、PR 或交流建议!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tree2proj-0.1.0.tar.gz
(4.6 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 tree2proj-0.1.0.tar.gz.
File metadata
- Download URL: tree2proj-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dacdc7355d6dd0f806e90dc92782bbf4b4b450fd61e547ffcdeec9e94af9fc1f
|
|
| MD5 |
fdb7b37bed7a83fa5c3487bfa95a38a3
|
|
| BLAKE2b-256 |
cb407f5fd34e83a54eebd8e5dd29d7bcdbdac906f6882920a5903099b78f73e2
|
File details
Details for the file tree2proj-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tree2proj-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c12a26f931aae11eb5579529367c68ab62a2017ece044293d3386651efe67174
|
|
| MD5 |
f029d4607b7d990d2c909540ddf047f0
|
|
| BLAKE2b-256 |
c307446d25c0b9eccc97f2ff2aedb5cbe5c6b5029e72dd8edb0c8320375575d7
|