Does writing JSON in a single line create any problem?

Question:

I have used json.dump() without indent

with open (JSONfilename, 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False)
f.close()

This saves all of JSON data in a single line. I have done this because I noticed that using indent=4 for formatting JSON file increases it size. Is saving big JSON file in single line ok or will I encounter any problem in future?

Edit: Does it effect on saving, loading or parsing time?

Asked By: nirajgiriXD

||

Answers:

Well, people will have trouble reading it, if you consider that a problem.

The JSON parser ignores whitespace outside of quotation marks.

Answered By: Michael Lorton

The format of .json file will be okay.
I want to add one ‘Important@ thing. While reading the same file, json.load module only can read till 226538 column length in one line. If you data is much larger, It will cause this extra data problem in one line.

Answered By: M.Naveed Riaz
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.