Difference between revisions of "User:Ch4zm/Pywikibot"

From Golly.Life Wiki
(Created page with "=Notes= ==20211004== Questions about Pywikibot: * Digging into the example, there's this textlib.extract_sections, but it's not documented as part of the API. What gives? *...")
 
Line 13: Line 13:
 
* I'm getting stuck on the very first non-trivial task I have, the very first non-trivial article I'm editing.
 
* I'm getting stuck on the very first non-trivial task I have, the very first non-trivial article I'm editing.
 
* All kinds of mysterious stuff going on in the pywikibot library that isn't documented. WTF??
 
* All kinds of mysterious stuff going on in the pywikibot library that isn't documented. WTF??
 +
* Another example, how to connect the objects to a given page? Like, I can extract Category objects that tell me about categories on a page, but how do I update a section that may contain Categories, and preserve the Category links and only the category links? or the templates?
 +
* Why is this so difficult?

Revision as of 22:48, 4 October 2021

Notes

20211004

Questions about Pywikibot:

  • Digging into the example, there's this textlib.extract_sections, but it's not documented as part of the API. What gives?
  • Once you extract a document into its corresponding sections, you can pick out a specific section. But what then?
  • You can't (apparently) modify the Section object.
  • You can't create your own Section, because it's a private object, not documented, not part of public API.
  • So, we end up looping over each section, and finding section.title + section.content unless it's the section we want.
  • This seems really idiotic, but there's no documentation of any of these functions or objects, sooooo what the fuck am I supposed to do?
  • I'm getting stuck on the very first non-trivial task I have, the very first non-trivial article I'm editing.
  • All kinds of mysterious stuff going on in the pywikibot library that isn't documented. WTF??
  • Another example, how to connect the objects to a given page? Like, I can extract Category objects that tell me about categories on a page, but how do I update a section that may contain Categories, and preserve the Category links and only the category links? or the templates?
  • Why is this so difficult?