从目录结构创建json树
dir2json的Python项目详细描述
此工具从目录的文件层次结构创建json树结构
用法
dir2json --pretty test/
在这样的目录中
test ├── bar │ └── symlink.png -> ../foo/test.png └── foo ├── test.jpg └── test.pn
生成以下json输出
{ "type": "directory", "path": "", "index": [ { "type": "directory", "path": "foo", "index": [ { "type": "image/jpeg", "path": "foo/test.jpg" }, { "type": "image/png", "path": "foo/test.png" } ] }, { "type": "directory", "path": "bar", "index": [ { "type": "image/png", "link": "foo/test.png", "path": "bar/symlink.png" } ] } ] }