Questions tagged [pywikibot]

Pywikibot is a Python library to access the MediaWiki API.

Pywikibot

Pywikibot is a library to access the MediaWiki API. Its former name was .

Useful links

119 questions
1
vote
1 answer

How to add something to edit summary when using Pywikibot?

I am using Pywikibot at this moment, to add a lot of files in a category, and the Edit summary looks like this: "Bot: Adding category Taken with Sony DSC-WX350)" I would like to add the text "using Pywikibot in automatic mode" How to do that?
Fructibus
  • 145
  • 7
1
vote
1 answer

How to add a category to a list of files using Pywikibot and category.py?

I have a text file (in.txt) containing a list of Wikimedia Commons files and I want to add the category [[Category:Fruits]] to all of them, how can I do that? I can't find the option to specify the name of the category, so the script is prompting me…
Fructibus
  • 145
  • 7
1
vote
1 answer

Get "also known as"-properties from wikidata in pywikibot

im trying to extract the "also known as"-information from wikidata. E.g., by visiting the page of elvis(https://www.wikidata.org/wiki/Q303), i want to reach the information "Elvis, Elvis Aaron Presley, The King, The King Of Rock'n'Roll" I'm using…
Raphael B.
  • 72
  • 4
1
vote
2 answers

How to login to wikidata with pywikibot

I am trying to access data from wikidata using pywikibot. I am trying to do this with the name of the data object and not the code. When I run this script: import pywikibot site = pywikibot.Site("wikidata", "wikidata") repo =…
imc
  • 952
  • 2
  • 8
  • 20
1
vote
1 answer

Deadlock while using multiprocessing to speed up Pywikibot with Wikidata?

I’ve been having problems with speeding up Pywikibot. I’ve seen related questions here on StackOverflow, but they only partially apply to my problem: I set throttle=False wherever I could, but the bot is still very slow. I can’t use the…
Kaleidophon
  • 589
  • 1
  • 5
  • 16
1
vote
1 answer

what is the replacement of wikipedia.getSite()? or is it still usable?

I ran a pywikibot sample code, but it is aborted due to AttributeError. Traceback is ... Traceback (most recent call last): File "pwb.py", line 270, in if not main(): File "pwb.py", line 264, in main run_python_file(filename,…
H. Jang
  • 338
  • 3
  • 14
1
vote
1 answer

How to find out the name of an item having the wikidata code Q89 =>(apple)

How to find out the name of an item having the wikidata code Q89 (apple) , for properties I made a dictionary,but for item code I can't find anithing , I am using pywikibot for other operations , it is there any function do that?
Popovici Sebi
  • 258
  • 3
  • 13
1
vote
3 answers

How to extract information (e.g. types and subtypes) from Wikipedia?

I somehow want extract type information from Wikipedia. For example, I want to find: list of all "Carolina Panthers players" list of all "colors" list of all "NFL teams" list of all "month" Any ideas if there is a clean way of doing this?…
1
vote
1 answer

What is the regex to find any English words for find and replace mode of pywikibot

I wrote the following programme to delink the English words in a ta.wikipedia page. Delink means removal of square brackets which are before and after the English words. I am new to PAWS(pywikibot). It seems that to removal can done by…
info-farmer
  • 255
  • 3
  • 18
1
vote
1 answer

How to delete mediawiki pages using Nuke and Pywikibot

I have been racking my brain for a while with this task. I have tried, without success to use the Mediawiki Nuke extension and pywikibot. I am missing something simple here I know it. I can't seem to identify the pages correctly because none of the…
Phil
  • 306
  • 2
  • 10
1
vote
1 answer

How to detect maxlag exception in pywikibot

I am developing a Wikipedia bot to analyze editing contributions. Unfortunately, it takes hours to complete a single run and during that time Wikipedia's database replication delay—at some point during the run—is sure to exceed 5 seconds (the…
wallyk
  • 56,922
  • 16
  • 83
  • 148
1
vote
1 answer

Check whether an item with a certain label and description already exists on Wikidata by Pywikibot

I am looking for a way to find out whether an item with a certain label and description already exists on Wikidata. This task should be performed by the Pywikibot. I don't want my Bot to create a new item if it already exists. So far, my code looks…
TIlls
  • 55
  • 5
1
vote
1 answer

Get description of a Wikidata property?

How can we get a human readable property description of a Wikidata property (e.g.: P31) using pywikibot?
1
vote
0 answers

Issues while writing HTML file

Problem Why can't I set this variable html_str equal to the wikisum string variable? Is it a simple syntax error? Code import wikipedia from django.db import models from django.template import Template, Context wikisum = wikipedia.summary("Julius…
Dalí
  • 102
  • 1
  • 9
1
vote
1 answer

Python regex: how to replace string except if another string exist on the same line?

I am fixing the spell of some articles withreplace.pyby replacing "choeur" by "chœur". There are also file links in the mediawiki syntax : [[Fichier:Menditte (Pyr-Atl, Fr) choeur de l'église.JpG|thumb|Chœur de l'église]] Editing that kind of thing…
user2284570
  • 2,891
  • 3
  • 26
  • 74