flatson
flatson copied to clipboard
Support unpacking arrays into fixed number of objects
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).