I am searching for a way to merge multiple JSONs into a single one. My output is in this format:
[{"Nome bollettino": "Bollettino 1"}, {"Causale": "1"}, {"Numero": "1"}]
[{"Nome bollettino": "Bollettino 2"}, {"Causale": "2"}, {"Numero": "2"}]
[{"Nome bollettino": "Bollettino 3"}, {"Causale": "3"}, {"Numero": "3"}]
[{"Nome bollettino": "Bollettino 4"}, {"Causale": "4"}, {"Numero": "4"}]
[{"Nome bollettino": "Bollettino 5"}, {"Causale": "5"}, {"Numero": "5"}]
[{"Nome bollettino": "Bollettino 6"}, {"Causale": "6"}, {"Numero": "6"}]
[{"Nome bollettino": "Bollettino 7"}, {"Causale": "7"}, {"Numero": "7"}]
[{"Nome bollettino": "Bollettino 8"}, {"Causale": "8"}, {"Numero": "8"}]
[{"Nome bollettino": "Bollettino 9"}, {"Causale": "9"}, {"Numero": "9"}]
[{"Nome bollettino": "Bollettino 10"}, {"Causale": "10"}, {"Numero": "10"}]
Every single line is a valid JSON. I a looking for a way to do it in Python, like this site do. Here you can find the code I am using to generate JSON data.
I have tried to use jsonmerge
and json-merger
but it's not so effective. The site above do the work perfect but I need to do it in Python.
Particularly, with jsonmerge
using the syntax from the documentation, the output is only the first two values...
result = merge(bollettini, causale, numero)
print(result){'Nome bollettino': 'Bollettino 1', 'Causale': '1'}
{'Nome bollettino': 'Bollettino 2', 'Causale': '2'}
{'Nome bollettino': 'Bollettino 3', 'Causale': '3'}etc...
...which are not even JSON's.
How to merge them ?