From 06947ebbc17e27dadb0939784410f195084a6458 Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Fri, 27 Nov 2015 13:55:24 +0100 Subject: [PATCH] [yaml2json] Inital commit on these scripts --- Makefile | 2 ++ json2yaml | 6 ++++++ yaml2json | 5 +++++ 3 files changed, 13 insertions(+) create mode 100755 json2yaml create mode 100755 yaml2json 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) -- 2.39.2