Skip to main content

API to extract data from wikiHow

Project description

wikiHowUnofficialAPI

wikiHowUnofficilAPI aims to provide a Python-based interface to extract useful information from wikiHow articles such as article summary, steps, images, etc. in an easy-to-use way.

Installation

pip install wikiHowUnofficialAPI

Usage

Random HowTo

Learn random stuff! Retuns a random WikiHow article URL.

import wikihowunofficialapi as wha

ra = wha.random_article()
print(ra)

Article Details

Uses the article URL to return various details about an article. In addition, it returns whether an article is written by an expert or not.

import wikihowunofficialapi as wha

article = wha.Article('https://www.wikihow.com/Train-a-Dog')

print(article.url)					# Print Article's URL
print(article.title)					# Print Article's Title
print(article.intro)					# Print Article's Introduction
print(article.n_methods)				# Print number of methods in an Article
print(article.methods)					# Print a list of methods in an Article
print(article.num_votes)				# Print number of votes given to an Article
print(article.percent_helpful)				# Print percentage of helpful votes given to an Article
print(article.is_expert)				# Print True if the Article is written by an expert
print(article.last_updated)				# Print date when the Article was last updated
print(article.views)					# Print the number of views recieved by Article
print(article.co_authors)				# Print the number of co-authors of an Article
print(article.references)				# Print the number of references in an Article
print(article.summary)					# Print Article's summary
print(article.warnings)					# Print Article's warnings
print(article.tips)					# Print Article's tips

first_method = article.methods[0]
first_step = first_method.steps[0]
print(first_step)					# Print Article's first step of the first method
print(first_step.title)					# Print the title of Article's first step of the first method
print(first_step.description)				# Print the description of Article's first step of the first method

Images

Retrieves a list of image included in a step as URLs.

import wikihowunofficialapi as wha

article = wha.Article('https://www.wikihow.com/Train-a-Dog')
print(article.methods[0].steps[0].picture)		# Print the URL of the image of Article's first step of the first method

Search

Searches WikiHow for the string and returns a list containing the title of the articles. The default max results is 10, but this can be changed.

import wikihowunofficialapi as wha

max_results = 1
how_tos = wha.search_wikihow("sleep", max_results)
print(how_tos[0])

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

wikihowunofficialapi-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

wikihowunofficialapi-0.1.0-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file wikihowunofficialapi-0.1.0.tar.gz.

File metadata

  • Download URL: wikihowunofficialapi-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5

File hashes

Hashes for wikihowunofficialapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eafe7c1a855db449b4d6fcbba5fc26ee88c4ca686e29b0f4af263f1020a53fb3
MD5 5dbdf761e3c6f2bd4eecc2249fa61fb2
BLAKE2b-256 92a490251f2c278210af2d87f459542d20ee05fd671f8328aa260bf10587383b

See more details on using hashes here.

File details

Details for the file wikihowunofficialapi-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: wikihowunofficialapi-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5

File hashes

Hashes for wikihowunofficialapi-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 085dd7d79f252474668a6703e27ea2c6100a0c3db8b7b466fda675c91974c3ca
MD5 008c58d1cbfbc1d627e67b9d378a0f3c
BLAKE2b-256 7eb94f7f13485d169673bcd3342aa3bcf81353bd22c3db7c567d920478c37dcf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page