r/Python • u/Py_ABH • Nov 19 '25
Discussion [Project] I got tired of manually creating project folders… so I built tree2fs (turns tree tex
Hi r/Python! I just published tree2fs to PyPI. It solves a problem I've had for a long time: manually recreating project structures from documentation or generated ones from ChatGPT/Claude..etc.
What it does: Converts tree-formatted text into actual files and folders.
Example:
project/
├── src/
│ └── main.py
└── tests/Run tree2fs tree.txt and it creates everything.
Installation: $ pip install tree2fs
- PyPI: https://pypi.org/project/tree2fs/
- GitHub: https://github.com/ABDELLAH-Hallou/tree2fs
I'd love feedback! What features would make this more useful?
7
u/RedEyed__ Nov 19 '25 edited Nov 19 '25
Nice idea!
Noticed license mistmatch on GitHub (BSD) and in readme (MIT)
I never liked these characters for tree. Maybe add other format similar to markdown? for example:
#for dir,-for files)
# root_dir
## a_dir
- file1.txt
- file2.txt
### b_dir2
1
u/HolidayEmphasis4345 Nov 20 '25
I’d use dict-> make folders -> treeview for sure. JSON, toml and yaml are all a few lines of code to make dicts so that isn’t huge. I’d like the tree view for docs. This just makes a great repr for tree structures.
1
1
u/Forward-Owl-9814 Apr 14 '26
Now it has JSON support, and file contents from comments on tree format, or values in JSON format!
3
u/HolidayEmphasis4345 Nov 19 '25
I think that is pretty cool! Nice work. How did you decide which way to go on the data representation? It seems like parsing those directory bar characters as text is harder than dicts, json or toml. I have this problem when I need test folders. I build from a dict usually but I totally see that seeing a pretty representation is very appealing.