Skip to main content

A Python library for converting tree structure text into actual files and directories

Project description

DirForge 🌳

PyPI version License: MIT

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

  1. 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
  1. 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dirforge-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dirforge-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for dirforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0cf073dc0fbc35dbcf2eece420c1b9b01a394961e60367bbb310380687e4112d
MD5 2ef0efad0a25474ec3a7d29f002390a9
BLAKE2b-256 cc55342f727d84622c64d8fbb827d6a5a262b73dcc82363849cd96bd89422178

See more details on using hashes here.

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

Hashes for dirforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 773320c81a87490d8a4a496a827a236719c3fd3d6d9757a7cf5e6f0ca881f510
MD5 ee810fe0d370ee977833df9e4e45c39f
BLAKE2b-256 fff1e9cdb54bad38fd91b6ae80971fa5b06cbb162a41fa561a4352128fa9cddf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page