-
Notifications
You must be signed in to change notification settings - Fork 78
Usage
Steve edited this page Sep 21, 2017
·
32 revisions
Simply import wptools to get started.
>>> import wptoolsYou can instantiate one of the following:
- Page object to get info about a Mediawiki page
- Category object to get info about Mediawiki categories
- Site object to get Wikimedia site info
The optional flags and arguments below work for page, category, and site objects.
Object data echoes automatically. You can turn that off with silent=True:
>>> page = wptools.page(silent=True)HTTP request/response details echo to stderr with verbose=True:
>>> page = wptools.page(verbose=True)All request actions support setting proxy and timeout (in seconds):
>>> page.get(proxy='http://example.com:80', timeout=5)You can skip request actions using skip:
>>> page = wptools.page(skip=['claims', 'imageinfo'])