How can I concat a list of JSON files into a huge JSON array? I\'ve 5000 files and 550 000 list items.
My fist try was to use jq, but it looks like jq -s is not opt
As of simplejson 3.8.0, you can use the iterable_as_array option to make any iterable serializable into an array
# Since simplejson is backwards compatible, you should feel free to import
# it as `json`
import simplejson as json
json.dumps((i*i for i in range(10)), iterable_as_array=True)
result is [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]