Jump to content

PAWS/PAWS examples and recipes

From Wikitech


Overview

This is a list of existing PAWS notebooks created by users that can serve as examples for others. The list includes notebooks that employ database connections and API connections and are useful to individuals wishing to complete research and on-wiki tasks.

If you want to download and re-use these examples, see the instruction on how to quickstart with PAWS.

The notebooks are marked with specific topic tags (see key below) to help aid in understanding what they cover and what tasks they are best suited for.

Key

Color key

A visual key to help keep track of what examples and tutorials are available Example Tutorial or How-to API Wikireplicas Datadumps Research & Analysis On-Wiki tasks Pywikibot Wikidata SPARQL

Wiki replicas and datasets

Connecting to Wiki replicas

Note: As of April 2021, there is a new method for connecting to Wikireplicas. Please see the following notebooks for examples of how to connect to the Wiki replicas. If you plan on following the other Tutorials or How-tos or fork the examples below. Make sure to use the most current method of connecting to the Wiki replicas.

Tutorials and How-tos

Tutorial or How-to Research & Analysis Wikireplicas Wikidata SPARQLDatadumps

Wikidata dumps tutorials

Tutorial or How-to Research & Analysis Wikidata Datadumps

Example notebooks

Note: This only includes notebooks without JOINS in their SQL queries -- which may not work correctly after planned changes to Wiki replicas. For a list of notebooks that include JOINS by USER-ID, see this list: https://wikitech.wikimedia.org/wiki/User:SRodlund/PAWS_examples_lists/notebooks_with_joins

Wiki replicas

Wiki replicas Research & Analysis Wikidata Example

Dumps

Research & Analysis Datadumps Example

SPARQL

Research & Analysis SPARQL Wikidata Example

Wikidata Query

Research & Analysis Wikidata Example

APIs

PAWS notebook: API Connections

Tutorials and How-tos

API Tutorial or How-to

  • API Connections With PAWS - An overview of how to use PAWS with APIs. Updated 2021
  • MediaWiki page history - The MediaWiki REST API lets you build apps and scripts that interact with any MediaWiki-based wiki. In this tutorial, we'll use the REST API page history endpoints to explore the history of articles on English Wikipedia.
  • MediaWiki Rest API examples- This notebook contains a variety of MediaWiki Rest API examples: search pages, autocomplete page title, get page history, get page history counts, get revision, compare revision, get page, get page offline, get page source, get languages, get files, get files on a page, create page, update page.
  • Wikimedia Feeds intro - Many Wikipedias include daily featured articles and other curated content on their homepages. You can see an example of this content on the main page of English, German, and French Wikipedias. The Wikifeeds API lets you access this content programmatically and add high-quality, multilingual content to your apps.
  • Create an image grid using free images from Wikimedia Commons - This guide uses the MediaWiki REST API to explore media files on Wikimedia Commons. Wikimedia Commons is a collection of over 60,000,000 freely usable media files, many of which are used in Wikipedia articles.
  • Reuse free images from Wikimedia Commons - This guide uses the MediaWiki REST API to explore media files on Wikimedia Commons. Wikimedia Commons is a collection of over 60,000,000 freely usable media files, many of which are used in Wikipedia articles.
  • Exploring page history- The MediaWiki REST API lets you build apps and scripts that interact with any MediaWiki-based wiki. In this tutorial, we'll use the REST API page history endpoints to explore the history of articles on English Wikipedia.
  • Search Wikipedia articles - The MediaWiki REST API lets you build apps and scripts that interact with any MediaWiki-based wiki. In this tutorial, we'll use the REST API search endpoints to search for articles about the Solar System on English Wikipedia.
  • Retrieving free knowledge - This guide uses the MediaWiki REST API to explore articles on English Wikipedia.
  • Wikipedia page stats comparison - This guide uses the MediaWiki REST API to explore articles on English Wikipedia.
  • Get featured content from English Wikipedia - The Wikifeeds API provides convenient access to content featured on the Main Page of English Wikipedia.

Example notebooks

Various notebooks using APIs

API Example On-Wiki tasks

Pywikibot (Uses MediaWiki API)

Pywikibot API Example On-Wiki tasks

Further resources

  1. [Cloud-announce] Change to NFS mount paths