From bd9a605a7031bbf3b96c7e1d8c686c7614a16a8e Mon Sep 17 00:00:00 2001 From: Eric Carlson Date: Thu, 11 Apr 2024 10:44:38 -0400 Subject: [PATCH] Reverse sort output --- app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.py b/app.py index 3afca7b..f225024 100644 --- a/app.py +++ b/app.py @@ -70,6 +70,9 @@ def generate_json_output(generator_list): } generator_output.append(item_dict) + # Sort generator_output by last_modified date in reverse chronological order + generator_output.sort(key=lambda x: x['last_modified'], reverse=True) + # Create dict item with title of bucket name with values output_dict[generator_name] = generator_output