Wikipedia:Bots/Requests for approval/GraphBot
Appearance
New to bots on Wikipedia? Read these primers!
- Approval process – How this discussion works
- Overview/Policy – What bots are/What they can (or can't) do
- Dictionary – Explains bot-related jargon
Operator: GalStar (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 18:31, Wednesday, June 4, 2025 (UTC)
Function overview: Convert selected graphs to charts. Graphs must be of the template Template:PortGraph.
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python, Rust (mwbot)
Source code available: I will potentially release it soon.
Links to relevant discussions (where appropriate):
- https://commons.wikimedia.org/wiki/Commons:Bots/Requests/GraphBot
- Wikipedia:Village_pump_(technical)#Handling_information_to_pass_to_a_bot
Edit period(s): Continuous
Estimated number of pages affected: ~ a maximum 14,000 (the number of pages with broken graphs), likely fewer.
Namespace(s): Mainspace
Exclusion compliant (Yes/No): Yes
Function details:
Flow:
- Searches for pages with Template:PortGraph
- Loads page wikitext
- Parse wikitext with mwparserfromhell, find all templates, storing the name, parameters, and wikitext
- Do the following for all templates that are called "PortGraph" and have a "name" parameter.
- Generate tab and create it on commons
- The parameters x, y, y1, y2, xType, yType are considered
- Generate chart and create it on commons
- the type parameter is converted to the chart type
- xAxisTitle and yAxisTitle are used for the axis titles
- The title attribute is the title, if it doesn't exist, the name attribute is used instead
- Generate replacement with [[Template:ChartDisplay]] (i.e. [[Template:ChartDisplay|definition=[]|width=[]]])
- Generate tab and create it on commons
- Take all replacements and substitute the wikitext out.
- Post edit onto wikipedia
Discussion
Note: This bot appears to have edited since this BRFA was filed. Bots may not edit outside their own or their operator's userspace unless approved or approved for trial. AnomieBOT⚡ 03:01, 5 June 2025 (UTC)
- Note that these were manually approved edits. GalStar (talk) 03:32, 5 June 2025 (UTC)
- Whoops after re-reading the rules I've realized that I shouldn't have edited any mainspace files, that was a mistake on my end. GalStar (talk) 04:58, 6 June 2025 (UTC)
- Wouldn't this require the bot to be approved first on Commons, or some sort of joint bot trial? Tenshi! (Talk page) 17:15, 7 June 2025 (UTC)
- I have already filled for approval in commons, but I believe you are allowed to trail bots in commons without approval if you review all edits it makes. GalStar (talk) 17:33, 7 June 2025 (UTC)
- c:Commons:Bots/Requests/GraphBot —usernamekiran (talk) 21:09, 7 June 2025 (UTC)
- I have already filled for approval in commons, but I believe you are allowed to trail bots in commons without approval if you review all edits it makes. GalStar (talk) 17:33, 7 June 2025 (UTC)