glom
glom copied to clipboard
add [{key: k, value: v}] <-> {k: v} example
either in merge docstring, or cookbook add a doc for exploding / collapsing keys
([{T['key']: 'value'}], Merge())
(T.items(), [{'key': T[0], 'value': T[1]}])
Interesting. Is there some API of note that takes the format {'key': <key>, 'value': <value>}
?
the narrow use case was some internal stuff
this could be called "Pivot" -- since it is taking row-of-(key + val) and turning it into row-of-(key1 + key2 + ...)
an explicit Pivot()
spec that e.g. normalizes the set of keys might be helpful; although I don't have an organic use case for that so not 100% confident it makes sense