import pywikibot
import json

site = pywikibot.Site("test", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q98822")
itemdata = item.get()
dict_itemdata = json.loads(itemdata)
dict_itemdata.keys()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-efaa23d62ec0> in <module>()
      1 itemdata = item.get()
----> 2 dict_itemdata = json.loads(itemdata)
      3 dict_itemdata.keys()

/usr/lib/python3.6/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    346         if not isinstance(s, (bytes, bytearray)):
    347             raise TypeError('the JSON object must be str, bytes or bytearray, '
--> 348                             'not {!r}'.format(s.__class__.__name__))
    349         s = s.decode(detect_encoding(s), 'surrogatepass')
    350 

TypeError: the JSON object must be str, bytes or bytearray, not 'dict'
new_labels = {"en": "bear", "de": "Bär"}
item.editLabels(labels=new_labels, summary="Setting new labels.")