skip to navigation
skip to content

Not Logged In

pywikibot 2.0b1

Python Wikipedia Bot Framework

The pywikibot framework is a Python library that interfaces with the MediaWiki API. Also included are various general function scripts that can be adapted for different tasks.

Quick start

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

Our installation guide has more details for advanced 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


Our code is maintained on Wikimedia’s Gerrit installation, learn how to get started.

  • Downloads (All Versions):
  • 0 downloads in the last day
  • 0 downloads in the last week
  • 0 downloads in the last month