pywikibot should have an entity factory, which creates a Page of the relevant subclass based on the namespace (at least), which might be hard-coded, or could be dynamic (e.g. ItemPage) or could be defined by the family (e.g. wikisource_families Author: namespaces)
c.f. https://gerrit.wikimedia.org/r/#/c/171780/13..14/pywikibot/data/api.py,unified