Skip to content

Instantly share code, notes, and snippets.

@marksteve
Created May 4, 2015 09:27
Show Gist options
  • Save marksteve/26b7f77c87188c378b93 to your computer and use it in GitHub Desktop.
Save marksteve/26b7f77c87188c378b93 to your computer and use it in GitHub Desktop.
Simple redis key generation
from collections import OrderedDict
def key(*args, **kwargs):
kwargs = OrderedDict(kwargs)
return ":".join(
map(str, args) +
[key(*map(str, s)) for s in kwargs.items()]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment