Skip to main content

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.

Quick start

git clone https://gerrit.wikimedia.org/r/pywikibot/core.git
cd core
git submodule update --init
python pwb.py script_name

Our installation guide has more details for advanced usage.

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')
page.save('Replacing "foo" with "bar"')  # Saves the page

Required external programms

It may require the following programs to function properly:

  • 7za: To extract 7z files

Contributing

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

Build Status

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

pywikibot-2.0rc4.tar.gz (909.8 kB view details)

Uploaded Source

File details

Details for the file pywikibot-2.0rc4.tar.gz.

File metadata

  • Download URL: pywikibot-2.0rc4.tar.gz
  • Upload date:
  • Size: 909.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pywikibot-2.0rc4.tar.gz
Algorithm Hash digest
SHA256 eeb207cb97bb24cffe0d6bb4eb1cee4a9eec6201e30604dd7ae1d81a819736ce
MD5 75af0270f870496e8abe59042817e772
BLAKE2b-256 71ed60b1dc2f6f5b5490f78d34b8ffb08e7d24baf376d5a476aed9bedfb8a3e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page