fountain-parser
A fast, lightweight, zero-dependency, typed AST parser for the Fountain screenplay format in Python.
Built with Python standard library @dataclass models and strict adherence to the Fountain 1.1 specification.
Features
- Zero Third-Party Dependencies: Pure Python standard library (
dataclasses,enum,typing,re). - Fully Typed: Complete type hinting for all AST nodes.
- Spec-Compliant: Supports Title Pages, Scene Headings (forced & unforced), Characters, Extensions (V.O., O.S.), Dual Dialogue (
^), Parentheticals, Dialogue, Transitions, Actions, Sections, Synopses, Page Breaks, and Boneyards. - Scene-Level Grouping: Convenience
.scenesand.dialogue_blocksproperties for instant pipeline consumption.
Installation
pip install fountain-parser
(Or for local development: pip install -e .)
Quick Start
from fountain_parser import parse
script = """
Title: The Diner
Author: Forest Taylor
INT. DINER - NIGHT #1#
Jacob sits across from Violet.
JACOB
(whispering)
Vi, I'm sorry.
VIOLET
(coldly)
You should be.
"""
screenplay = parse(script)
# Title page metadata
print(screenplay.title_page["Title"]) # ['The Diner']
# Access grouped scenes
for scene in screenplay.scenes:
print(scene.heading.text) # "INT. DINER - NIGHT"
print(scene.heading.scene_number) # "1"
# Iterate over dialogue blocks
for block in scene.dialogue_blocks:
print(f"{block.character.name}: {block.spoken_text}")
# JACOB: Vi, I'm sorry.
# VIOLET: You should be.
Metadata
Release files for fountain-parser 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fountain_parser-0.1.0.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fountain_parser-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / fountain_parser-0.1.0.tar.gz
| Download URL | fountain_parser-0.1.0.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25e6603ac04cfde5dd2edd7f94d9456ca99625ac5b41e9891ae5ac4ac4945bbe
|
|
BLAKE2b-256 checksum How to use checksums |
7bb11d181625c897aa68a54edd68f69ba9d2f264e966b0234bc71e48fb44e7db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / fountain_parser-0.1.0-py3-none-any.whl
| Download URL | fountain_parser-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb98811ff39fb141de05d69ffa231a5e1dd11eb7974ad8fd8f60f09183c4de5a
|
|
BLAKE2b-256 checksum How to use checksums |
c87d56e68ded86c2a319ed345eb129c7f767fd7664f2b2786685dae272491e06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|