Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wiki-fetch

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wiki-fetch

Parser for Wikipedia.org

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

wiki-fetch

PyPI Status PyPI Downloads Python Version License Issues

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

Options for use in console
OptionFlagLongDefaultExample
Wiki's page link-u--urlNonehttps://en.wikipedia.org/wiki/The_Doors
Search query-q--queryNoneThe Doors (band)
Page language-l--langEnglishEnglish
Part of the page-p--partallinfobox
Parts by order-i--itemallfirst
Output format-o--outputtexttext
wiki-fetch -q 'The Doors (band)' -p infobox -i first
output
Infobox: 
    The Doors: 
        The Doors: 
            Image: https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/The_Doors_1968.JPG/250px-The_Doors_1968.JPG
            Caption: 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
URL: https://en.wikipedia.org/?search=The Doors (Band)

Python

Arguments of function and class
ArgumentValuesDescription
urlstrAny Wiki's page URL
querystrAny query string
langstrAny of available languages
partinfobox, paragraph, table, list, thumb, toc, allSpecify page part
itemfirst, last, allSpecify the order of the part
from wiki_fetch.driver import Wiki

output = Wiki(lang='English').search(query='The Doors (band)', part='infobox', item='first')
print(output.json)
output
{
    "Infobox": [
        {
            "The Doors": {
                "The Doors": {
                    "Image": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/The_Doors_1968.JPG/250px-The_Doors_1968.JPG",
                    "Caption": "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"
                }
            }
        }
    ],
    "URL": "https://en.wikipedia.org/?search=The Doors (Band)"
}

Specification

Available options
Parts of pageOutput formatsLanguage
infoboxtextEnglish
paragraphjsonUkrainian
tabledictRussian
listPolish
thumbGerman
tocNederlands
Swedish
Spanish
French
Italian
Japanese
Chainese
Cebuano

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc