https://betterprogramming.pub/too-many-if-elif-conditions-in-python-use-dictionaries-instead-5486299af27e
I've blundered into this technique myself to make up for the lack of case statement. Their implementation is a bit cleaner than mine.