I have exported some log data from a Firebase app to a json file. The file structure looks like this:
{
"-LT3ty7Hma7uXWDHmJjH": {
"id": "-LT3ty7Hma7uXWDHmJjH",
"message": "jo",
"time": 1544123048630
},
"-LT3tzmgUQkHJaaYBY6d": {
"id": "-LT3tzmgUQkHJaaYBY6d",
"message": "bla bla bla",
"time": 1544123055429
},
...
}
Problem: When i use this code ...
import json
arr = json.loads("log.json")
print(arr)
... i get the error message json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
. I tried replacing the curly braces at the very end with square brackets to make it an array, same error.
Goal: In the end, want to get a python list of dictionaries like this:
[
{
"id": "-LT3ty7Hma7uXWDHmJjH",
"message": "jo",
"time": 1544123048630
},
{
"id": "-LT3tzmgUQkHJaaYBY6d",
"message": "bla bla bla",
"time": 1544123055429
},
...
]
What am i doing wrong?
Thanks or your help!