Open the file with any text editor. Add a [ at the very beginning of the file, and a ] at the very end. This will transform the data you have into an actual valid JSON array.

Then use the json module to work with it.

(EDITED CORRECTED VERSION BASED ON COMMENTS, thx @martin-novosad)

import json
with open("example.json") as f:
  arr = json.load(f)
# Do nifty stuff with resulting array.
Answer from FrobberOfBits on Stack Overflow
๐ŸŒ
Real Python
realpython.com โ€บ python-json
Working With JSON Data in Python โ€“ Real Python
August 20, 2025 - How can you read JSON data from a file into a Python program?Show/Hide ยท You can use the json.load() function to deserialize JSON data from a file into a Python object.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
JSON encoder and decoder โ€” Python 3.14.3 documentation
3 weeks ago - fp can now be a binary file. The input encoding should be UTF-8, UTF-16 or UTF-32. Changed in version 3.11: The default parse_int of int() now limits the maximum length of the integer string via the interpreterโ€™s integer string conversion length limitation to help avoid denial of service attacks. json.loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)ยถ
Discussions

python - Reading JSON from a file - Stack Overflow
The distinction between undefined and empty is not always going to be made clear in JSON files. For example, several popular non-python librariesl convert empty lists (and empty dicts) into JSON null. 2024-06-25T10:43:19.273Z+00:00 ... json.loads() is still usable, but you need to modify the ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Python: read in an Array of json objects using json.loads() - Stack Overflow
Using with keeps you from having to close the file explicitly when you're finished. ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... New site design and philosophy for Stack Overflow: Starting February 24, 2026... 1 unable to load json file, huge array of objects, to create a dataframe in python... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Reading JSON file with Python 3 - Stack Overflow
I'm using Python 3.5.2 on Windows 10 x64. The JSON file I'm reading is this which is a JSON array containing 2 more arrays. I'm trying to parse this JSON file using the json module. As described i... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Help with decoding JSON file with multiple Objects
Load the content in the top level array and append to that, then write that new list to the file in write mode. That should work. More on reddit.com
๐ŸŒ r/learnpython
4
1
July 4, 2017
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_json.asp
Python JSON
Python has a built-in package called json, which can be used to work with JSON data. ... If you have a JSON string, you can parse it by using the json.loads() method.
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-read-json-file
Python Read JSON File
The JSON data is an array of objects. data.json ยท [ { "a": 85, "b": 71, "c": 39 }, { "d": 18, "e": 72, "f": 23 }, { "g": 18, "h": 62, "i": 43 } ] import json fileObject = open("data.json", "r") jsonContent = fileObject.read() aList = json.loads(jsonContent) print(aList[0]) print(aList[0]['c']) {'a': 85, 'b': 71, 'c': 39} 39 ยท In this Python JSON Tutorial, we learned how to read JSON file in Python and access values from the JSON content.
Find elsewhere
๐ŸŒ
Zyte
zyte.com โ€บ home โ€บ blog โ€บ json parsing with python [practical guide]
A Practical Guide to JSON Parsing with Python
July 6, 2023 - We load the data using the with open() context manager and json.load() to load the contents of the JSON file into a Python dictionary. ... After loading JSON data into Python, you can access specific data elements using the keys provided in ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
In the below code, firstly we import the JSON module, open the file using the file handling open() function, and then store the data into the variable 'data' using the json.load() function.
Published ย  April 2, 2025
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python โ€บ json โ€บ python json parsing using json.load() and loads()
Python JSON Parsing using json.load() and loads()
May 14, 2021 - Understand use of json.loads() and load() to parse JSON. Read JSON encoded data from a file or string and convert it into Python dict
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ python-read-json-file-how-to-load-json-from-a-file-and-parse-dumps
Python Read JSON File โ€“ How to Load JSON from a File and Parse Dumps
October 27, 2020 - This is a variable that we can use within the with statement to refer to the file object. ... json.load(file) creates and returns a new Python dictionary with the key-value pairs in the JSON file.
๐ŸŒ
Python Guides
pythonguides.com โ€บ json-data-in-python
How To Get Values From A JSON Array In Python?
November 29, 2024 - Let me show you another way to extract values from a JSON array is: by using list comprehension. List comprehension allows you to create a new list based on an existing list or iterable. Hereโ€™s an example: import json # Load JSON data from file with open('C:/Users/fewli/Downloads/Python/states.json') as file: data = json.load(file) state_names = [state['name'] for state in data] print("State Names:", state_names)
๐ŸŒ
Imperial College London
python.pages.doc.ic.ac.uk โ€บ java โ€บ lessons โ€บ java โ€บ 10-files โ€บ 03-load.html
Python for Java Programmers > Loading JSON files
The json module allows you to easily load a JSON file into its equivalent Python object (usually a dict or list). To load your data from a JSON file, use json.load(file_object).
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-loads-in-python
json.loads() in Python - GeeksforGeeks
Explanation: json.loads(s) parses the JSON string s and converts it into a Python dict. ... Return Type: Returns a Python object such as dict, list, int, float, or str depending on the JSON content.
Published ย  January 13, 2026
๐ŸŒ
Bobdc
bobdc.com โ€บ blog โ€บ pythonjson
Parsing JSON with Python
December 15, 2024 - { "mydata": { "color": "red", "amount": 3, "arrayTest": [ "north", "south", "east", "escaped \"test\" string", "west" ], "boolTest": true, "nullTest": null, "addressBookEntry": { "givenName": "Richard", "familyName": "Mutt", "address": { "street": "1 Main St", "city": "Springfield", "zip": "10045" } } } } ... #!/usr/bin/env python3 import json f = open('jsondemo.js') data = json.load(f) print(data["mydata"]["color"]) print(data["mydata"]["amount"]) # Pull something out of the middle of an array print(data["mydata"]["arrayTest"][3]) print(data["mydata"]["boolTest"]) print(data["mydata"]["nullTe
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ numpy โ€บ read-numeric-data-from-a-json-file-into-a-numpy-array.php
Read numeric data from a JSON file into a NumPy array
September 1, 2025 - Define JSON File Path: Specify the path to the JSON file containing the numeric data. Read JSON File into Python List: Open and read the JSON file using json.load() to load the contents into a Python list.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-load-in-python
json.load() in Python - GeeksforGeeks
August 11, 2025 - Values can be different JSON data types such as strings, numbers, booleans, arrays, or other JSON objects. json.load() function in Python is used to read a JSON file and convert it into a corresponding Python object, such as a dictionary or a list.