Changelog¶
This file documents all notable changes to fountain-py.
This changelog follows Keep a Changelog, and the project uses Semantic Versioning.
Version 0.3.0: 2026-10-11¶
Added¶
Python 3.15 support, tested in CI
FountainElement.dual_dialogue_columns()returns the left and right columns of a dual-dialogue element (each a character cue followed by its dialogue), raisingValueErrorwhen the metadata is malformedFountainParser.parse_file()accepts any path-like object, not only a stringHypothesis property tests for parsing and the JSON round trip
Changed¶
Breaking: the minimum Python version is now 3.11; Python 3.10 reached end of life in October 2026
Breaking:
FountainElement.metadatais always a dict (defaulting to{}) and is no longer typeddict | None; pass{}instead ofNoneFountainDocument.from_dict()andfrom_json()validate their input and raiseValueErrornaming the bad field, instead of raisingKeyErroror accepting wrong typesThe
fountainCLI reports an unreadable input file on stderr and exits 1 instead of printing a tracebackThe parser resolves inline emphasis once per element instead of twice
Version 0.2.0: 2026-09-18¶
JSON Interchange¶
to_dict()recursively serializes nested elements, including dual-dialogue side elements, fixing a crash onto_json()for scripts with dual dialogueschema_versionkey in the serialized payload, backed by a versioned JSON Schema Reference reference docfrom_dict()/from_json()reconstruct a fullFountainDocumentfrom serialized data, round-tripping throughto_dict()/to_json(); raiseValueErroron an unrecognizedschema_version
Renderer Protocols¶
TextRendererandBinaryRendererprotocols infountain.renderers.base, formalizing the renderer contract; every existing renderer conforms
Plain-Text Renderer¶
PlainTextRendererrenders a parsed script to monospace plain text, with configurable width and indents; omits writer-only elements (notes, sections, synopses, boneyard)
Command-Line Interface¶
fountainCLI withvalidateandrender --formatsubcommands, installed via[project.scripts]Reads from a file path or stdin (
-);validatereports one diagnostic per line and exits non-zero on error-severity issues
FDX Export¶
FDXRendererexports a parsed script to Final Draft’s.fdxXML format using only the standard library, so it adds no runtime dependencyDual dialogue renders as a linked
<DualDialogue>block, pinned againsttests/fixtures/dual_dialogue.fdx
PDF Export¶
PDFRendererrenders a parsed script to PDF bytes via the optionalpdfextra (fpdf2), with a clear install hint when the extra is missingPageGeometrypresets for Letter, A4, and Half Letter page sizes, plus custom dimensions and a binding offsetSCREENPLAYlayout profile controlling font and per-element indents; layouts are pluggable viaLayoutProfileCI verifies the core install stays dependency-free and runs the PDF suite separately under the
pdfextra
Documentation¶
How-to guides for the CLI, plain-text export, FDX export, and PDF export
The JSON how-to now covers
from_json()/from_dict()round-tripping alongsideto_json()/to_dict()
Version 0.1.0: 2026-04-09¶
Parser: Full Fountain Spec Compliance¶
Two-pass parser: title page metadata extraction, then line-by-line element classification
All 15 Fountain element types: scene headings, action, character, dialogue, parenthetical, transitions, notes, boneyard, sections, synopses, dual dialogue, page breaks, centered text, lyrics
Forced element prefixes (
.,!,@,>) override natural detection rulesScene number extraction (
#1#,#2A#)Character extensions (
V.O.,O.S.,CONT'D) and automatic continuation detectionSection level metadata (
# Act= level 1,## Scene= level 2, etc.)Ellipsis protection on forced scene headings (
.+ alphanumeric only)Arbitrary title page keys (any
Key: Valuepair accepted)Requires a blank line before natural scene headings, character names, and transitions
Requires a blank line after transitions
Inline note stripping (
[[notes]]removed from element text in non-note elements)Multi-line note support
Dialogue continuation with whitespace-only lines
Backslash escaping for emphasis markers (
\*→ literal*,\_→ literal_)Tab preservation in action elements (rendered as 4 spaces in HTML)
Inline formatting: bold, italic, underline, bold-italic
Renderers¶
HTMLRendererwith three output modes:render(doc): pure HTML fragment for embedding (no<style>tags)render_page(doc): standalone HTML with embedded CSSget_css(): raw CSS string for external style sheet use
FountainRendererfor round-trip conversion back to Fountain markupAll CSS classes namespaced with
fountain-prefix to prevent framework collisionsScreenplay-formatted CSS: Courier font, proper margins, centered dialogue, hidden boneyard
Dual dialogue side-by-side layout via flexbox
Title page rendering with all standard and custom metadata fields
Document Analysis¶
FountainDocumentcontainer with element access and metadataget_characters(): extract unique character namesget_scenes(): list scene heading elementsget_statistics(): element counts by type, character count, scene countto_html(): convenience method for standalone HTML outputto_json(): JSON serializationto_dict(): dictionary conversion
Type System¶
Full type hints throughout, strict mypy compliance
FormatTypeliteral type ("bold","italic","underline","bold_italic")MetadataValueunion type for element metadata documentationPEP 561
py.typedmarker for downstream type checking
Quality¶
Unit tests and doctests across every module, with high coverage enforced in CI
Supports Python 3.10, 3.11, 3.12, 3.13, 3.14
Zero runtime dependencies
CI with GitHub Actions across all supported Python versions