From 47ff0375813159d1fbfd987b7689cef9060dd48d Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Mon, 6 Jun 2022 21:48:48 +0100 Subject: [PATCH] Allow case insensitive dictionary lookup --- video_creation/voices.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video_creation/voices.py b/video_creation/voices.py index 8f8a23d..d57642d 100644 --- a/video_creation/voices.py +++ b/video_creation/voices.py @@ -17,3 +17,7 @@ def save_text_to_mp3(reddit_obj): """ text_to_mp3 = TTSEngine(tts.google_translate_tts, reddit_obj) return text_to_mp3.run() + + +def get_case_insensitive_key_value(input_dict, key): + return next((value for dict_key, value in input_dict.items() if dict_key.lower() == key.lower()), None) \ No newline at end of file