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
3
votes
2 answers

pywikibot: how to handle user-config.py owned by someone else?

I am probably using pywikibot in ways that were beyond the ways the project was intended. I want several users to use the same user-config.py. Unfortunately this gives me this error: WARNING: Skipped '...pywikibot/user-config.py': owned by someone…
the
  • 21,007
  • 11
  • 68
  • 101
3
votes
1 answer

Do lower MediaWiki page revision IDs always mean earlier edits?

In general it seems true, at least for a single page, that lower revision IDs for Mediawiki page histories mean an earlier edit time. Is this true in General? Are there ever exceptions? How does revision ID minting work? I am trying attempting…
notconfusing
  • 2,556
  • 3
  • 22
  • 26
3
votes
2 answers

pywikipedia bot with https and http authentication

I'm having trouble getting my bot to login to a MediaWiki install on the intranet. I believe it is due to the http authentication protecting the wiki. Facts: The wiki root is: https://local.example.com/mywiki/ When visiting the wiki with a web…
Jake
  • 2,515
  • 5
  • 26
  • 41
2
votes
1 answer

Login and accessing wikipedia API using pywikipedia

I am new to python. I have a task to access wikipedia. For this I am using the client pywikipedia to access mediawiki api. WHen I am running login.py it is asking me password. how will I get the password? has somebody worked on pywikipedia tool? Any…
Shruts_me
  • 843
  • 2
  • 12
  • 24
2
votes
2 answers

How to list all anonymous (so IP-public) edits made to Wikipedia from a specific IP address?

Lets say I have an IP address, for example the IP address of the Hungarian Parliament: 193.224.28.151 How can I get a list of all Wikipeida edits made using this IP address? On a Tom Scott webpage, I read: Here's a fact: Wikipedia stores the IP…
zabop
  • 6,750
  • 3
  • 39
  • 84
2
votes
1 answer

Wikipedia api python returns weird results

import wikipedia print(wikipedia.summary("Tomato", sentences=3)) Why does this code return a disambiguation error with "tom tom" and not just a summmary/disambiguation error to the entry "tomato"? The search term is clearly not tom tom or am I…
2
votes
1 answer

How to disable "Sleeping for N seconds" on PyWikiBot

At Pywikibot's Mediawiki Talk page this question has been asked some 2 years ago already. The answers there were along the lines "you shouldn't" and maxthrottle isn't the right parameter for that. For intranet usecases the throttle is mostly…
Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
2
votes
2 answers

How can I get details about reverted edits of a wiki page?

I am using pywikibot in python to get all revisions of a Wikipedia page. import pywikibot as pw wikiPage='Narthaki' page = pw.Page(pw.Site('en'), wikiPage) revs = page.revisions(content=True) How do I know which of the revisions were reverts? I see…
SanMelkote
  • 228
  • 2
  • 12
2
votes
1 answer

How to get all archived talk pages of a wikipedia page?

I am using the following code to fetch talk page for a given Wikipedia page. import pywikibot as pw page = pw.Page(pw.Site('en'), 'Elon_Musk') talkpage = page.toggleTalkPage() talkpage.text This works fine, but it does not return all archived talk…
SanMelkote
  • 228
  • 2
  • 12
2
votes
3 answers

How to use Airflow with Pywikibot

When importing pywikibot in a DAG file (or a module the DAG file imports), the DAG becomes broken, throwing the error in the webserver UI: Broken DAG: [/path/to/airflow/dags/dag.py] encode() argument 1 must be str, not bool I have tried to find a…
Chrisjan
  • 342
  • 2
  • 10
2
votes
1 answer

Problems with pywikibot in PyCharm

Henlo everyone, I met a very specific problem with my Python installation. I have a PyCharm project using a venv with pywikibot installed. Whenever I try to import the module, I get the following error: Traceback (most recent call last): File…
Damia
  • 141
  • 1
  • 9
2
votes
1 answer

How to get redirects from pywikibot in python

I would like to know if pywikibot api allows to retrieve the redirects of a given wikipedia article. I tried the following. pw.Page(pw.Site('en'), 'forensics').showRedirects() pw.Page(pw.Site('en'), 'forensics').redirects() However, I got an error…
EmJ
  • 4,398
  • 9
  • 44
  • 105
2
votes
1 answer

How to get specific Wikipedia page section?

I want to create a graph database of actors and the movies in which they've acted. To get the list of actors and movies, I'm trying to use the pywikibot parser, but I've only been able to get the full page, when I just want the filmography portion…
lordingtar
  • 1,042
  • 2
  • 12
  • 29
2
votes
1 answer

Pywikibot get links used in the main text

Is it possible to return the only the article hyperlinks used in the content text of a wiki page using Pywikibot? I have tried iterwikilinks() but that doesn't return the correct links I am looking for. Is there another method or API call?
stochasticcrap
  • 350
  • 3
  • 16
2
votes
1 answer

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 2: ordinal not in range(128)

I installed pywikibot-core (version 2.0b3) for my Mediawiki installation. I got an error when i tried to run a command which contains Unicode text. I run the following command: python pwb.py replace.py -regex -start:! "\[মুয়ায্যম হুসায়ন খান\]"…
nasirkhan
  • 9,948
  • 5
  • 27
  • 33