Created
June 7, 2022 20:16
-
-
Save techsolx/2e7e36d37fa6a4996b877c3dd4686a5b to your computer and use it in GitHub Desktop.
Convert yaml to json using python. To use: cat <input.yaml> | yaml2json | tee <output.json>
This file contains 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
#! /usr/bin/env python3 | |
import json | |
import sys | |
import yaml | |
f = yaml.safe_load(sys.stdin.read()) | |
json.dump(f, sys.stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment