diff options
Diffstat (limited to 'jimbrella/utils.py')
-rw-r--r-- | jimbrella/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/jimbrella/utils.py b/jimbrella/utils.py new file mode 100644 index 0000000..a9f4623 --- /dev/null +++ b/jimbrella/utils.py @@ -0,0 +1,6 @@ +def group_by_status(umbrellas: list) -> dict: + keys = set([umb["status"] for umb in umbrellas]) + statuses = {} + for key in keys: + statuses[key] = [umb for umb in umbrellas if umb["status"] == key] + return statuses |