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

Pywikipedia unicode error

when using pywikipedia to upload an image on my wiki, I get the following error whatever the image: ERROR: UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 687: ordinal not in range(128) information on my envt: frproasi01(elan)[…
Olivier
  • 252
  • 2
  • 11
1
vote
1 answer

Match anything when finding a special character in python regex

I want to use a regex that matches anything but when it finds a special character stop from matching.] I want to use this pattern \*\s*\[\[.* and when become this : ]] it stops matching. For example it should match * [[anything here]] or * [[]] and…
Javad Yousefi
  • 2,250
  • 4
  • 35
  • 52
1
vote
2 answers

Automated alternatives to creating hierarchical categories in mediaWiki manually?

I want to start a mediaWiki based site, but rather than manually adding categories and subcategories I want to add them in an automated fashion, where I provide something like an xml file and the bot/script/algorithm/... goes through the list and…
solimanelefant
  • 546
  • 1
  • 5
  • 17
1
vote
2 answers

How does Pywikipedia manage colours on the command line?

I have always thought that there is no possible formatting on the command line, as everything I have read says. However, I recently discovered that pywikipedia (a python bot framework for automatically editing wikipedia-style wikis) can output text…
ACarter
  • 5,688
  • 9
  • 39
  • 56
1
vote
2 answers

Imports working with raw file, but not in IDLE

UPDATE 10 Secs later Fixed properly now, and thanks to JF and Gauden. UPDATE I have found a temporary fix by saving the IDLE file in the directory the other working file is in. (I would still like to know how to fix it entirely if I can.) That's not…
ACarter
  • 5,688
  • 9
  • 39
  • 56
1
vote
4 answers

Can I use pywikipedia to get just the text of a page?

Is it possible, using pywikipedia, to get just the text of the page, without any of the internal links or templates & without the pictures etc.?
James Wanchai
  • 2,861
  • 4
  • 21
  • 16
0
votes
2 answers

Problems with python script on web hosting

I have written a script for Wikipedia & it works fine on my computer, yet when I upload it to my web host(Dreamhost) it doesn't work & says that the user I am trying to log in as is blocked-this is not true, it works on my computer & I#m not…
Jack Pennel
0
votes
1 answer

Matching specific Geonames IDs with Wikidata IDs using Pywikibot

I have an extensive list of Geonames IDs for which I want to find the matching Wikidata IDs. I would like to use Pywikibot and, if possible, iterate over the list. The SPARQL query for an individual Geonames ID would be: SELECT DISTINCT ?item…
OnceUponATime
  • 450
  • 4
  • 12
0
votes
1 answer

Pywikibot: _lzma module missing

I've developped a Python script which use Pywikibot. The scripts works fine on Windows 11 but i need to run it on Linux Server with CentOS 7. But, there was an issue involving a missing module named _lzma. File…
8oris
  • 320
  • 2
  • 12
0
votes
0 answers

How do I set the API cache directory apicache-py3 and throttle.ctrl for pywikibot?

By default pywikibot makes a cache directory apicache-py3 and a file throttle.ctrl in the current directory, from where I run my Python script. I would like pywikibot to put those elsewhere, e.g. in ../data. How can I direct pywikibot, from my…
Fanta
  • 2,825
  • 5
  • 26
  • 35
0
votes
1 answer

how to work with custom wikibase using pywikibot

I have my family file, user-config.py and user-password.py in the directory that i am running the following script from import os, sys import pywikibot as…
pippin
  • 35
  • 1
  • 10
0
votes
1 answer

How are you supposed to do admin/sysop actions with Pywikibot 8?

I have been using an outdated version of Pywikibot and Python 2 and finally got around to upgrading to Python 3 and Pywikibot 8. All support for "sysop" accounts seems to have been removed and there's no documentation I can find on how to work with…
Urban Vagabond
  • 7,282
  • 3
  • 28
  • 31
0
votes
1 answer

Finding former bot edits for a Wikipedia page using PyWikiBot

I have currently written this block of code in which the correct number of bots is returned, but upon checking with the https://xtools.wmcloud.org/articleinfo/en.wikipedia.org/Planet_of_the_Apes?botlimit=100#auto-edits page. I can see the bots with…
0
votes
1 answer

Trying to log pywikibot into mediawiki on localhost

I am trying to log pywikibot into a mediawiki I am running on my local computer through Wanpserver. When I try to login.py I get (base) PS C:\core_stable> python pwb.py login.py WARNING: No user is logged in on site mediawiki:mediawiki ERROR:…
0
votes
0 answers

Retrieving all living people from wikipedia/wikidata

I have the following query from the WikiData query builder to fetch people, but I would like to fetch only people who are alive. I've tried playing around with date of death but I can't get anything that seems to work, I'm not very familiar with…
Matt Wise
  • 33
  • 1
  • 3