The Folder Structure Generator is a Python CLI program that automatically creates folder structures and files from text input. Simply paste your desired folder structure, and the program will generate all the folders and empty files for you.
- Python 3.6 or higher
- No additional packages required
-
Run the program:
python generator.py
-
Follow the prompts:
- Choose your input format (Tree or Simple paths)
- Paste your folder structure
- Enter a main folder name
- Confirm if overwriting existing folder
-
The program will automatically create all folders and files!
Use tree characters (├, │, └, ──) to represent the hierarchy:
project/
├── src/
│ ├── main.py
│ ├── utils/
│ │ ├── __init__.py
│ │ └── helpers.py
│ └── config/
├── tests/
│ └── test_main.py
├── docs/
│ └── README.md
└── requirements.txt
Use forward slashes to represent paths:
project/src/main.py
project/src/utils/__init__.py
project/src/utils/helpers.py
project/tests/test_main.py
project/docs/README.md
project/requirements.txt
- Dual Parser Support: Choose between tree format or simple paths
- Smart File Detection: Automatically detects files vs folders
- Overwrite Protection: Asks before overwriting existing folders
- Progress Tracking: Shows real-time creation progress
- Error Handling: Provides helpful error messages
- Summary Report: Shows total files and folders created
my_app/
├── src/
│ ├── __init__.py
│ ├── main.py
│ └── utils/
│ ├── __init__.py
│ └── helpers.py
├── tests/
│ └── test_main.py
├── docs/
│ └── API.md
└── requirements.txt
website/
├── index.html
├── css/
│ ├── style.css
│ └── responsive.css
├── js/
│ ├── app.js
│ └── utils.js
├── images/
│ ├── logo.png
│ └── background.jpg
└── assets/
└── fonts/
react-app/
├── public/
│ ├── index.html
│ └── favicon.ico
├── src/
│ ├── components/
│ │ ├── Header/
│ │ │ ├── Header.jsx
│ │ │ └── Header.css
│ │ └── Footer/
│ │ ├── Footer.jsx
│ │ └── Footer.css
│ ├── pages/
│ │ ├── Home.jsx
│ │ └── About.jsx
│ ├── utils/
│ │ └── api.js
│ └── App.js
├── package.json
└── README.md
-
Files not placed in correct folders?
- Use the Tree format for complex hierarchies
- Ensure proper indentation in tree format
- Check that file names include extensions (.py, .js, etc.)
-
Parser not detecting files correctly?
- Make sure files have extensions
- Use forward slashes (/) in paths, not backslashes ()
-
Permission errors?
- Run the program in a directory where you have write permissions
- Avoid system-protected directories
- Use Tree Format for complex nested structures
- Include file extensions for accurate file detection
- Test with the example first to ensure it works in your environment
- Check the parsed structure preview before creation
The program creates:
- Empty folders with proper hierarchy
- Empty files with correct names and extensions
- All parent directories automatically
- Tree diagrams with Unicode characters (├, │, └, ──)
- Simple path notation with forward slashes
- Mixed formats (some tree, some paths)
The program detects files based on:
- File extensions (.py, .js, .html, etc.)
- Common root files (README, LICENSE, etc.)
- Presence of dots in names (except leading dots for hidden files)
- Invalid input format detection
- File permission errors
- Existing folder conflicts
- Malformed path handling
Feel free to modify the code for your specific needs! The program is designed to be easily customizable.
- Add support for file templates with content
- Include Git repository initialization
- Add support for different file encodings
- Create GUI version
This is a free tool for developers to quickly bootstrap project structures.
Happy Coding! 🎉