I used jq for something similar before, recently I’ve discovered Nu Shell and have been using that for converting and analyzing data since a full shell is a lot more powerful than a command (e.g. open a yaml, for each element on key X grab the first element of list Y and export to a CSV)
Check out https://www.nushell.sh/ I use it for exactly that, i.e. complex extract and convert files