vagrant@ubuntu-xenial:/vagrant$ flatten-tool flatten -f csv -o standard/example1.csv standard/example1.json
Traceback (most recent call last):
File "/usr/local/bin/flatten-tool", line 6, in <module>
exec(compile(open(__file__).read(), __file__, 'exec'))
File "/vagrant/src/flattentool/flatten-tool", line 3, in <module>
flattentool.cli.main()
File "/vagrant/src/flattentool/flattentool/cli.py", line 212, in main
flatten(**kwargs_from_parsed_args(args))
File "/vagrant/src/flattentool/flattentool/__init__.py", line 69, in flatten
parser.parse()
File "/vagrant/src/flattentool/flattentool/json_input.py", line 98, in parse
root_json_list = path_search(self.root_json_dict, self.root_list_path.split('/'))
File "/vagrant/src/flattentool/flattentool/input.py", line 794, in path_search
nested_dict[parent_field] = OrderedDict()
TypeError: list indices must be integers or slices, not str
It seems to not like the list being the root element.
{"main":[
{
"id": "id1",
"title": "Passport Check for James",
"date_added": "2018-02-13"
},
{
"id": "id2",
"title": "Insurance certificate",
"date_added": "2016-01-13"
}
]
}
It flattens fine.
Currently reading docs to work out .....