From ecc330bcbc64e0f1b54e91e77e327b5031e713cd Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Thu, 8 Feb 2018 10:54:51 +0100 Subject: [PATCH] helper script to reverse the order of a json --- scripts/reversejson.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 scripts/reversejson.py diff --git a/scripts/reversejson.py b/scripts/reversejson.py new file mode 100644 index 0000000..fa6ccac --- /dev/null +++ b/scripts/reversejson.py @@ -0,0 +1,6 @@ +#reversejson.py +import sys, json + +for i in sorted([json.loads(line) for line in sys.stdin], key=lambda x: x['date']): + print json.dumps(i) +