|On this page, old discussions are archived. An overview of all archives can be found at this page's archive index. The current archive is located at 2018.|
When I try to .get() some items, I get this error "KeyError: 'upperBound'" and the script aborts. I have added a try-except (I use Python) to skip these items, but that it isn't a proper solution. I use branch2.0 and it is updated (git pull). What is that error? Thanks. Emijrp (talk) 12:12, 19 February 2017 (UTC)
- @Emijrp: Sounds familiar and fixed. Are you sure you are on the master branch and not something else? "git config --get remote.origin.url" should give something like "https://gerrit.wikimedia.org/r/pywikibot/core.git" and after a "git pull origin master" the command "python pwb.py version.py" should return "Pywikibot: [https] r-pywikibot-core.git (50e39f8, g7860, 2017/02/17, 13:03:10, n/a)". Multichill (talk) 12:20, 19 February 2017 (UTC)
- @Multichill: I was using branch 2.0, I followed these instructions. I have changed to master and it seems to work fine now. Thanks. Emijrp (talk) 12:38, 19 February 2017 (UTC)
Fetching from infoboxes
- You can use Harvest Templates or a Pywikibot script with the same name. Matěj Suchánek (talk) 14:31, 10 March 2017 (UTC)
- Perhaps, a bit too late to talk about this, but all WMF projects will continue to grow constantly and this leaves its mark on Wikidata as well, so I think this requirement will be helpful.
Currently there is at least one active bot which adds item descriptions in multiple languages, in multiple separated consecutive edits (up to ten, or maybe more when possbile, IDK), thus cluttering the item history. Another flaw of such bot activity is that it increases chances of servers overload, and per overall it's waste of resources. I suggest to add a new requirement for bot operators - when working on category/template/disambiguation items, depending on task, add all your descriptions (and probably labels) in a single edit. Let's save resources and to keep items histories tidy and short. --XXN, 18:37, 10 May 2017 (UTC)
- I guess you're not aware of en:Wikipedia:Don't worry about performance. I generally like to see different edits from bots when multiple tasks are combined (like here), but updating descriptions should just be done in one edit with a clear edit summary. I'm sure if you ask the operator of the bot nicely that it can be updated to produce less history clutter. Multichill (talk) 18:54, 10 May 2017 (UTC)
- Like the history, also watchlist is affected if one have enabled in preferences the option "Expand watchlist to show all changes, not just the most recent".
- The "Don't worry about performance" essay is for humans; bot operators have to respect some API/bot etiquettes/policies. --XXN, 15:56, 16 May 2017 (UTC)
- I don't think this is a good idea as-is. There could be valid (technical) reasons to separate out edits.--Jasper Deng (talk) 01:37, 8 June 2017 (UTC)
Check if my bot has already modified a page?
Hello, not sure it is the best place to ask but let's give it a try. I'd like to re-run some scripts I had run years ago to run them on items that have been created since then. But I'd like to prevent touching items that I had already modified when running the script for the first time (if information I had added has been removed, there might be a good reason so I don't want to add it back). Is there an easy way to do that by getting a list of contributors to an item ? I am using pywikibot. Thanks, Symac (talk) 08:34, 13 June 2017 (UTC)
- Given that you have an item object, you can do
'userName' in item.contributors()(link). Matěj Suchánek (talk) 08:51, 13 June 2017 (UTC)
Wikidata:List of wikis/python updated
Drop "if possible" for the need for P31/P279
"Bots should add instance of (P31) or subclass of (P279) if possible" I advocate to drop the "if possible", especially given that the sentence already says should and not must. ChristianKl (talk) 15:13, 10 November 2017 (UTC)