This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
pywikibot
scripts
tests
.appveyor.yml
.codecov.yml
.coveragerc
.gitattributes
.gitignore
.gitmodules
.gitreview
.svnprops
.travis.yml
CODE_OF_CONDUCT.rst
CONTENT.rst
CREDITS
ChangeLog
Dockerfile
HISTORY.rst
LICENSE
README-conversion.txt
README.rst
dev-requirements.txt
ez_setup.py
generate_family_file.py
generate_user_files.py
pwb.py
requests-requirements.txt
requirements.txt
setup.py
tox.ini
user-config.py.sample
user-fixes.py.sample

README.rst

Build Status Code coverage Pywikibot release

Pywikibot

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 https://gerrit.wikimedia.org/r/pywikibot/core.git
cd core
git submodule update --init
python pwb.py 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')
page.save('Replacing "foo" with "bar"')  # Saves the page

For more documentation on pywikibot see our docs.

Required external programs

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.