A Python library for converting tree structure text into actual files and directories
Project description
DirForge 🌳
DirForge is a powerful Python utility that automatically creates directory structures and files from tree-like text representations. Perfect for quickly scaffolding projects, replicating project structures, or setting up standardized directory layouts.
🚀 Features
- Create entire directory structures from text-based tree representations
- Accurately handles nested directories and files
- Preserves file extensions and special filenames (like
__init__.py) - Supports standard tree visualization symbols (├, └, │)
- Clean and intuitive command-line interface
- Zero external dependenciesM
📦 Installation
pip install DirForge
🎯 Usage
- Create a text file (e.g.,
tree.txt) with your desired directory structure:
my_project/
├── src/
│ ├── __init__.py
│ ├── main.py
│ └── utils/
│ ├── __init__.py
│ └── helpers.py
└── requirements.txt
- Run DirForge:
DirForge tree.txt
That's it! Your directory structure will be created automatically.
🛠️ Technical Details
DirForge uses a depth-first approach to parse and create directory structures:
- Calculates directory depth using indentation and tree symbols
- Maintains a path stack to track the current position in the directory hierarchy
- Handles both files and directories intelligently based on file extensions
- Creates parent directories automatically when needed
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Inspired by the need for quick project scaffolding
- Built with love for the Python community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dirforge-0.1.0.tar.gz.
File metadata
- Download URL: dirforge-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cf073dc0fbc35dbcf2eece420c1b9b01a394961e60367bbb310380687e4112d
|
|
| MD5 |
2ef0efad0a25474ec3a7d29f002390a9
|
|
| BLAKE2b-256 |
cc55342f727d84622c64d8fbb827d6a5a262b73dcc82363849cd96bd89422178
|
File details
Details for the file dirforge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dirforge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
773320c81a87490d8a4a496a827a236719c3fd3d6d9757a7cf5e6f0ca881f510
|
|
| MD5 |
ee810fe0d370ee977833df9e4e45c39f
|
|
| BLAKE2b-256 |
fff1e9cdb54bad38fd91b6ae80971fa5b06cbb162a41fa561a4352128fa9cddf
|