summaryrefslogtreecommitdiff
path: root/utils/yaml2json.py
blob: 13ff64170a4f3c3649abda7e0286a0dee9605689 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python3
import yaml
import json
import sys

if __name__ == "__main__":
    i = open(sys.argv[1], "r") if sys.argv[1:] else sys.stdin
    o = open(sys.argv[2], "w") if sys.argv[2:] else sys.stdout
    o.write( json.dumps( yaml.safe_load( i.read() ), indent=4))
    i.close()
    o.close()