Skip to content

Instantly share code, notes, and snippets.

@hexsprite
Created June 30, 2013 23:29
Show Gist options
  • Select an option

  • Save hexsprite/5897452 to your computer and use it in GitHub Desktop.

Select an option

Save hexsprite/5897452 to your computer and use it in GitHub Desktop.
lowercase all dictionary keys recursively
def lowerdictkeys(d):
new = {}
for k, v in d.iteritems():
if type(v) == type({}):
v = lowerdictkeys(v)
k = k.lower()
new[k] = v
return new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment