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
Metadata
Release files for wikipedia 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wikipedia-0.9.1.tar.gz | 15.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wikipedia-0.9.1.macosx-10.8-intel.exe | Details |
Total release size: 93.5 kB
Release files / wikipedia-0.9.1.tar.gz
| Download URL | wikipedia-0.9.1.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39d55a4e7ab467f6d1b182e9d220dca6ca52288870aacc8e535e3b629a925967
|
|
BLAKE2b-256 checksum How to use checksums |
cae80d1ae2c94a13e17e936efc7f5b3a127bc17fc83dc73fec3063a1358de159
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / wikipedia-0.9.1.macosx-10.8-intel.exe
| Download URL | wikipedia-0.9.1.macosx-10.8-intel.exe |
|---|---|
| Size | 78.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba060db1abbd8cc6cf0ed11386ed5c66e582d94e68c06563aedd06459df1ba76
|
|
BLAKE2b-256 checksum How to use checksums |
47b774cae8af6b07f22fa5130b74efa2c0f814d68c64fb4cb4e561693b20141a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |