Skip to main content

Wikipedia is a Python library that makes it easy to access and parse data from Wikipedia.

Search Wikipedia, get article summaries, get data like links and images from a page, and more. Wikipedia wraps the MediaWiki API so you can focus on using Wikipedia data, not getting it.

>>> import wikipedia
>>> print wikipedia.summary("Wikipedia")
# Wikipedia (/wkpidi/ or /wkipidi/ WIK-i-PEE-dee-) is a collaboratively edited, multilingual, free Internet encyclopedia supported by the non-profit Wikimedia Foundation...

>>> wikipedia.search("Barack")
# [u'Barak (given name)', u'Barack Obama', u'Barack (brandy)', u'Presidency of Barack Obama', u'Family of Barack Obama', u'First inauguration of Barack Obama', u'Barack Obama presidential campaign, 2008', u'Barack Obama, Sr.', u'Barack Obama citizenship conspiracy theories', u'Presidential transition of Barack Obama']

>>> ny = wikipedia.page("New York")
>>> ny.title
# u'New York'
>>> ny.url
# u'http://en.wikipedia.org/wiki/NewYork'
>>> ny.content
# u'New York is a state in the Northeastern region of the United States. New York is the 27th-most exten'...
>>> ny.links[0]
# u'1790 United States Census'

Installation

To install Wikipedia, simply run:

$ pip install wikipedia

Documentation

Read the docs at https://wikipedia.readthedocs.org/en/latest/.

License

MIT licensed. See the LICENSE file for full details.

Credits

  • wiki-api by @richardasaurus for inspiration

  • @nmoroze and @themichaelyang for feedback and suggestions

  • The Wikimedia Foundation for giving the world free access to data

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wikipedia-0.9.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wikipedia-0.9.macosx-10.8-intel.exe (78.5 kB view details)

Uploaded Source

File details

Details for the file wikipedia-0.9.tar.gz.

File metadata

  • Download URL: wikipedia-0.9.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wikipedia-0.9.tar.gz
Algorithm Hash digest
SHA256 7ba629429ef7fadea1a6701db58cb4b42dc0ed455de457b4478b0c933d732341
MD5 65d2387bba0072c3343a5fa6a2f511d9
BLAKE2b-256 acd82ce47fce6ff1ad06c432dc268ae71760c5c676b2aa637a8f7924ae5d81d4

See more details on using hashes here.

File details

Details for the file wikipedia-0.9.macosx-10.8-intel.exe.

File metadata

File hashes

Hashes for wikipedia-0.9.macosx-10.8-intel.exe
Algorithm Hash digest
SHA256 3e116b58d48432d558ceb6c6760761fa6f169c290d6c64db41700fef1ae82874
MD5 b48cc856113f7fed5736545503818ffc
BLAKE2b-256 374877446a493db5c500f93375c6c2391c46923650ad878de57a4ee60d164212

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page