From: Gustav Eek Date: Fri, 27 Nov 2015 12:55:24 +0000 (+0100) Subject: [yaml2json] Inital commit on these scripts X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=06947ebbc17e27dadb0939784410f195084a6458;p=users%2Fgustav%2Fscripts.git [yaml2json] Inital commit on these scripts --- diff --git a/Makefile b/Makefile index 7f114e1..bc81ab7 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ msmtp-notify \ repo-encrypt \ exiv2-common-edits \ confluence-tk \ +json2yaml \ +yaml2json \ bash-completion = \ repo-encrypt \ diff --git a/json2yaml b/json2yaml new file mode 100755 index 0000000..43fdda4 --- /dev/null +++ b/json2yaml @@ -0,0 +1,6 @@ +#!/usr/bin/python +import sys, yaml, json +yaml.safe_dump( + json.load(sys.stdin), + sys.stdout, + default_flow_style=False) diff --git a/yaml2json b/yaml2json new file mode 100755 index 0000000..b425c10 --- /dev/null +++ b/yaml2json @@ -0,0 +1,5 @@ +#!/usr/bin/python +import sys, yaml, json +json.dump( + yaml.load(sys.stdin), + sys.stdout, indent=4)