Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
nlpia2-wikipedia
Updated version of `wikipedia` package because original repo has been abandoned since 2014.
Readme
NLPiA2-Wikipedia Thin Python wrapper for Wikipedia API
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.
>>> from wikipedia import wikipedia as wiki
>>> print wiki.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...
>>> wiki.search("Barack")
['Barak (given name)', 'Barack Obama', ... 'Presidential transition of Barack Obama']
>>> titles = wiki.search("New York")
>>> page = wiki.page(titles[1])
>>> page.title
'New York (State)'
>>> page.url
'http://en.wikipedia.org/wiki/New_York_(state)'
>>> page.content
'New York, sometimes called New York State...'
>>> page.summary
'New York, sometimes called New York State...'
>>> page.links[0]
'10 Hudson Yards'
>>> wiki.set_lang("fr")
>>> wiki.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.
(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.
To install Wikipedia, simply run:
$ pip install nlpia2-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/.
To run tests, clone the repository 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
MIT licensed. See the LICENSE file for full details.
FAQs
Updated version of `wikipedia` package because original repo has been abandoned since 2014.
We found that nlpia2-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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.