import pywikibot

site = pywikibot.Site("test", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q98444")

new_labels = {"fr":"ok"}
new_descr = {"fr": "salut"}

item.editLabels(labels=new_labels, summary="Setting new labels.")
item.editDescriptions(new_descr, summary="Setting new descriptions.")
Sleeping for 8.5 seconds, 2018-09-17 17:03:35
Sleeping for 9.5 seconds, 2018-09-17 17:03:44
import pywikibot

site = pywikibot.Site("wikidata", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q45470339")

#new_labels = {"fr":"ok"}
new_descr = {"fr": "article scientifique"}

#item.editLabels(labels=new_labels, summary="Setting new labels.")
item.editDescriptions(new_descr, summary="traduction")
Sleeping for 8.8 seconds, 2018-09-17 17:06:00
import pywikibot

site = pywikibot.Site("test", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q132172")

item_dict = item.get()
if item_dict["description"]["en"] == "sNEEMsauTAxahwvawaAH":
    new_descr = {"fr": "salut"}
    item.editDescriptions(new_descr, summary="test")

#item.editLabels(labels=new_labels, summary="Setting new labels.")
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-1-b8bfa4532745> in <module>()
      6 
      7 item_dict = item.get()
----> 8 if item_dict["description"]["en"] == "sNEEMsauTAxahwvawaAH":
      9     new_descr = {"fr": "salut"}
     10     item.editDescriptions(new_descr, summary="test")

KeyError: 'description'
import pywikibot

site = pywikibot.Site("test", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q132172")

item_dict = item.get()
if item_dict["descriptions"]["en"] == "sNEEMsauTAxahwvawaAH":
    new_descr = {"fr": "salut"}
    item.editDescriptions(new_descr, summary="test")

#item.editLabels(labels=new_labels, summary="Setting new labels.")
import pywikibot

site = pywikibot.Site("test", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q132172")

item_dict = item.get()
if item_dict["descriptions"]["fr"] == "sNEEMsauTAxahwvawaAH":
    new_descr = {"fr": "salut2"}
    item.editDescriptions(new_descr, summary="test")
import pywikibot

site = pywikibot.Site("test", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q132172")

item_dict = item.get()
if item_dict["descriptions"]["fr"] == "salut":
    new_descr = {"fr": "salut2"}
    item.editDescriptions(new_descr, summary="test")
import pywikibot

site = pywikibot.Site("wikidata", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q50591155")

item_dict = item.get()
if item_dict["descriptions"]["en""] == "scientific article":
    new_descr = {"fr": "article scientifique"}
    item.editDescriptions(new_descr, summary="translation/traduction/traducion")
  File "<ipython-input-5-520380c5caf3>", line 8
    if item_dict["descriptions"]["en""] == "scientific article":
                                                     ^
SyntaxError: invalid syntax
import pywikibot

site = pywikibot.Site("wikidata", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q50591155")

item_dict = item.get()
if item_dict["descriptions"]["en"] == "scientific article":
    new_descr = {"fr": "article scientifique"}
    item.editDescriptions(new_descr, summary="translation/traduction/traducion")
Sleeping for 8.6 seconds, 2018-09-18 15:47:22
import pywikibot
x = 0
liste = ["Q47771538", "Q54596587", "Q43513615", "Q39426741"]
while x < len(liste):
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.ItemPage(repo, liste[x])

    item_dict = item.get()
    x+=1
    if item_dict["descriptions"]["en"] == "scientific article":
        new_descr = {"fr": "article scientifique"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
Sleeping for 9.3 seconds, 2018-09-18 16:13:38
Sleeping for 9.3 seconds, 2018-09-18 16:13:48
Sleeping for 9.3 seconds, 2018-09-18 16:13:58
import pywikibot
x = 0
liste = ["Q38333449", "Q55724773", "Q55724490", "Q55724476", "Q55724553", "Q55724715", "Q55724757", "Q55724773"]
while x < len(liste):
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.ItemPage(repo, liste[x])

    item_dict = item.get()
    x+=1
    if item_dict["descriptions"]["en"] == "scientific article":
        new_descr = {"fr": "article scientifique"}
        new_descr = {'es': 'artículo científico'}
        new_descr = {'it': 'articolo scientifico'}
        new_descr = {'ru': 'научная статья'}
        new_descr = {'de': 'wissenschaftlicher Artikel'}
        new_descr = {'eu': 'zientzia-artikulu'}
        new_descr = {'eo': 'scienca artikolo'}
        new_descr = {'ar': 'مقالة علمية'}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
Sleeping for 8.9 seconds, 2018-11-07 14:58:33
Sleeping for 8.8 seconds, 2018-11-07 14:58:43
Sleeping for 9.2 seconds, 2018-11-07 14:58:53
Sleeping for 9.1 seconds, 2018-11-07 14:59:03
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-1-2f8eb0371c70> in <module>()
     18         new_descr = {'eo': 'scienca artikolo'}
     19         new_descr = {'ar': 'مقالة علمية'}
---> 20         item.editDescriptions(new_descr, summary="translation/traduction/traducion")

/srv/paws/pwb/pywikibot/page.py in editDescriptions(self, descriptions, **kwargs)
   4225         """
   4226         data = {'descriptions': descriptions}
-> 4227         self.editEntity(data, **kwargs)
   4228 
   4229     def editAliases(self, aliases, **kwargs):

/srv/paws/pwb/pywikibot/page.py in wrapper(self, *args, **kwargs)
    128             pywikibot.async_request(handle, func, self, *args, **kwargs)
    129         else:
--> 130             handle(func, self, *args, **kwargs)
    131 
    132     manage_wrapping(wrapper, func)

/srv/paws/pwb/pywikibot/page.py in handle(func, self, *args, **kwargs)
    107         err = None
    108         try:
--> 109             func(self, *args, **kwargs)
    110         # TODO: other "expected" error types to catch?
    111         except pywikibot.Error as edit_err:

/srv/paws/pwb/pywikibot/page.py in editEntity(self, data, **kwargs)
   4193 
   4194         updates = self.repo.editEntity(self._defined_by(singular=True), data,
-> 4195                                        baserevid=baserevid, **kwargs)
   4196         self.latest_revision_id = updates['entity']['lastrevid']
   4197 

/srv/paws/pwb/pywikibot/site.py in callee(self, *args, **kwargs)
   1321             else:
   1322                 raise Exception('Not implemented')
-> 1323             return fn(self, *args, **kwargs)
   1324 
   1325         if not __debug__:

/srv/paws/pwb/pywikibot/site.py in editEntity(self, identification, data, bot, **kwargs)
   7763         params['data'] = json.dumps(data)
   7764         req = self._simple_request(**params)
-> 7765         data = req.submit()
   7766         return data
   7767 

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2169 
   2170             if self.throttle:
-> 2171                 self.site.throttle(write=self.write)
   2172             else:
   2173                 pywikibot.log(

/srv/paws/pwb/pywikibot/throttle.py in __call__(self, requestsize, write)
    276             self.next_multiplicity = math.log(1 + requestsize) / math.log(2.0)
    277 
--> 278             self.wait(wait)
    279 
    280             if write:

/srv/paws/pwb/pywikibot/throttle.py in wait(self, seconds)
    254             pywikibot.log(message)
    255 
--> 256         time.sleep(seconds)
    257 
    258     def __call__(self, requestsize=1, write=False):

KeyboardInterrupt: 
import pywikibot
x = 0
liste = ["Q38333449"]
while x < len(liste):
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.ItemPage(repo, liste[x])

    item_dict = item.get()
    x+=1
    if item_dict["descriptions"]["en"] == "scientific article":
        new_descr = {"fr": "article scientifique"}
        new_descr = {"es": "artículo científico"}
        new_descr = {"it": "articolo scientifico"}
        new_descr = {"ru": "научная статья"}
        new_descr = {"de": "wissenschaftlicher Artikel"}
        new_descr = {"eu": "zientzia-artikulu"}
        new_descr = {"eo": "scienca artikolo"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
import pywikibot
x = 0
liste = ["Q38333449"]
while x < len(liste):
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.ItemPage(repo, liste[x])

    item_dict = item.get()
    x+=1
    if item_dict["descriptions"]["en"] == "scientific article":
        new_descr = {"fr": "article scientifique"}
        new_descr = {"es": "artículo científico"}
        new_descr = {"it": "articolo scientifico"}
        new_descr = {"ru": "научная статья"}
        new_descr = {"de": "wissenschaftlicher Artikel"}
        new_descr = {"eu": "zientzia-artikulu"}
        new_descr = {"eo": "scienca artikolo"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
import pywikibot
x = 0
liste = ["Q38333449"]
while x < len(liste):
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.ItemPage(repo, liste[x])

    item_dict = item.get()
    x+=1
    if item_dict["descriptions"]["en"] == "scientific article":
        new_descr = {"fr": "article scientifique"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"es": "artículo científico"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"it": "articolo scientifico"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"ru": "научная статья"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"de": "wissenschaftlicher Artikel"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"eu": "zientzia-artikulu"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"eo": "scienca artikolo"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
Sleeping for 8.4 seconds, 2018-11-07 15:07:55
Sleeping for 8.9 seconds, 2018-11-07 15:08:04
Sleeping for 9.2 seconds, 2018-11-07 15:08:14
Sleeping for 9.1 seconds, 2018-11-07 15:08:24
Sleeping for 8.7 seconds, 2018-11-07 15:08:35
Sleeping for 9.2 seconds, 2018-11-07 15:08:44
import pywikibot
x = 0
liste = ["Q38333449"]
while x < len(liste):
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.ItemPage(repo, liste[x])

    item_dict = item.get()
    x+=1
    if item_dict["descriptions"]["en"] == "scientific article":
        new_descr = {"fr": "article scientifique"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"es": "artículo científico"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"it": "articolo scientifico"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"ru": "научная статья"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"de": "wissenschaftlicher Artikel"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"eu": "zientzia-artikulu"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"eo": "scienca artikolo"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")"]
while x < len(liste):
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.ItemPage(repo, liste[x])

    item_dict = item.get()
    x+=1
    if item_dict["descriptions"]["en"] == "scientific article":
        new_descr = {"fr": "article scientifique"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"es": "artículo científico"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"it": "articolo scientifico"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"ru": "научная статья"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"de": "wissenschaftlicher Artikel"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"eu": "zientzia-artikulu"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")
        new_descr = {"eo": "scienca artikolo"}
        item.editDescriptions(new_descr, summary="translation/traduction/traducion")