Task 1:
Given an input as json array (each element is a flat dictionary) write a program that will parse this json, and return a nested dictionary of dictionaries of arrays, with keys specified in command line arguments and the leaf values as arrays of flat dictionaries matching appropriate groups
python nest.py nesting_level_1 nesting_level_2 … nesting_level_n
Example input for json can be found here: http://jsonformatter.org/74f158
When invoked like this:
cat input.json | python nest.py currency country city
the output should be something like this:
http://jsonformatter.org/615048
Please note that the nesting keys should be stripped out from the dictionaries in the leaves. Also please note that the program should support an arbitrary number of arguments, that is arbitrary level of nesting.