How do I get a list of key:value pairs into an iterable data structure