How To Open Large JSON Files With PyCharm

How To Open Large JSON Files With PyCharm

Reading Time: 3 minutes

Opening large JSON files is not my passion. When I say large JSON I talk about megabytes of megabytes of data, say 150mb for example. I had a task recently where I needed to work with such file, and for that I just wanted to look at the structure of the document. Well apparently not chrome (with all extensions), not Sublime Text and not PyCharm (in the old fashion way of opening the file in the text editor) could handle this amount of data. I just wanted to check the structure and all I could get from all programs I tried is a load of ugly text.

PyCharm and Python is the solution

One of my co-workers who is a data scientist gave me a great cheat for this kind of problem. The only thing you need is PyCharm. Follow me:

  1. Open a project with PyCharm. This could be an empty project.
  2. Locate your file and copy its absolute path:

  3. In PyCharmopen the Python Console:
  4. Import the json module, open the file with python, cast file’s contents into a dictionary and now you can explore you’re file with a MUCH better view: