Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richardarpanet/wiki-api
📚 A basic python library enabling access to Wikipedia.org's search results and articles.
https://github.com/richardarpanet/wiki-api
api-client api-wrapper client python python-library python2 python3 wiki wikipedia wikipedia-api
Last synced: 1 day ago
JSON representation
📚 A basic python library enabling access to Wikipedia.org's search results and articles.
- Host: GitHub
- URL: https://github.com/richardarpanet/wiki-api
- Owner: richardARPANET
- Created: 2018-04-03T21:27:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-05T12:25:23.000Z (over 3 years ago)
- Last Synced: 2025-01-03T22:34:15.808Z (4 days ago)
- Topics: api-client, api-wrapper, client, python, python-library, python2, python3, wiki, wikipedia, wikipedia-api
- Language: Python
- Homepage: https://github.com/richardARPANET/wiki-api
- Size: 75.2 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.rst
Awesome Lists containing this project
README
# wiki-api
[![Build Status](https://travis-ci.org/richardasaurus/wiki-api.png?branch=master)](https://travis-ci.org/richardasaurus/wiki-api)A basic python library enabling access to Wikipedia.org's search results and articles.
## How To Use
### Installation
pip install wikiapi
### Create an instance of wiki-api
```python
from wikiapi import WikiApi
wiki = WikiApi()
wiki = WikiApi({ 'locale' : 'es'}) # to specify your locale, 'en' is default
```
### Search for something on wikipedia
```python
results = wiki.find('Barack Obama') => ['Barack_Obama', 'Barack_Obama_presidential_campaign,_2008', ...]
```
### Get information about a wiki article
```python
article = wiki.get_article(results[0])article.heading => 'Barack Obama'
article.image => 'http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Official_portrait_of_Barack_Obama.jpg/220px-Official_portrait_of_Barack_Obama.jpg'
article.summary => 'Barack Hussein Obama II (i/bəˈrɑːk huːˈseɪn oʊˈbɑːmə/; born August 4, 1961) is the 44th and current President of th...'
article.references => ['Obama: No green light for Israel to attack Iran. Cnn.com. 2009-07-07. http://www.cnn.com/2009/POLITICS/07/07/obama.israel.iran/. Retrieved January 4, 2013.', ..., .., ...]
article.content => 'Full article dump...'
article.url => 'http://en.wikipedia.org/wiki/Barack_Obama'
```## Requirements
1. Python 3
2. See requirements.txt## Running the tests
```
pip install tox
tox
```