Is it because there is no "text" key in the line, or because "delete" is not in the dictionary?
This is because there is no βtext" key. If you print temp or check if the key 'text' in the resulting Python dictionary, you will notice that there is no key named 'text' . In fact, temp has only one key: 'delete' . The dictionary referenced by 'delete' contains one key 'status' , which contains another dictionary with two keys: 'user_id' and 'id' .
In other words, your structure is as follows:
{ "delete" : { "status" : { "id" : 12600579001, "user_id" : 55389449 } } }
As you can see, there is no text key anywhere.
Alternatively, you can check it yourself:
>>> 'text' in temp False >>> 'delete' in temp True
Dustin
source share