VOOZH about

URL: https://pypi.org/project/wikipedia/

⇱ wikipedia Β· PyPI


Skip to main content

wikipedia 1.4.0

pip install wikipedia

Latest release

Released:

Wikipedia API for Python

Navigation

Verified details

These details have been verified by PyPI
Maintainers
πŸ‘ Avatar for jgoldsmith from gravatar.com
jgoldsmith

Unverified details

These details have not been verified by PyPI
Project links
Meta

Project description

πŸ‘ https://travis-ci.org/goldsmith/Wikipedia.png?branch=master
πŸ‘ https://pypip.in/d/wikipedia/badge.png
πŸ‘ https://pypip.in/v/wikipedia/badge.png
πŸ‘ License

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 (/ˌwΙͺkɨˈpiːdiΙ™/ or /ˌwΙͺkiˈpiːdiΙ™/ 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/New_York'>>> 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'>>> wikipedia.set_lang("fr")>>> wikipedia.summary("Facebook", sentences=1)# Facebook est un service de rΓ©seautage social en ligne sur Internet permettant d'y publier des informations (photographies, liens, textes, etc.) en contrΓ΄lant leur visibilitΓ© par diffΓ©rentes catΓ©gories de personnes.

Note: this library was designed for ease of use and simplicity, not for advanced use. If you plan on doing serious scraping or automated requests, please use Pywikipediabot (or one of the other more advanced Python MediaWiki API wrappers), which has a larger API, rate limiting, and other features so we can be considerate of the MediaWiki infrastructure.

Installation

To install Wikipedia, simply run:

$ pip install wikipedia

Wikipedia is compatible with Python 2.6+ (2.7+ to run unittest discover) and Python 3.3+.

Documentation

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

To run tests, clone the respository on GitHub, then run:

$ pip install -r requirements.txt
$ bash runtests # will run tests for python and python3
$ python -m unittest discover tests/ '*test.py' # manual style

in the root project directory.

To build the documentation yourself, after installing requirements.txt, run:

$ pip install sphinx
$ cd docs/
$ make html

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

πŸ‘ Bitdeli badge

Project details

Verified details

These details have been verified by PyPI
Maintainers
πŸ‘ Avatar for jgoldsmith from gravatar.com
jgoldsmith

Unverified details

These details have not been verified by PyPI
Project links
Meta

Download files

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

Source Distribution

wikipedia-1.4.0.tar.gz (27.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for wikipedia-1.4.0.tar.gz
Algorithm Hash digest
SHA256 db0fad1829fdd441b1852306e9856398204dc0786d2996dd2e0c8bb8e26133b2
MD5 898944eb28062d898d3d0d948fdd3fec
BLAKE2b-256 673525e68fbc99e672127cc6fbb14b8ec1ba3dfef035bf1e4c90f78f24a80b7d

See more details on using hashes here.

Supported by

πŸ‘ Image
AWS Cloud computing and Security Sponsor πŸ‘ Image
Datadog Monitoring πŸ‘ Image
Depot Continuous Integration πŸ‘ Image
Fastly CDN πŸ‘ Image
Google Download Analytics πŸ‘ Image
Pingdom Monitoring πŸ‘ Image
Sentry Error logging πŸ‘ Image
StatusPage Status page