From c902343c87b96e806905f4c60f5803ed15024484 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sun, 7 Aug 2022 19:11:45 +0200 Subject: [PATCH] sorted reviews in alphabetical order --- parse-md.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse-md.py b/parse-md.py index 12b208f..280ab77 100644 --- a/parse-md.py +++ b/parse-md.py @@ -324,7 +324,7 @@ if __name__ == '__main__': reviews = ReviewPostprocessor().process_all(parser.parse()) with open("reviews.json", 'w') as f: json.dump({ - 'reviews': reviews, + 'reviews': sorted(reviews, key=lambda review: tuple((review[key] or '').lower() for key in ('company', 'name', 'variant'))), 'created': str(datetime.date.today()) }, f, indent=2) except ParseError as err: