Skip to main content

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() before create_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)

Source distribution for gpt-folder-tree 0.2.0
File Size Uploaded
gpt_folder_tree-0.2.0.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpt-folder-tree 0.2.0
File Interpreter ABI Platform
gpt_folder_tree-0.2.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page