Metadata-Version: 2.4
Name: tree-creator
Version: 1.0.5
Summary: Create directory and file structures from tree-like text representations
Home-page: https://github.com/jack-low/tree-creator
Author: Jack3Low
Author-email: xapa.pw@gmail.com
License: MIT
Project-URL: Bug Reports, https://github.com/jack-low/tree-creator/issues
Project-URL: Source, https://github.com/jack-low/tree-creator
Project-URL: Documentation, https://github.com/jack-low/tree-creator#readme
Project-URL: Japanese README, https://github.com/jack-low/tree-creator/blob/main/README.ja.md
Keywords: tree directory structure filesystem generator creator
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Filesystems
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# 📁 Tree Creator

Create directory and file structures from tree-like text representations — just like the output of the `tree` command.

## ✨ Features

* Parse text-based tree structures and generate corresponding directories and files.
* Dry-run support (simulate without creating files).
* CLI and API support.
* Helpful logging for debugging and auditing.
* Version managed centrally via `_version.py`.
* Zero external dependencies.

## 📦 Installation

```bash
pip install tree-creator
```

or (for development):

```bash
git clone https://github.com/jack-low/tree-creator
cd tree-creator
pip install -e ".[dev]"
```

## 🚀 Usage

### ✨ Example (Python API)

```python
from tree_creator import TreeCreator

tree_text = '''
project/
├── src/
│   ├── main.py
│   └── utils.py
└── README.md
'''

creator = TreeCreator()
creator.create_from_text(tree_text, base_dir='./my_project')
```

### 💻 CLI

```bash
tree-creator tree.txt --base-dir ./my_project
tree-creator tree.txt --dry-run
echo "dir/\n└── file.txt" | tree-creator -
```

### 🧪 Example using Here Document (EOF)

```bash
tree-creator -b ./output-dir -d - <<EOF
myapp/
├── index.html
└── static/
    └── style.css
EOF
```

- `-d` enables dry-run mode
- `-b ./output-dir` sets the output base directory
- `-` reads from stdin

#### Options

| Option           | Description                                |
|------------------|--------------------------------------------|
| `-b, --base-dir` | Target base directory (default: `.`)       |
| `-e, --encoding` | Encoding for input file (default: `utf-8`) |
| `-d, --dry-run`  | Simulate without file creation             |
| `-v, --verbose`  | Verbose log output                         |
| `-V, --version`  | Display version                            |

## 📄 Tree Format

A valid tree structure should follow conventions like:

```
project/
├── src/
│   ├── main.py
│   └── utils.py
└── README.md
```

- Directories end with `/`
- Use characters like `├──`, `└──`, `│`

## 🧪 Development

```bash
pip install -e ".[dev]"
pytest
black .
flake8 .
mypy tree_creator
```

## 📜 License

MIT License © [Jack3Low](mailto:xapa.pw@gmail.com)

## 🔗 Links

* [Source Code](https://github.com/jack-low/tree-creator)
* [Issue Tracker](https://github.com/jack-low/tree-creator/issues)
* [Documentation](https://github.com/jack-low/tree-creator#readme)
* [Japanese README](https://github.com/jack-low/tree-creator/blob/main/README.ja.md)
