The idea of JSON output is brought up regularly.
Very interesting project that helps with that is https://wiki.freebsd.org/LibXo
Meanwhile, there is jc so that
jc df
returns JSON. See https://github.com/kellyjonbrazil/jc
Hope this helps.
Or just use a shell that understands JSON and can just pipe the output to JSON. In Nushell you can query the free space and then add `| to json` and you are done.
df -h --json
so we do not need parsers for every tool, but one coherent format which is already popular and has built in parser for every lang out there