Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions wikipedia/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Wikipedia
![image](https://user-images.githubusercontent.com/67740644/124870233-fe2d1300-dfdf-11eb-889e-8e831fd0cb7a.png)

## Project description
Wikipedia is a Python library that makes it easy to access and parse data from Wikipedia.<br />
Search Wikipedia, get article summaries, get data like links and images from a page, and more.<br />
Wikipedia wraps the MediaWiki API so you can focus on using Wikipedia data, not getting it.<br />

## Installation
To install Wikipedia, simply run:<br /><br />
`$ pip install wikipedia

## Documentation
* [Read the docs Here:](https://wikipedia.readthedocs.org/en/latest/.)

## License
MIT licensed. See the *[License](https://github.com/goldsmith/Wikipedia/blob/master/LICENSE) file for full details.

## Hello wiki
🤔🤗🤔🤗🤔
6 changes: 6 additions & 0 deletions wikipedia/lang.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import wikipedia
wikipedia.set_lang("fr")
print(wikipedia.summary("Facebook", sentences=1))

# output :
# 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.
4 changes: 4 additions & 0 deletions wikipedia/wiki1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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...
5 changes: 5 additions & 0 deletions wikipedia/wiki2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import wikipedia
print(wikipedia.search("Barack"))

# output :
#[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']
10 changes: 10 additions & 0 deletions wikipedia/wiki3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import wikipedia
ny = wikipedia.page("New York")
print(ny.title)
print(ny.url)
print(ny.content)
print(ny.links[0])
# output : u'New York'
# u'http://en.wikipedia.org/wiki/New_York'
# u'New York is a state in the Northeastern region of the United States. New York is the 27th-most exten'...
# u'1790 United States Census'