flatson icon indicating copy to clipboard operation
flatson copied to clipboard

Support unpacking arrays into fixed number of objects

Open eliasdorneles opened this issue 8 years ago • 0 comments

In some cases, a dataset will have lists of objects with arbitrarity long size, but only a few first ones are really interesting.

It would be nice to have an option unpack them into objects in the upper-level, e.g.:

{'field': [{}, {}]}

would become, in an example output for flatten_dict():

{'field1': {}, 'field2': {}}

It should allow to specify the number of objects to consider (in fact, it may need to be a required configuration).

eliasdorneles avatar Sep 25 '15 20:09 eliasdorneles