Manual:Pywikipediabot/templatecount.py

From MediaWiki.org
Jump to: navigation, search
Bug blank.svg
Subversion repository of Wikimedia has this file:
Bote Boas Vindas2.png
Pywikipediabot
scripts
Pywikipediabot Overview
Quick Start Guide
Installation
Installation (Mac)
Configuration
user-config.py
Non-Wikimedia wikis
Tutorial
Scripts
Development
Further help

v  d  e

As the name implies templatecount.py counts the number of times a template has been transcluded on your wiki.

[edit] Syntax

Basic syntax is:

python templatecount.py option templatename1 templatename2 templatename3 ... templatenameX

where option can be

-count        Counts the number of times each template (passed in as an
              argument) is transcluded.

-list         Gives the list of all of the pages transcluding the templates
              (rather than just counting them).

-namespace:   Filters the search to a given namespace.  If this is specified
              multiple times it will search all given namespaces

[edit] Usage

Imagine you wanted to find out how often the templates {{reflist}}, {{quote}} and {{tl}} were used on your wiki, across all namespaces.. You didn't care about where they were used, just howw many times. You'd then type:

python templatecount.py -count reflist quote tl
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox