gpt-folder-tree
Create complete project folder structures from GPT-style ASCII trees — instantly.
gpt-folder-tree is a lightweight Python utility that converts ASCII folder trees (like those generated by ChatGPT or written in README files) into real directories and files on your filesystem.
Perfect for:
- Bootstrapping new projects
- Recreating documented folder structures
- Automating scaffolding for frameworks, microservices, or libraries
- Turning design docs into real codebases
✨ Features
- 📂 Parse GPT / Unix-style ASCII folder trees
- 🧪 Dry-run mode to preview what will be created
- ⚡ Create folders and files automatically
- 🧩 Minimal, dependency-free, and fast
- 🐍 Pythonic API — easy to integrate into tools or CLIs
📦 Installation
# Install using pip
pip install gpt-folder-tree
# Install using uv
uv add gpt-folder-tree
🚀 Quick Start
1. Import the library
from gpt_folder_tree import parse_tree, create_tree, dry_run
2. Define your folder structure (ASCII format)
gpt_ascii_text = """
project/
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── config.py
│ ├── database/
│ │ ├── __init__.py
│ │ ├── connection.py
│ │ └── models.py
│ ├── api/
│ │ ├── __init__.py
│ │ ├── v1/
│ │ │ ├── __init__.py
│ │ │ ├── routes.py
│ │ │ └── schemas.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── auth_service.py
│ │ ├── user_service.py
│ │ └── email_service.py
│ ├── core/
│ │ ├── __init__.py
│ │ ├── security.py
│ │ └── dependencies.py
│ ├── utils/
│ │ ├── __init__.py
│ │ └── helpers.py
├── tests/
│ ├── __init__.py
│ ├── test_main.py
│ ├── test_auth.py
│ └── test_users.py
├── alembic/
│ ├── env.py
│ └── versions/
├── scripts/
│ └── seed_db.py
├── requirements.txt
├── .env
├── README.md
└── Dockerfile
"""
3. Parse the tree
tree = parse_tree(gpt_ascii_text)
4. (Optional) Dry run — preview what will be created
dry_run(tree)
Output example:
CREATE DIR ./project
CREATE DIR ./project/app
CREATE FILE ./project/app/main.py
...
5. Create the folders & files
create_tree(tree)
✅ Your entire project structure is now created on disk.
🧠 How It Works
- Directories are detected by a trailing
/ - Files are created as empty files
- Indentation depth determines parent-child relationships
- Compatible with GPT-generated trees and Unix-style layouts
🗂 API Reference
parse_tree(text: str) -> Node
Parses an ASCII tree string into an internal tree structure.
dry_run(node: Node, base_path: str = ".")
Prints what would be created without touching the filesystem.
create_tree(node: Node, base_path: str = ".")
Creates all directories and files on disk.
⚠️ Notes & Best Practices
- Run
dry_run()beforecreate_tree()for safety - Avoid running in sensitive directories (e.g.,
/, home root) - ASCII tree must be properly indented (4 spaces per level)
🤝 Contributing
Contributions, issues, and feature requests are welcome. This project is intentionally simple — clarity over complexity.
⭐ Why This Exists
Because copying folder structures from ChatGPT, README files, or documentation should not require manual folder creation.
Turn ideas into structure. Instantly.
Metadata
Release files for gpt-folder-tree 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gpt_folder_tree-0.2.0.tar.gz | 3.0 kB | Without provenance | Details for gpt_folder_tree-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gpt_folder_tree-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for gpt_folder_tree-0.2.0-py3-none-any.whl |
Total release size: 7.3 kB
Release files / gpt_folder_tree-0.2.0.tar.gz
| Download URL | gpt_folder_tree-0.2.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
858967240f3d47a05628eadfc20d7e94d9ae058bf9ffd41996d81d37bc85efd7
|
|
BLAKE2b-256 checksum How to use checksums |
20b4adf63e19cbeab65d86eae8775deaaaa7d7c16936dd2386361469cc1a5b43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Release files / gpt_folder_tree-0.2.0-py3-none-any.whl
| Download URL | gpt_folder_tree-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40d2b4a623d3611662ea06ad66819b4165d1f2a3fb34687115ab82ca5070a03f
|
|
BLAKE2b-256 checksum How to use checksums |
c9eeb850453c09b5101b88531ec24659043ded3893442b19cf5acf2337e23d8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Security for gpt-folder-tree 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.