Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Python MediaWiki Bot Framework

Project description

The Pywikibot framework is a Python library that interfaces with the MediaWiki API version 1.14 or higher.

Also included are various general function scripts that can be adapted for different tasks.

For further information about the library excluding scripts see the full code documentation.

Quick start

git clone
cd core
git submodule update --init
python script_name

Or to install using PyPI (excluding scripts)

pip install pywikibot --pre

Our installation guide has more details for advanced usage.

Basic Usage

If you wish to write your own script it’s very easy to get started:

import pywikibot
site = pywikibot.Site('en', 'wikipedia')  # The site we want to run our bot on
page = pywikibot.Page(site, 'Wikipedia:Sandbox')
page.text = page.text.replace('foo', 'bar')'Replacing "foo" with "bar"')  # Saves the page

For more documentation on pywikibot see our docs.

The contents of the package

README and config files:
ChangeLog Log file to keep track of major changes versionwise
CREDITS List of major contributors to this module Bootstrap distribute installation file, can also be run to install or upgrade setuptools. Creates a new family file. Creates or
LICENSE a reference to the MIT license Wrapper script to use Pywikibot in ‘directory’ mode
README-conversion.txt Guide to converting bot scripts from version 1 of the Pywikibot framework to version 2
README.rst Short info string used by Pywikibot Nightlies
requirements.txt PIP requirements file Installer script for Pywikibot 2.0 framework Example file for reference
pywikibot Contains some libraries and control files
scripts Contains all bots and utility scripts
tests Some test stuff for the developing team

Required external programs

It may require the following programs to function properly:

  • 7za: To extract 7z files


Our code is maintained on Wikimedia’s Gerrit installation. Learn about how to contribute.

Build Status

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pywikibot-3.0.20170801.tar.gz (482.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page