Story Development Toolkit

A comprehensive Python toolkit for generating engaging and coherent stories with optional LLM support, memory, exporters, templates, and CLI

Python 3.11+ v2.2.2 MIT Milad Rezanezhad LLM Ready Memory Ready Export Ready Templates Ready CLI Ready

Installation

bash
pip install story-toolkit

# Install with optional features
pip install story-toolkit[openai]      # OpenAI support
pip install story-toolkit[anthropic]   # Anthropic support
pip install story-toolkit[local]       # Local LLM (Ollama)
pip install story-toolkit[export]      # PDF, EPUB export
pip install story-toolkit[all]         # Everything

Or install from source: pip install -e .

Features

🎭

Character Creation

Build complex characters with personality traits, goals, skills, fears, and relationships. Includes character arc progression system.

📚

Plot Generation

Generate story structures for multiple genres: fantasy, mystery, romance, adventure, and sci-fi with twists and subplots.

💬

Dialogue Writing

Create natural dialogues with context-aware templates. Optional LLM integration for advanced, dramatic dialogues (v2.0.0).

🌍

World Building

Design detailed fictional worlds with locations, cultures, rules, factions, and interconnections between them.

🔍

Coherence Checking

Identify plot holes, character inconsistencies, timeline issues, and get actionable improvement suggestions.

📊

Text Analysis

Analyze readability, pacing, dialogue balance, vocabulary richness, and reading difficulty level.

💾

Long-term Memory

Store stories in SQLite database with timeline events and character persistence (v2.1.0).

📄

Multiple Export Formats

Export stories to PDF, EPUB, HTML (4 templates), and Bionic Reading format (v2.2.0).

📋

Pre-built Templates

5 ready-to-use story structures: Hero's Journey, 3-Act, Mystery, Romance, Horror (v2.2.1).

💻

CLI Tool

Command-line interface for easy story generation without writing Python code (v2.2.2).

Version History

v1.0.0
Core
v2.0.0
LLM
v2.1.0
Memory
v2.2.0
Exporters
v2.2.1
Templates
v2.2.2
CLI

Quick Start

Basic Usage (v1 compatible)

python
from story_toolkit import StoryToolkit

toolkit = StoryToolkit()
story = toolkit.create_story("fantasy", "courage")
hero = toolkit.add_character_to_story(story, "Kai", "protagonist")
hero.add_trait("brave")

report = toolkit.check_story_coherence(story)
print(f"Coherence: {report['overall_score']:.0%}")

Using Templates (v2.2.1)

python
# Create story using Hero's Journey template (12 stages)
story = toolkit.use_template("hero_journey", genre="fantasy")

# List all templates
templates = toolkit.list_templates()
for t in templates:
    print(t['name'], t['stage_count'])

Using CLI (v2.2.2)

bash
story-toolkit story new --genre fantasy --theme courage
story-toolkit template list
story-toolkit template use hero_journey
5
Core Modules
3
Generators
4
LLM Backends
4
Export Formats
5
Story Templates
30+
Unit Tests

Documentation

Easy Upgrade! All code written for v1.0.0 works unchanged in v2.2.2. No rewriting needed!