Skip to main content

Module parse

Module parse 

Source
Expand description

xil parse — production script markdown → structured JSON, plus the cast and SFX config skeletons. Port of XILP001_script_parser.py’s CLI.

Structs§

Args 🔒

Constants§

DEBUG_TRUNCATE 🔒

Statics§

BEAT_SECONDS 🔒

Functions§

apply_sfx_overrides 🔒
Apply attribute hints to one effect entry, in place. A play_duration hint clears duration_seconds on source-backed cues — the two are mutually exclusive and the skeleton default would contradict the hint.
backfill_sfx_sources 🔒
Fill missing source fields on an existing SFX config from parsed hints.
command
The clap definition behind --help, for man pages.
commas 🔒
f"{n:,}" — thousands separators.
default_duration 🔒
Default generation length by cue category.
defaults_block 🔒
docs_block 🔒
entry_overrides 🔒
Overrides carried on a parsed direction entry, as the JSON holds them.
execute 🔒
generate_cast_config 🔒
Write the cast skeleton: one entry per speaker found in the script.
generate_sfx_config 🔒
Write the SFX skeleton: one entry per unique direction.
hint_target_exists 🔒
Does a hint’s SFX/... path resolve on disk? Guards forced replacement: plenty of working sources are bare SFX/<file> with no slug-form twin.
join_strs 🔒
json_f64 🔒
or_default 🔒
x or default — a null, empty string or absent value takes the default.
print_dialogue_preview 🔒
print_speaker_stats 🔒
print_summary 🔒
run
run_parse 🔒
Parse the file at path with the project fallbacks applied.
title_case 🔒
Python str.title(): first letter of each run of letters uppercased.
truncate 🔒
with_extension_csv 🔒
os.path.splitext(p)[0] + ".csv".
write_debug_csv 🔒
write_json_no_newline 🔒
Both skeleton writers use json.dump with no trailing newline.