Fetch all TemplateData from an entire wiki, then analyze the collective JSON to create statistics. Run script on en, de, fa wikis and compare the patterns in use.
**Questions to answer:**
**TemplateData Usage**
* How many templates already have TemplateData?
//DE wiki is an outlier with 8.6% of all templates having TemplateData, a significant jump from the ~2% for the others. Still, all have relatively low percentages. With this data it is hard to know if that is because there are many templates which do not need it (because they do not have parameters or are rarely used) or if many commonly used templates are missing TemplateData. We hope to track the percentage of templates opened in VE with or without TemplateData and that will give a better idea of how many templates are missing it, which could benefit from having it. {T259705} //
{F31967342}
**Parameter Types**
* How often is each parameter type used? (Boolean, Content, File, Line, Number, Date, Page, String, Template, Unbalanced wikitext, Unknown, URL, User)
//Most parameters are unknown; this is the default when parameters are added. The most often chosen type is 'string.' On EN wiki, unknown and strings combined are 85.95% of all parameters. Both have no effect on VE or TemplateWizard and are essentially ‘blank’ types. DE wiki is an outlier and uses Line, Number, Content, and Wiki-page-name often (31-12%), but they are rarely used on the other wikis (7-1%). All four wikis rarely use Boolean and Date (4-1%), and almost never use Wiki-file-name, unbalanced-wikitext, wiki-template-name, URL, and wiki-user-name (under 1% on all wikis). These seven under-used types are some of the ones that offer special support in VE, such as autocomplete or validation.//
* How many deprecated, required, suggested, vs optional parameters are there?
//Almost all parameters are optional. DE wiki is an outlier with 12% suggested and 6% required while all others have only 1-3% for either suggested or required. Very few parameters are deprecated (0.29%-1.94%).//
{F31967332}
**Parameter Properties**
* How often is each additional property used? (Name, Alias, Label, Description, Example, Default, Auto value)
//Label and description are used significantly more often than anything else, except on de wiki where aliases are used most often.//
* How often do templates have values for both Example and Default?
//Examples and defaults are not used very often. When used, typically one or the other is used, not both.//
* How often do Boolean parameter types have default values?
* How many deprecated//Booleans are not a large percentage of parameters (2% or less), required,but for those that are even fewer use a default. suggestedOn smaller wikis, vs optional parameters are there?this essentially never occurred.//
{F31967334}
**Results**
https://gitlab.com/adamwight/templatedata-stats/-/blob/master/notebooks/Parameter%20analysis.ipynb
**Key Insights**
1. Specific parameter types are mostly not being used, especially the ones with special properties like those with autocomplete or the boolean with checkmark.
2. Seems like most common behavior is to add a parameter, give it a label and description and leave the rest of the properties as defaults.
3. DE wiki has very non-standard behavior when compared with the other three wikis, which all have very similar behavior just at different scales.
4. When inserting a new template, it is very unlikely that a user would see a checkbox for a boolean value.
5. Flexibility is most valued when choosing parameter types. It's also possible that people are not aware of the special behaviors of specific parameter types.