Skip to main content

🎬 Code Storyteller

Explain code like a story — with analogies, characters, and narrative.

Install

pip install -e .

Setup

export ANTHROPIC_API_KEY=sk-...
# or for OpenRouter:
export OPENROUTER_API_KEY=sk-or-...
export MODEL=open_router/nvidia/nemotron-3-super-120b-a12b:free

Usage

# Tell a story about a file
storytell tell auth.py --as heist
storytell tell sort.py --as recipe
storytell tell api.js --as 5yo
storytell tell handler.ts --as pm

# Specific function/class only
storytell tell auth.py --as heist --block validate_token

# Diff — narrate changes between two file versions
storytell diff old.py new.py --as heist

# Explore blocks in a file
storytell explore auth.py

# ASCII structure map
storytell map auth.py

# List styles
storytell styles

# View history (with star ratings)
storytell history

# Rate a past story (1-5)
storytell rate 42 5

# Save an analogy
storytell learn recursion "a story that tells itself"

# View saved analogies
storytell memory

Styles

Style Description
heist Code as a bank heist movie
recipe Code as a cooking recipe
5yo Explain like you're 5 years old
pm Explain like a product manager
sports Code as live sports commentary

Options

  • --no-stream — disable streaming output
  • --block <name> — target specific function/class
  • --as <style> — pick story style (default: heist)

Supported Languages

  • Python (.py)
  • JavaScript (.js, .jsx)
  • TypeScript (.ts, .tsx)

Tests

python3 -m pytest tests/ -v
# 25 tests passing

Usage (continued)

# Export story as styled PDF/PNG/HTML card
storytell card auth.py --as heist --format pdf
storytell card auth.py --as recipe --format html

# Multi-file project stories
storytell tell ./src/ --as heist
storytell tell ./src/ --as pm --focus main.py

# Launch web dashboard
storytell serve --port 8100

Install optional dependencies:

pip install code-storyteller[export]   # PDF/PNG card export
pip install code-storyteller[web]      # Web dashboard

VS Code Extension

See vscode/. Install CLI first, then:

cd vscode && npm install && npm run compile
# Press F5 in VS Code to launch Extension Development Host

GitHub Action

See action.yml and .github/workflows/storyteller-example.yml.

Roadmap

  • CLI with 5 story styles
  • Code parser (Python, JS, TS) with tree-sitter
  • SQLite memory + history
  • Diff stories (narrate code changes)
  • Rate stories + analogy memory
  • ASCII code map
  • Story card image export
  • VS Code extension
  • GitHub Action
  • Web dashboard
  • Multi-file / project stories

Metadata

Release files for code-storyteller 0.1.0

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

Source distribution (sdist)

Source distribution for code-storyteller 0.1.0
File Size Uploaded Provenance Actions
code_storyteller-0.1.0.tar.gz 43.5 kB Without provenance Details for code_storyteller-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for code-storyteller 0.1.0
File Interpreter ABI Platform Actions
code_storyteller-0.1.0-py3-none-any.whl Python 3 none any Details for code_storyteller-0.1.0-py3-none-any.whl

Total release size: 81.4 kB

Release files / code_storyteller-0.1.0.tar.gz

Download URL code_storyteller-0.1.0.tar.gz
Size 43.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1940275608797d09b3974513dd28b9e836ff099abada2ed1df21a1dded15b737
BLAKE2b-256 checksum
How to use checksums
e7f61ed0d4013acaef3c021cb0c8fbbd5e5b0f8880b531f3857f8362cf7c53c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / code_storyteller-0.1.0-py3-none-any.whl

Download URL code_storyteller-0.1.0-py3-none-any.whl
Size 37.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a1e8ddd95cff1f27b892836049c8ebe327dfd35e9118407f8ae658cea2fc8ef
BLAKE2b-256 checksum
How to use checksums
2a99bcf6008c2881b2c498bbe82a226fa1bd5a61c0ffe54e475b84727ced70c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for code-storyteller 0.1.0

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