Parser for Wikipedia.org
Project description
wiki-fetch
Installation
- PyPI
pip install wiki-fetch
- Source
git clone git@github.com:d3z-the-dev/wiki-fetch.git
cd wiki-fetch && poetry build
pip install ./dist/*.whl
Usage
CLI
Option | Flag | Long | Default | Example |
---|---|---|---|---|
Wiki's page link | -u |
--url |
None | https://en.wikipedia.org/wiki/The_Doors |
Search query | -q |
--query |
None | The Doors (band) |
Page language | -l |
--lang |
English | English |
Part of the page | -p |
--part |
all | infobox |
Parts by order | -i |
--item |
all | first |
wiki-fetch -q 'The Doors (band)' -p infobox -i first
output
Infobox:
The Doors:
The Doors:
Image 1: https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/The_Doors_1968.JPG/250px-The_Doors_1968.JPG
Image title: The Doors in 1966: Morrison (left), Densmore (centre), Krieger (right) and Manzarek (seated)
Background information:
Origin: Los Angeles, California, U.S.
Genres:
Psychedelic Rock
Blues Rock
Acid Rock
Years active:
1965-1973
1978
Labels: Elektra, Rhino
Spinoffs:
The Psychedelic Rangers
Butts Band
Nite City
Manzarek-Krieger
Spinoff of: Rick & the Ravens
Past members:
Jim Morrison
Ray Manzarek
Robby Krieger
John Densmore
Website: thedoors.com
Python
Argument | Values | Description |
---|---|---|
url | str |
Any Wiki's page URL |
query | str |
Any query string |
lang | str |
Any of available languages |
part | infobox , paragraph , table , list , thumb , toc , all |
Specify page part |
item | first , last , all |
Specify the order of the part |
from wiki_fetch.driver import Wiki
output = Wiki().search(query='The Doors (band)', part='infobox', item='first')
print(output.json)
output
{
"Infobox": {
"The Doors": {
"The Doors": {
"Image 1": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/The_Doors_1968.JPG/250px-The_Doors_1968.JPG",
"Image title": "The Doors in 1966: Morrison (left), Densmore (centre), Krieger (right) and Manzarek (seated)"
},
"Background information": {
"Origin": "Los Angeles, California, U.S.",
"Genres": [
"Psychedelic Rock",
"Blues Rock",
"Acid Rock"
],
"Years active": [
"1965-1973",
"1978"
],
"Labels": "Elektra, Rhino",
"Spinoffs": [
"The Psychedelic Rangers",
"Butts Band",
"Nite City",
"Manzarek-Krieger"
],
"Spinoff of": "Rick & the Ravens",
"Past members": [
"Jim Morrison",
"Ray Manzarek",
"Robby Krieger",
"John Densmore"
],
"Website": "thedoors.com"
}
}
}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wiki_fetch-0.0.3.tar.gz
(11.1 kB
view hashes)
Built Distribution
wiki_fetch-0.0.3-py3-none-any.whl
(11.6 kB
view hashes)
Close
Hashes for wiki_fetch-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1e7afee9ad32971406b6effceb54292f6805d49d3f22f93fca03c776a9ba3bc |
|
MD5 | b6bd473cdec9316b1fa417f25bb901e6 |
|
BLAKE2b-256 | 44cc9d7ab84dbf781738cb18fdd7ecb2bdc2d578adb68f950f38c3c786a146bb |