Pywikibot/Pages: Difference between revisions
From charlesreid1
(Created page with "==Page Objects== ==Revision Objects== ==Useful Actions== ==All Available Methods== ===Page Object Methods=== A list of all available methods for Page objects: {{Scrollbo...") |
|||
| Line 1: | Line 1: | ||
==Page Objects== | ==Page Objects== | ||
These represent MediaWiki pages, obviously. | |||
Many of Site object's methods return Pages or PageGenerators (see [[Pywikibot/Sites]]). | |||
==Revision Objects== | ==Revision Objects== | ||
Revision as of 21:53, 31 January 2018
Page Objects
These represent MediaWiki pages, obviously.
Many of Site object's methods return Pages or PageGenerators (see Pywikibot/Sites).
Revision Objects
Useful Actions
All Available Methods
Page Object Methods
A list of all available methods for Page objects:
>>> dir(page) ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__unicode__', '__weakref__', '_applicable_protections', '_cache_attrs', '_cmpkey', '_contentmodel', '_cosmetic_changes_hook', '_getInternals', '_get_parsed_page', '_isredir', '_latest_cached_revision', '_link', '_namespace_obj', '_pageid', '_protection', '_revid', '_revisions', '_save', '_timestamp', 'applicable_protections', 'aslink', 'autoFormat', 'backlinks', 'botMayEdit', 'canBeEdited', 'categories', 'change_category', 'clear_cache', 'content_model', 'contributingUsers', 'contributors', 'coordinates', 'data_item', 'data_repository', 'defaultsort', 'delete', 'depth', 'editTime', 'embeddedin', 'encoding', 'exists', 'expand_text', 'extlinks', 'fullVersionHistory', 'full_url', 'get', 'getCategoryRedirectTarget', 'getCreator', 'getDeletedRevision', 'getLatestEditors', 'getMovedTarget', 'getOldVersion', 'getRedirectTarget', 'getReferences', 'getRestrictions', 'getTemplates', 'getVersionHistory', 'getVersionHistoryTable', 'image_repository', 'imagelinks', 'interwiki', 'isAutoTitle', 'isCategory', 'isCategoryRedirect', 'isDisambig', 'isEmpty', 'isFlowPage', 'isImage', 'isIpEdit', 'isRedirectPage', 'isStaticRedirect', 'isTalkPage', 'is_categorypage', 'is_filepage', 'is_flow_page', 'iterlanglinks', 'itertemplates', 'langlinks', 'lastNonBotUser', 'latestRevision', 'latest_revision', 'latest_revision_id', 'linkedPages', 'loadDeletedRevisions', 'markDeletedRevision', 'merge_history', 'move', 'moved_target', 'namespace', 'oldest_revision', 'pageAPInfo', 'page_image', 'pageid', 'permalink', 'preloadText', 'previousRevision', 'previous_revision_id', 'properties', 'protect', 'protection', 'purge', 'put', 'put_async', 'raw_extracted_templates', 'removeImage', 'replaceImage', 'revision_count', 'revisions', 'save', 'section', 'sectionFreeTitle', 'set_redirect_target', 'site', 'templates', 'templatesWithParams', 'text', 'title', 'titleForFilename', 'titleWithoutNamespace', 'toggleTalkPage', 'touch', 'undelete', 'urlname', 'userName', 'version', 'watch'] |
Revision Object Methods
>>> revs = list(page.revisions()) >>> dir(revs[0]) ['FullHistEntry', 'HistEntry', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__unicode__', '__weakref__', '_content_model', '_parent_id', '_sha1', '_thank', 'anon', 'comment', 'content_model', 'full_hist_entry', 'hist_entry', 'minor', 'parent_id', 'revid', 'rollbacktoken', 'sha1', 'text', 'timestamp', 'user'] |