What a production report wants
- Scene list with heading, page-ish ordinal, and tags.
- Cast list with per-scene presence.
- Locations grouped and counted.
- Prop, wardrobe, SFX, VFX totals.
Every one of those is a query.
Scene list
jq -r '
.document.scenes[]
| [(.heading.no // "—"),
.heading.context,
.heading.setting,
.heading.time,
(.cast | length | tostring) + " cast",
(.props | length | tostring) + " props"]
| @tsv' screenplay.json
Day-out-of-days
For each character, which scene numbers they appear in:
jq '
.characters
| map({
name,
scenes: [ . as $c | $INDEX[] | select(.cast[]? == $c.id) | .heading.no ]
})' \
--slurpfile INDEX screenplay.json screenplay.json
(In practice you’ll write this in a script, not a one-liner.)
Location summary
jq '
[.document.scenes[]
| { location: .heading.setting,
context: .heading.context,
time: .heading.time }]
| group_by(.location)
| map({ location: .[0].location, scenes: length,
contexts: map(.context) | unique,
times: map(.time) | unique })' screenplay.json
Prop / SFX / VFX totals
jq '{ props: ([.document.scenes[].props[]] | unique | length),
sfx: ([.document.scenes[].sfx[]] | unique | length),
vfx: ([.document.scenes[].vfx[]] | unique | length),
wardrobe: ([.document.scenes[].wardrobe[]] | unique | length) }' screenplay.json
Render as HTML / PDF
Pipe the report into a template renderer of your choice
(mustache, ejs, pandoc) to produce a printable one-pager.