Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created January 13, 2025 04:02
Show Gist options
  • Select an option

  • Save KyMidd/35fce493f37e3cded8a4e523979d52a4 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/35fce493f37e3cded8a4e523979d52a4 to your computer and use it in GitHub Desktop.
def isolate_event_body(event):
# Dump the event to a string, then load it as a dict
event_string = json.dumps(event, indent=2)
event_dict = json.loads(event_string)
# Isolate the event body from event package
event_body = event_dict["body"]
body = json.loads(event_body)
# Return the event
return body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment