Skip to main content

🌳 Treecraft

Tests PyPI version Python versions PyPI status

Treecraft is a Python tool that generates directory structures from text-based tree representations. It provides an intuitive way to create project scaffolding from a visual directory tree structure.

✨ Features

  • 📁 Generate directory structures from text-based tree representations
  • 🐍 Automatic Python file initialization with docstrings
  • 🔍 Dry run mode to preview changes
  • ⚡ Simple and intuitive CLI interface
  • 🛡️ Safe path handling and validation

📋 Requirements

  • Python 3.7 or higher

🚀 Installation

You can install Treecraft using pip:

pip install treecraft

For development installation:

git clone https://github.com/ashwin271/treecraft.git
cd treecraft
pip install -e .

📖 Usage

Command Line Interface

Create a text file with your desired directory structure:

src/
├── agents/
│   ├── __init__.py
│   └── agent.py
├── utils/
│   ├── __init__.py
│   └── helpers.py
└── main.py

Then run Treecraft:

treecraft input.txt -o output_directory

Python API

from treecraft import TreeParser, Generator

# Initialize components
parser = TreeParser()
generator = Generator()

# Parse tree structure
with open('input.txt', 'r') as f:
    tree_content = f.read()
    
structure = parser.parse(tree_content)

# Generate directory structure
generator.generate(structure, 'output_directory')

🔧 Development

Setup Development Environment

  1. Clone the repository:
git clone https://github.com/ashwin271/treecraft.git
cd treecraft
  1. Install development dependencies:
pip install -r requirements.txt

Running Tests

pytest tests/

📝 Examples

Basic Structure

project/
├── README.md
├── requirements.txt
└── src/
    └── main.py

Complex Structure

project/
├── docs/
│   └── index.md
├── src/
│   ├── core/
│   │   ├── __init__.py
│   │   └── main.py
│   └── utils/
│       ├── __init__.py
│       └── helpers.py
├── tests/
│   └── test_core.py
└── README.md

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

📞 Contact

Ashwin Murali - @Ashwin_271

Project Link: https://github.com/ashwin271/treecraft

📝 Documentation

Metadata

Release files for treecraft 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for treecraft 0.1.1
File Size Uploaded Provenance Actions
treecraft-0.1.1.tar.gz 9.6 kB Without provenance Details for treecraft-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for treecraft 0.1.1
File Interpreter ABI Platform Actions
treecraft-0.1.1-py3-none-any.whl Python 3 none any Details for treecraft-0.1.1-py3-none-any.whl

Total release size: 18.2 kB

Release files / treecraft-0.1.1.tar.gz

Download URL treecraft-0.1.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f3c9cb3116d26fdd6977c138418427b88c3fdfc20e5a300379c256dea6124707
BLAKE2b-256 checksum
How to use checksums
753d42d754bfde6040da4379357b83a8e0636ae7cf1667f43654aeaaee0f0735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / treecraft-0.1.1-py3-none-any.whl

Download URL treecraft-0.1.1-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8ca12403ab261104cfea452662c357cc477d0f2148ed43516da75f234524dbb
BLAKE2b-256 checksum
How to use checksums
8e6ef386fde83e16651b1914913ca1a812117dc37b5d81fe09b5d2a859dcdd24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Security for treecraft 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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