I’ve always been a fan of jq. If you don’t know what jq is, it is a nifty tool with it’s own DSL that allows major JSON transformation from the command line. Read on about it here: https://stedolan.github.io/jq/
There are other flavours such as yq and xq both for YAML and XML support.
I was asked to do something for a WordPress migration and it needed the use of xq but i had never used it before. I knew it existed and my first reflex was to try:
sudo apt install xq
To no avail because well it doesn’t exist as an apt package. So i went on and tried
pip3 install xq
Success, it works… Until you realize it is a very old version. I was struggling at using it because it has poor support that is until i messed up my install on another server and installed yq instead and realized that xq comes with it.
So, do not install the xq package from pypi.
Install install only yq from pypi and you can use xq and yq. Remember to install jq too or it won’t work.
PS: Don’t install jq from pypi, it seems to bug at least on my machines, just use the apt package instead.