Tree2FS is a simple Python tool that reads a .txt file describing a project directory structure and automatically creates the corresponding folders and files on your system.
Perfect for quickly scaffolding new projects, replicating existing structures, or setting up development environments from documentation.
- ποΈ Create complete directory structures from text files
- π Supports nested folders and files
- π§ Works on Linux, macOS, and Windows
- π Creates empty files as placeholders
- π― Simple, lightweight, and easy to use
- β Handles tree-style formatting with box drawing characters
No installation required! Just download structure.py and run it with Python 3.
git clone <repository-url>
cd tree2fs- Create a text file with your desired directory structure
- Run the script:
python structure.py- Enter the path to your structure file when prompted
- The tool will create the directory structure in the current directory
The text file should describe your project structure using tree-style formatting:
- Folders should end with
/ - Files should have proper extensions (
.py,.js,.md, etc.) - Use tree characters (
βββ,βββ,β) for visual structure
my_project/
βββ src/
β βββ main.py
β βββ utils/
β β βββ helpers.py
β βββ config.json
βββ tests/
β βββ test_main.py
βββ docs/
β βββ README.md
βββ requirements.txt
This will create:
my_project/
βββ src/
β βββ main.py (empty file)
β βββ utils/
β β βββ helpers.py (empty file)
β βββ config.json (empty file)
βββ tests/
β βββ test_main.py (empty file)
βββ docs/
β βββ README.md (empty file)
βββ requirements.txt (empty file)
- Parses the input file line by line
- Analyzes indentation levels using tree characters
- Creates directories for items ending with
/ - Creates empty files for items with extensions
- Maintains the hierarchical structure using a path stack
- Python 3.x
- No external dependencies
Feel free to submit issues, feature requests, or pull requests to improve Tree2FS!