Created
August 31, 2026 04:36
-
-
Save enakai00/5b38addf1a32ba97712ed1e63788a527 to your computer and use it in GitHub Desktop.
camel_case_keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def camel_case_keys(self, events): | |
| def to_camel_case(snake_str): | |
| elems = snake_str.split('_') | |
| return elems[0] + ''.join(x.capitalize() for x in elems[1:]) | |
| return json.loads( | |
| json.dumps(events), | |
| object_hook=lambda d: {to_camel_case(k): v for k, v in d.items()}, | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment