Skip to content

Xilu011 Sfx Csv

src.xil_pipeline.XILU011_sfx_csv

Flatten sfx_.json configs to CSV — one row per effect entry.

Each output row combines

• Episode metadata — show, season, episode, tag • Defaults — all defaults.* fields, prefixed with default_ • Effect identity — effect_key (the dict key used in the effects block) • Effect fields — prompt, type, source, duration_seconds, loop, volume_percentage, play_duration, ramp_in_seconds, ramp_out_seconds, prompt_influence

Missing optional fields are left blank. Useful for spotting misconfigured effects, auditing prompt coverage, or importing into a spreadsheet.

Usage:

xil sfx-csv                                  # all sfx configs in workspace
xil sfx-csv configs/the413/sfx_S04E02.json   # single file
xil sfx-csv configs/the413/                  # all sfx_*.json in a dir
xil sfx-csv --output sfx_debug.csv           # write to file
xil sfx-csv --json                           # JSON array to stdout

logger module-attribute

logger = get_logger(__name__)

ALL_COLS module-attribute

ALL_COLS = _META_COLS + _EFFECT_COLS + _DEFAULT_COLS

get_parser

get_parser() -> argparse.ArgumentParser
Source code in src/xil_pipeline/XILU011_sfx_csv.py
def get_parser() -> argparse.ArgumentParser:
    parser = argparse.ArgumentParser(
        prog="xil-sfx-csv",
        description="Flatten sfx_<tag>.json configs to CSV — one row per effect",
    )
    parser.add_argument(
        "path",
        nargs="?",
        default="__configs_default__",
        help="sfx JSON file, or directory containing sfx_*.json files (default: workspace configs/)",
    )
    parser.add_argument(
        "--output", "-o",
        default=None,
        metavar="FILE",
        help="Write CSV to FILE (default: stdout)",
    )
    parser.add_argument(
        "--json",
        action="store_true",
        help="Output a JSON array to stdout — no banner, safe to pipe to jq",
    )
    return parser

main

main() -> None

CLI entry point for sfx config CSV export.

Source code in src/xil_pipeline/XILU011_sfx_csv.py
def main() -> None:
    """CLI entry point for sfx config CSV export."""
    args = get_parser().parse_args()
    # When stdout carries data (--json or no --output), skip the banner so the
    # output is clean and pipeable directly to jq / csvkit / etc.
    if args.json or args.output is None:
        _run(args)
    else:
        configure_logging()
        with run_banner():
            _run(args)