From 69dea5adb17d5bb8e4c10cddbc01508a0d5b5324 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 21 Jul 2022 10:04:32 +0200 Subject: omit null values in JSON output --- proposals.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proposals.py b/proposals.py index 157e727..3ecc962 100755 --- a/proposals.py +++ b/proposals.py @@ -152,4 +152,6 @@ def sort_key(proposal): proposals.sort(key=sort_key, reverse=True) -json.dump(proposals, sys.stdout) +json.dump( + [{k: v for k, v in p.items() if v is not None} for p in proposals], sys.stdout +) -- cgit v1.2.3