Metadata-Version: 2.4
Name: iil-outlinefw
Version: 0.1.1
Summary: Zentrales Story-Outline-Framework fuer alle iil-Platform-Applikationen
Project-URL: Homepage, https://github.com/achimdehnert/outlinefw
Project-URL: Repository, https://github.com/achimdehnert/outlinefw
Project-URL: Issues, https://github.com/achimdehnert/outlinefw/issues
Author-email: Achim Dehnert <achim@dehnert.dev>
License: MIT License
        
        Copyright (c) 2026 Achim Dehnert
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: creative-writing,framework,iil-platform,outline,story
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pydantic<3,>=2.5
Provides-Extra: dev
Requires-Dist: mypy>=1.9; extra == 'dev'
Requires-Dist: pydantic<3,>=2.5; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: django
Requires-Dist: django<6.0,>=4.2; extra == 'django'
Provides-Extra: full
Requires-Dist: django<6.0,>=4.2; extra == 'full'
Requires-Dist: mypy>=1.9; extra == 'full'
Requires-Dist: pydantic<3,>=2.5; extra == 'full'
Requires-Dist: pytest-cov>=5.0; extra == 'full'
Requires-Dist: pytest>=8.0; extra == 'full'
Requires-Dist: ruff>=0.4; extra == 'full'
Description-Content-Type: text/markdown

# iil-outlinefw

Story Outline Framework for AI-assisted creative writing.

**Pure Python** — no Django, no DB dependency in the core.

Part of the `iil-` platform package family alongside `iil-aifw`, `iil-authoringfw`, `iil-promptfw`.

## Install

```bash
pip install iil-outlinefw
# or with LLM support:
pip install iil-outlinefw[aifw]
```

## Features

- **5 story frameworks**: Three-Act, Save the Cat, Hero's Journey, Five-Act, Dan Harmon Story Circle
- **Beat definitions** with act position (0.0–1.0), tension level, emotional arc
- **`OutlineGenerator`**: LLM-based outline generation via any `iil-aifw`-compatible router
- **`parse_nodes()`**: Robust JSON parser for LLM responses (handles fencing, `<think>` tags, leading text)
- **Pydantic schemas**: `OutlineNode`, `OutlineResult`, `ProjectContext`
- **Django adapter** in `outlinefw.django_adapter` (optional, no hard dependency)

## Quick Start

```python
from outlinefw import OutlineGenerator, FRAMEWORKS
from outlinefw.schemas import ProjectContext

gen = OutlineGenerator(my_llm_router)

ctx = ProjectContext(
    title="My Novel",
    genre="Thriller",
    description="A story about ...",
)

result = gen.generate(ctx, framework="save_the_cat", chapter_count=15)
for node in result.nodes:
    print(f"{node.order}. {node.title} [{node.beat}]")
```

## Frameworks

| Key | Name | Beats |
|-----|------|-------|
| `three_act` | Drei-Akt-Struktur | 7 |
| `save_the_cat` | Save the Cat | 15 |
| `heros_journey` | Heldenreise | 12 |
| `five_act` | Fuenf-Akt-Struktur | 5 |
| `dan_harmon` | Dan Harmon Story Circle | 8 |

## Architecture

```
src/outlinefw/
    __init__.py        # Public API
    schemas.py         # Pydantic: OutlineNode, OutlineResult, ProjectContext
    frameworks.py      # FRAMEWORKS dict + BeatDefinition TypedDicts
    generator.py       # OutlineGenerator (LLMRouter Protocol)
    parser.py          # parse_nodes() -- robust LLM JSON parser
    django_adapter.py  # Optional Django bridge (override in host app)
```

## Used By

- `writing-hub` — outline generation + standalone Outlines section
- `travel-beat` — scene-based story planning (migration planned)
- `bfagent` — advanced outline handlers (migration planned)

## Part of the iil- Platform

| Package | Purpose |
|---------|---------|
| `iil-aifw` | LLM routing (DB-driven) |
| `iil-promptfw` | Prompt templates (Jinja2) |
| `iil-authoringfw` | Authoring schemas (chapters, style) |
| `iil-outlinefw` | Story structure + outline generation |
| `iil-weltenfw` | WeltenHub REST client |
