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: Prevue Studios, Inc.
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.1
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.1.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fountain_parser-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / fountain_parser-0.1.1.tar.gz
| Download URL | fountain_parser-0.1.1.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3702e2d1846c2e6324ec12e4fca6cab18deb72e445c477dc5eb52996fedaf842
|
|
BLAKE2b-256 checksum How to use checksums |
16dd00ac3d8fa7073cd5839b42edac4e1180a7e9a50dd1ab63db68b77f33c0af
|
| 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.1-py3-none-any.whl
| Download URL | fountain_parser-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cc39e887063e50b2eca9848357846ab077c9a429245823972b6433b56b22a88
|
|
BLAKE2b-256 checksum How to use checksums |
334bc910054f37f7ce5aef163093cfccfcc65ce978fdf49d27c24b06026cce78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|