import pywikibot

site = pywikibot.Site("wikidata", "wikidata")
page = pywikibot.Page(site, "Douglas Adams")
item = pywikibot.ItemPage.fromPage(page)


#site = pywikibot.Site("wikidata", "wikidata")
#repo = site.data_repository()
#item = pywikibot.ItemPage(repo, "Q42")
---------------------------------------------------------------------------
NoPage                                    Traceback (most recent call last)
<ipython-input-7-7a8b3bd9b260> in <module>
      3 site = pywikibot.Site("wikidata", "wikidata")
      4 page = pywikibot.Page(site, "Douglas Adams")
----> 5 item = pywikibot.ItemPage.fromPage(page)
      6 
      7 

/srv/paws/pwb/pywikibot/page.py in fromPage(cls, page, lazy_load)
   4417                                           ''.format(page.site))
   4418         if not lazy_load and not page.exists():
-> 4419             raise pywikibot.NoPage(page)
   4420 
   4421         repo = page.site.data_repository()

NoPage: Page [[wikidata:Douglas Adams]] doesn't exist.
print(item)