Skip to main content

A thin MediaWiki client using requests.

Project description

https://badge.fury.io/py/pymw.svg https://travis-ci.org/5j9/pymw.svg?branch=master https://codecov.io/gh/5j9/pymw/branch/master/graph/badge.svg

Another personal pet project of mine. It requires Python 3.9+!

Installation

pip install pymw

Usage

Create a .pymw.toml file in your home directory with the following content format to avoid directly providing username and password for login calls:

# The configuration file for pymw python library.
version = 1

['https://test.wikipedia.org/w/api.php'.login]
'<Username@Special:BotPasswords>' = '<BotPassword>'

Notable features

  • Supports setting a custom User-Agent header for each API instance.

  • Handles query continuations.

  • Handles batchcomplete signals for prop queries and yeilds the results as soon as a batch is complete.

  • Configurable maxlag. Waits as the API recommends and then retries.

  • Some convenient methods for accessing common API calls, e.g. for recentchanges, login, upload, and siteinfo.

  • Lightweight. pymw is a thin wrapper. Method signatures are very similar to the parameters in an actual API URL. You can consult MediaWiki’s documentation if in doubt about what a parameter does.

Project details


Download files

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

Source Distribution

pymw-0.4.1.tar.gz (10.6 kB view hashes)

Uploaded Source

Built Distribution

pymw-0.4.1-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

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