Metadata-Version: 2.4
Name: prj-tree
Version: 0.1.2
Summary: Project tree extractor with ignore support, flexible includes, and multiple renderers (HTML/MD/JSON/ASCII).
Project-URL: Homepage, https://pypi.org/project/prj-tree/
Project-URL: Repository, https://github.com/his-name-anton/prj-tree
Author: Anton Larin
License: MIT
Keywords: cli,html,json,markdown,project,structure,tools,tree
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
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: Topic :: Utilities
Requires-Python: >=3.9
Requires-Dist: tomli; python_version < '3.11'
Description-Content-Type: text/markdown

# prj-tree

Инструмент для извлечения структуры проекта (или отдельной директории) с учётом игноров и гибкими правилами включения файлов. Рендеры: HTML / Markdown / JSON / ASCII.

## Установка

```bash
pip install prj-tree
```

## CLI

```bash
prj-tree [ROOT] [--renderer html|md|json|ascii] \
  [--no-git-root] [--no-gitignore] \
  [--extra-ignore PATTERNS...] \
  [--tree-include PATTERNS...] [--tree-exclude PATTERNS...] \
  [--content-include PATTERNS...] \
  [--content-exclude PATTERNS...] \
  [--max-file-chars N] [--no-truncate] \
  [--title TEXT] \
  [--output OUTFILE]
```

- **ROOT**: корень проекта (по умолчанию — git root или CWD)
- **--tree-include/--tree-exclude**: фильтрация дерева по путям/именам/wildcard
- **--content-include**: какие файлы показывать с содержимым (имя, путь, расширение `.py`, или wildcard `**/*.py`)
- **--content-exclude**: исключить содержимое для совпадающих паттернов (файл останется в дереве)
- **--no-gitignore**: не учитывать `.gitignore`
- По умолчанию обрезка содержимого отключена. Включить можно `--max-file-chars N`.
- Также учитывается `.prjtreeignore` (если есть) в корне

Примеры:

```bash
# HTML отчёт со всеми .py файлами
prj-tree --renderer html --content-include .py --output structure.html

# Markdown по папке src, исключая node_modules
prj-tree src --renderer md --tree-exclude node_modules --output tree.md

# JSON (можно парсить программно)
prj-tree --renderer json --content-include "src/**/*.ts" --output tree.json

# ASCII в stdout
prj-tree --renderer ascii
```

## Python API

```python
from prj_tree import generate, GenerateOptions

opts = GenerateOptions(
    root_path="/path/to/project",
    content_include=[".py", "README.md", "src/**/main.ts"],
    tree_exclude=["node_modules", "dist"],
    renderer="html",
    title="Мой проект",
)
html = generate(opts)
```

## Игноры
- Встроенные дефолтные игноры (например, `.git`, `node_modules`, `__pycache__` и т.д.)
- Паттерны из `.gitignore` (если не отключено)
- Паттерны из `.prjtreeignore` (если файл существует)
- Параметр `--extra-ignore` для явных добавлений

## Лицензия
MIT
