Last active
September 5, 2019 22:54
-
-
Save xbalaji/2e8d262dbacf3d120394981143b173a7 to your computer and use it in GitHub Desktop.
xml to yaml python one-liner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat "xml-file" | python3 -c 'import sys,xmltodict,yaml,json; print(yaml.dump(json.loads(json.dumps(xmltodict.parse(sys.stdin.read())))))' | |
aws ec2 describe-vpn-connections | jq -r '.VpnConnections[].CustomerGatewayConfiguration' | python3 -c 'import sys,xmltodict,yaml,json; print(yaml.dump(json.loads(json.dumps(xmltodict.parse(sys.stdin.read())))))' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment