The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was  Approved.

Operator: TheSandDoctor (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)

Time filed: 00:47, Wednesday, October 17, 2018 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): Python

Source code available: https://github.com/TheSandDoctor/election_converter

Function overview: Looks through the linked csv file, converting from the old title format to the new one.

Links to relevant discussions (where appropriate): [1], RfC on election/referendum article naming format

Edit period(s): Run until done

Estimated number of pages affected: Approximately 35, 227

Exclusion compliant (Yes/No): No

Already has a bot flag (Yes/No): No

Function details: The bot goes through the compiled csv file (in GitHub repo, more easily read form is the Excel document, which is also included). The bot then pulls up the individual page objects, double checks that they are not themselves redirects (ie that they haven't been moved) and exist. If both conditions are satisfied, the bot moves the page (leaving behind a redirect) to the corresponding title in column B (.xlsx doc). This corresponds with the latest RfC on election/referendum article naming format and was created per request of Number 57.

The code itself is relatively straight forward, with most of the heavy lifting being handled by the mwclient Python library's move function, which is a part of the page object.

Due to the large number of page moves required, I would also request that the bot flag be assigned should this request be approved. The bot is not exclusion compliant as that is non-applicable given the context.

Discussion[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


  • For new pages with "–" in the titles, now at the start for ranges, are you going to make redirects from the common redirect "-"? — xaosflux Talk 03:25, 17 October 2018 (UTC)[reply]
    Unless I'm missing something, or don't understand - I don't see any titles matching " - " in the docx. SQLQuery me! 03:52, 17 October 2018 (UTC)[reply]
    @SQL: For example new page will be July–August 1990 Bulgarian presidential election, may need a redirect from July-August 1990 Bulgarian presidential election created. — xaosflux Talk 04:02, 17 October 2018 (UTC)[reply]
    @Xaosflux: The word "may" could be problematic here as scripts can't do human thought. That would probably necessitate output to be posted in the user space for human editors to look over and make the call if we go down that route (definitely possible, would just need to decide between the bot posting it or it generating a file and myself periodically updating the page). Aside from that though (ignoring it momentarily, if you will), a regex could be crafted to scan a title looking for '–'s and then launch another method to create a redirect without (assuming '–'s are present). --TheSandDoctor Talk 04:14, 17 October 2018 (UTC)[reply]
    I'm only calling it out for commentary here, I'm not that current on MOS about dashes and don't want to fall asleep on my keyboard reading the MOS right now! — xaosflux Talk 04:20, 17 October 2018 (UTC)[reply]
    @Xaosflux: Not a problem and I hear you . I am happy to work with the community on this and share the technical knowledge I have. I am hoping that we can iron out the details regarding this. I still believe that some sort of a bot is needed for this, should the RfC stand, since 35k+ articles is a tad too much to do by hand very easily. --TheSandDoctor Talk 04:27, 17 October 2018 (UTC)[reply]
    Isn't this already covered by Anomie Bot? ~ Amory (utc) 15:22, 17 October 2018 (UTC)[reply]
    I think you're right; as an example, when 2018–19 Southern Football League was created, Anomie Bot created 2018-19 Southern Football League a few hours afterwards. Number 57 16:11, 17 October 2018 (UTC)[reply]
    I looked through the bot's user page and did not see anything covering this BRFA. That said, after reading Number's response (which occurred while I was looking), I realize that that appears to have not been what you meant. In that case, then there probably wouldn't be any issues whatsoever on this particular point/thread. --TheSandDoctor Talk 16:22, 17 October 2018 (UTC)[reply]
    Yes, sorry — this was threaded to be in reply to Xaosflux. It's AnomieBOt 74, and works like a charm (too well, really; I see plenty of these at G8 patrolling). ~ Amory (utc) 19:24, 17 October 2018 (UTC)[reply]
The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
  1. The RfC was advertised to the following WikiProjects: Elections and Referendums, Politics, Politics of the United Kingdom, U.S. Congress, Pakistani politics, New Zealand/Politics, Indian politics, Chinese politics and Australian politics; these are all the politics-related WikiProjects that I could find. On a vote-counting basis it is 69% in favour, but a couple of the oppose !votes are on dubious grounds (one being because an editor didn't believe that redirects appear in search, and another one who claimed they had never seen a year at the start of an article title), so I think the consensus (in terms of what a closing admin would determine) from the discussion is pretty undeniable.
  2. The proposed moves to 1998 California Proposition 10 etc are in line with the naming guideline (see the last bullet at WP:NC-GAL#Elections and referendums). The Oregon ones are currently incorrectly titled, so the move is to bring them in line with the guideline. We could have a conversation at a later date about whether the year is required at all for these types of articles (I'm not convinced it works), but currently they are in the guideline as such. If it's really a problem, perhaps we could drop them from the run?
  3. Polish presidential election, 1922 (special) is at the wrong title (one a few days before is at Polish presidential election, 9 December 1922, so the other one should be at Polish presidential election, 20 December 1922). This should therefore probably be moved to 20 December 1922 Polish presidential election;
  4. 2006 Ohio's 13th congressional district election is again a correct move in terms of the guideline (sixth bullet of WP:NC-GAL#Elections and referendums). The issue here is more around the awkward naming of the districts (e.g. Ohio's 13th congressional district) and is perhaps something that should be raised separately;
  5. The RfC did include discussion about titles that would start with a month (see Impru20's comments). The sortkey for articles like this would still be the year, followed by a numeral representing the month (e.g. "1946 1", "1946 2" for elections held in two separate months in 1946)
Cheers, Number 57 09:02, 17 October 2018 (UTC)[reply]
Looks like some bot coding is going to be needed to add/alter sort keys following the moves for new titles not starting with years. — xaosflux Talk 10:56, 17 October 2018 (UTC)[reply]
I'm not sure this is really needed; the current format means that articles don't automatically sort by year, so in many cases a sortkey has already been added. For instance, French constitutional referendum, October 1946 (Guinea) mentioned above is sorted in Category:Referendums in Guinea by the key 1946. This might be something better to do manually for the 380 articles with months in the year if not already in place. Number 57 13:00, 17 October 2018 (UTC)[reply]
For the other 4 categories it is in it is sorted only by page title such as Category:October 1946 events. I'm not sure what the 'best' answer for this is, but if doing it manually is the way that could be done prior to the page title moves to prevent issues in category view. — xaosflux Talk 13:08, 17 October 2018 (UTC)[reply]
I think the question there is what is the best category sortkey for the article in Category:October 1946 events. Number 57 13:10, 17 October 2018 (UTC)[reply]
Pages can be sorted differently in each category with a directive, but they only get one "default sort" for all undirected categories, so if in general sorting these be "month name" is undesirable a default sort should be defined for what the best general sorting should be. — xaosflux Talk 20:43, 17 October 2018 (UTC)[reply]
There doesn't seem to be any firm conventions around this – some articles starting with a year are sorted by the year in the events categories, and others by the first word after the year. However, in election categories sorting by year would definitely be desirable, so I guess the year followed by the month would be the best sorting (e.g. 1946 01, 1946 02 to 1946 12). Happy to add a DEFAULTSORT manually to these articles if it will resolve this concern for you? Cheers, Number 57 21:06, 17 October 2018 (UTC)[reply]
WP:NCGAL is a guideline, which like other guidelines says prominently at the top It is a generally accepted standard that editors should attempt to follow, though it is best treated with common sense, and occasional exceptions may apply. The use of a bot on such a huge scale precludes the consideration of exceptions. --BrownHairedGirl (talk) • (contribs) 03:03, 19 October 2018 (UTC)[reply]

Post-RFC Closure[edit]

Cheers, Number 57 10:47, 20 November 2018 (UTC)[reply]
@TheSandDoctor: I can protect the lists too if you like (I'm also an admin), but that does sound sensible. Cheers, Number 57 22:33, 21 November 2018 (UTC)[reply]
Haha, you're right. I knew you were an admin, my script told me you were an admin, yet when I sent that for some reason that didn't come to mind. I was just concerned with making sure you could edit it. That said, it still stands that I believe fully or template protecting is a smart move. The bot only reads the page in question containing the list of changes for a moment before storing it in memory and working from there, but if it was changed just before, then there could be potential issues. The probability is probably extremely small, but it is a risk as automated scripts don't think. So long as a malicious change kept the same format the bot would happily execute it unless it didn't have the rights to. --TheSandDoctor Talk 23:26, 21 November 2018 (UTC)[reply]
@Number 57: ^ --TheSandDoctor Talk 23:27, 21 November 2018 (UTC)[reply]

Trial run[edit]

The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.