Skip to main content

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

README and config files:

ChangeLog

Log file to keep track of major changes versionwise

CREDITS

List of major contributors to this module

ez_setup.py

Bootstrap distribute installation file, can also be run to install or upgrade setuptools.

generate_family_file.py

Creates a new family file.

generate_user_files.py

Creates user-config.py or user-fixes.py

LICENSE

a reference to the MIT license

pwb.py

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

setup.py

Installer script for Pywikibot 2.0 framework

user-config.py.sample

Example user-config.py file for reference

Directories

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

Contributing

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

Build Status

Metadata

Release files for pywikibot 3.0.20170713

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.20170713
File Size Uploaded Provenance
pywikibot-3.0.20170713.tar.gz 480.8 kB Without provenance Details

Release files / pywikibot-3.0.20170713.tar.gz

Download URL pywikibot-3.0.20170713.tar.gz
Size 480.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f44ba3a77e2238b4f6cb4ff950a32d85c71bd0648fc9abfef54489b62cdcafae
BLAKE2b-256 checksum
How to use checksums
722e1402246bff0cf2ed459e5055b2a68b4c8e906aa3e8b527de91f8835a4283
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pywikibot 3.0.20170713

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.0.20170713 This release

1 release file No provenance

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