Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
.. image:: https://travis-ci.org/goldsmith/Wikipedia.png?branch=master :target: https://travis-ci.org/goldsmith/Wikipedia .. image:: https://pypip.in/d/wikipedia/badge.png :target: https://crate.io/packages/wikipedia .. image:: https://pypip.in/v/wikipedia/badge.png :target: https://crate.io/packages/wikipedia .. image:: https://pypip.in/license/wikipedia/badge.png :target: https://pypi.python.org/pypi/wikipedia/ :alt: 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 <https://www.mediawiki.org/wiki/API>
__ so you can focus on using
Wikipedia data, not getting it.
.. code:: python
import wikipedia print wikipedia.summary("Wikipedia")
wikipedia.search("Barack")
ny = wikipedia.page("New York") ny.title
ny.url
ny.content
ny.links[0]
wikipedia.set_lang("fr") wikipedia.summary("Facebook", sentences=1)
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 <http://www.mediawiki.org/wiki/Manual:Pywikipediabot>
__ (or one of the other more advanced Python MediaWiki API wrappers <http://en.wikipedia.org/wiki/Wikipedia:Creating_a_bot#Python>
__), which has a larger API, rate limiting, and other features so we can be considerate of the MediaWiki infrastructure.
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+.
Read the docs at https://wikipedia.readthedocs.org/en/latest/.
Quickstart <https://wikipedia.readthedocs.org/en/latest/quickstart.html>
__Full API <https://wikipedia.readthedocs.org/en/latest/code.html>
__To run tests, clone the respository on GitHub <https://github.com/goldsmith/Wikipedia>
__, 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
MIT licensed. See the LICENSE file <https://github.com/goldsmith/Wikipedia/blob/master/LICENSE>
__ for
full details.
wiki-api <https://github.com/richardasaurus/wiki-api>
__ by
@richardasaurus for inspirationWikimedia Foundation <http://wikimediafoundation.org/wiki/Home>
__ for giving
the world free access to data.. image:: https://d2weczhvl823v0.cloudfront.net/goldsmith/wikipedia/trend.png :alt: Bitdeli badge :target: https://bitdeli.com/free
FAQs
Wikipedia API for Python
We found that wikipedia demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.