You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is nicer than summary, imo, because you get to specify how many sentences you want. Jemisin has a really long summary, so you can test with with numbers greater than 2.
More readable in browser: https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&exsentences=2&titles=N._K._Jemisin
import sys
import wikipediaapi
wikipediaapi.log.setLevel(level=wikipediaapi.logging.DEBUG)
# Set handler if you use Python in interactive mode
out_hdlr = wikipediaapi.logging.StreamHandler(sys.stderr)
out_hdlr.setFormatter(wikipediaapi.logging.Formatter('%(asctime)s %(message)s'))
out_hdlr.setLevel(wikipediaapi.logging.DEBUG)
wikipediaapi.log.addHandler(out_hdlr)
wiki = wikipediaapi.Wikipedia('en')
page = wiki.page('N._K._Jemisin')
print(page.summary)
This is nicer than summary, imo, because you get to specify how many sentences you want. Jemisin has a really long summary, so you can test with with numbers greater than 2.
More readable in browser:
https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&exsentences=2&titles=N._K._Jemisin
JSON version:
https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&exsentences=2& format=json&titles=N._K._Jemisin
The text was updated successfully, but these errors were encountered: