import pywikibot
site = pywikibot.Site('test', 'wikidata')
site
DataSite("test", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q58878")

new_labels = {"en": "bear", "de": "Bär"}
new_descr = {"en": "gentle creature of the forrest", "de": "Friedlicher Waldbewohner"}
new_alias = {"en": ["brown bear", "grizzly bear", "polar bear"], "de": ["Braunbär", "Grizzlybär", "Eisbär"]}
item.editLabels(labels=new_labels, summary="Setting new labels.")
item.editDescriptions(new_descr, summary="Setting new descriptions.")
item.editAliases(new_alias, summary="Setting new aliases.")
Sleeping for 9.5 seconds, 2017-04-21 10:03:11
WARNING: API error modification-failed: Item [[Q1124|Q1124]] already has label "Bär" associated with language code de, using the same description text.
---------------------------------------------------------------------------
APIError                                  Traceback (most recent call last)
<ipython-input-17-3792b8d54059> in <module>()
      6 new_alias = {"en": ["brown bear", "grizzly bear", "polar bear"], "de": ["Braunbär", "Grizzlybär", "Eisbär"]}
      7 item.editLabels(labels=new_labels, summary="Setting new labels.")
----> 8 item.editDescriptions(new_descr, summary="Setting new descriptions.")
      9 item.editAliases(new_alias, summary="Setting new aliases.")

/srv/paws/pwb/pywikibot/page.py in editDescriptions(self, descriptions, **kwargs)
   3896         """
   3897         data = {'descriptions': descriptions}
-> 3898         self.editEntity(data, **kwargs)
   3899 
   3900     def editAliases(self, aliases, **kwargs):

/srv/paws/pwb/pywikibot/page.py in editEntity(self, data, **kwargs)
   3867 
   3868         updates = self.repo.editEntity(self._defined_by(singular=True), data,
-> 3869                                        baserevid=baserevid, **kwargs)
   3870         self.latest_revision_id = updates['entity']['lastrevid']
   3871 

/srv/paws/pwb/pywikibot/site.py in callee(self, *args, **kwargs)
   1328             else:
   1329                 raise Exception("Not implemented")
-> 1330             return fn(self, *args, **kwargs)
   1331 
   1332         if not __debug__:

/srv/paws/pwb/pywikibot/site.py in editEntity(self, identification, data, bot, **kwargs)
   7289         params['data'] = json.dumps(data)
   7290         req = self._simple_request(**params)
-> 7291         data = req.submit()
   7292         return data
   7293 

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2187                               % result)
   2188 
-> 2189                 raise APIError(**result['error'])
   2190             except TypeError:
   2191                 raise RuntimeError(result)

APIError: modification-failed: Item [[Q1124|Q1124]] already has label "Bär" associated with language code de, using the same description text. [messages:[{'html': {'*': 'Item <a href="/wiki/Q1124" title="Q1124">Q1124</a> already has label "Bär" associated with language code de, using the same description text.'}, 'name': 'wikibase-validator-label-with-description-conflict', 'parameters': ['Bär', 'de', '[[Q1124|Q1124]]']}]; help:See https://test.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes.]
page.exists()
False
page = pywikibot.Page(site, "Q4115189")
page = pywikibot.Page(repo, "Q4115189")
site
DataSite("test", "wikidata")
new_item = pywikibot.ItemPage(site)
new_item.getID()
'-1'
new_item.exists()
True
new_item = pywikibot.ItemPage(site)
some_labels = {"en": "Hamburg Main Station", "de": "Hamburg Hauptbahnhof"}
new_item.editLabels(labels=some_labels, summary="Setting labels")
new_item.getID()
'Q58878'