I have this massive BASH script that I use for transcoding video files that I download before adding them to my Jellyfin library (don't ask me for it, it's a giant mess).

I recently wanted to make a change to it that required sorting some data according to some specific rules (like moving English subtitles first, but only if they're text-based like srt and not image-based like DVD subs).

It was too complicated for BASH. So, I did what anybody reasonable psychopath would do: I embedded a Python script into my BASH script.

No, I didn't rewrite the whole thing in Python, but I do have an entire Python script in the middle of my BASH script now. My BASH script pipes the Python code into the Python interpreter, and captures JSON output from it.

It's a terrible abomination, but, I might do it again.