Skip to main content
Build Status Code coverage Maintainability 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.

The contents of the package

Directories

pywikibot

Library routines, control files and global settings

pywikibot/comms

Communication layer

pywikibot/compat

Package to provide compatibility with compat scripts

pywikibot/data

Module with several layers for data access to wiki

pywikibot/families

wiki-specific information and settings

pywikibot/tools

Miscellaneous helper functions (not wiki-dependent)

pywikibot/userinterfaces

GUI and terminal interface

Required external programs

It may require the following programs to function properly:

  • 7za: To extract 7z files

Release history

3.0.20180301

  • Changed requirements for requests and sseclient

  • Bugfixes and improvements

  • Localisation updates

3.0.20180204

  • Deprecation warning: support for py2.6 and py3.3 will be dropped

  • Changed requirements for cryprography, Pillow and pyOpenSSL

  • Bugfixes and improvements

  • Localisation updates

3.0.20180108

  • Maintenance script to download Wikimedia database dump

  • Option to auto-create accounts when logging in

  • Ship wikimania family file

  • Drop battlestarwiki family file

  • Bugfixes and improvements

  • Localisation updates

3.0.20171212

  • Introduce userscripts directory

  • Generator settings inside (user-)fixes.py

  • BaseUnlinkBot has become part of the framework in specialbots.py

  • Decommission of rcstream

  • Script files added to https://doc.wikimedia.org/pywikibot/

  • Other documentation updates

  • Bugfixes and improvements

  • Localisation updates

3.0.20170801

  • Bugfixes and improvements

  • Localisation updates

3.0.20170713

  • Implement server side event client EventStreams

  • Add thanks log support

  • new ndashredir.py script to create hyphenated redirects

  • new followlive.py script to flag new articles

  • new WbUnknown data type for Wikibase

  • Deprecate APISite.newfiles()

  • new pagegenerators filter option -titleregexnot

  • Inverse of pagegenerators -namespace option

  • Bugfixes and improvements

  • Localisation updates

  • Remove panoramiopicker.py script

  • Remove anarchopedia family out of the framework

  • CODE_OF_CONDUCT included

3.0.20170521

  • Replaced the word ‘async’ with ‘asynchronous’ due to python 3.7

  • Support for Python 2.6 but higher releases are strictly recommended

  • Bugfixes and improvements

  • Localisation updates

3.0.20170403

  • First major release from master branch

  • requests package is mandatory

  • Deprecate previous 2.0 branches

2.0rc5

  • Last stable 2.0 branch

2.0rc4

  • Remove dependency on pYsearch

  • Desupport Python 2.6 for Pywikibot 2.0 release branch

2.0rc3

  • Bugfixes

  • Localisation updates

  • i18n: always follow master branch

2.0rc2

  • Bugfixes and improvements

  • Localisation updates

2.0rc1

  • New scripts patrol.py and piper.py ported from old compat branch

  • isbn.py now supports wikibase

  • RecentChanges stream (rcstream) support

  • Sphinx documentation at https://doc.wikimedia.org/pywikibot/

  • Bugfixes and improvements

  • Localisation updates

2.0b3

  • Bugfixes and improvements

2.0b2

  • Bugfixes and improvements

2.0b1

  • First stable release branch

1.0 rv 2007-06-19

  • BeautifulSoup becomes mandatory

  • new scripts where added

  • new family files where supported

  • some scripts where archived

1.0

Sep 26, 2005

  • First PyWikipediaBot framework release

  • scripts and libraries for standardizing content

  • tools for making minor modifications

  • script making interwiki links

Contributing

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

Code of Conduct

The development of this software is covered by a Code of Conduct.

Metadata

Release files for pywikibot 3.0.20180302

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywikibot 3.0.20180302
File Size Uploaded
pywikibot-3.0.20180302.tar.gz 492.4 kB Details

Release files / pywikibot-3.0.20180302.tar.gz

Download URL pywikibot-3.0.20180302.tar.gz
Size 492.4 kB
Tags Source
SHA-256 checksum
How to use checksums
64e7eae5088d0d2a5e700bb07d1c70a6bab48adee550db776491c1912c163569
BLAKE2b-256 checksum
How to use checksums
4c8232841642afb8fd19ae2bdfb4938ef8a4d0e5b7c7a8564f6039c8d3684984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

11.8.0

2 release files

11.7.0

2 release files

11.6.0

2 release files

11.5.0

2 release files

11.4.2

2 release files

11.4.1

2 release files

11.4.0

2 release files

11.3.0

2 release files

11.2.0

2 release files

11.1.0

2 release files

10.7.6

2 release files

10.7.5

2 release files

10.7.4

2 release files

10.7.3

2 release files

10.7.2

2 release files

10.7.1

2 release files

10.7.0

2 release files

10.6.0

2 release files

10.5.0

2 release files

10.4.0

2 release files

10.3.2

2 release files

10.2.0

2 release files

10.1.0

2 release files

9.6.3

2 release files

9.6.2

2 release files

9.6.1

2 release files

9.6.0

2 release files

9.5.0

2 release files

9.4.1

2 release files

9.4.0

2 release files

9.3.1

2 release files

9.3.0

2 release files

9.2.1

2 release files

9.2.0

2 release files

9.1.3

2 release files

9.1.2

2 release files

9.1.1

2 release files

9.1.0

2 release files

9.0.0

2 release files

8.6.0

2 release files

8.5.1

2 release files

8.5.0

2 release files

8.4.0

2 release files

8.3.3

2 release files

8.3.2

2 release files

8.3.1

2 release files

8.3.0

2 release files

8.2.0

2 release files

8.1.2

2 release files

8.1.1

2 release files

8.1.0

2 release files

8.0.4

1 release file

8.0.3

2 release files

8.0.2

2 release files

8.0.1

2 release files

8.0.0

2 release files

7.7.3

2 release files

7.7.2

2 release files

7.7.1

2 release files

7.7.0

2 release files

7.6.0

2 release files

7.5.0

2 release files

7.4.0

2 release files

7.3.0

1 release file

7.2.0

1 release file

7.1.0

1 release file

7.0.0

1 release file

6.6.5

1 release file

6.6.4

1 release file

6.6.3

1 release file

6.6.2

1 release file

6.6.1

1 release file

6.6.0

1 release file

6.5.0

1 release file

6.4.0

1 release file

6.3.0

1 release file

6.2.0

1 release file

6.1.0

1 release file

6.0.1

1 release file

6.0.0

1 release file

5.6.0

1 release file

5.5.0

1 release file

5.4.0

1 release file

5.3.0

1 release file

5.2.0

1 release file

5.1.0

1 release file

5.0.0

1 release file

4.3.0

1 release file

4.2.0

1 release file

4.1.1

1 release file

4.1.0

1 release file

4.0.0

1 release file

This release

3.0.20180302 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page