About
This package allows you to summarize text by reducing an article in size to several sentences retaining the idea of the text.
Besides of that the package extracts the following from the document:
Canonical URL of the article
Title of the article
URL of the image characterizing this article
Strips the document of excessive information (headers, footers, navigation, advertisement, etc.) and forms a clean HTML based on structured data of schema.org
Installation
easy_install wanish or pip install wanish
Usage
from wanish import Wanish
wanish = Wanish()
wanish.perform_url(document_url)
# getting doc's source canonical url
url = wanish.url
# getting document's title
title = wanish.title
# getting url of related image if document has it
image_url = wanish.image_url
# getting two-letter code of the document's language (en, de, es...)
language_code = wanish.language
# getting a clean html page of a document with article
clean_html = wanish.clean_html
# getting a short summarized description of the article reduced to several sentences (5 by default)
description = wanish.description
Available kwarg options for Wanish() class (all are optional):
wanish = Wanish(url=document_url,
positive_keywords=["main", "story"],
negative_keywords=["banner", "adv", "similar", "top-ad"],
summary_sentences_qty=5,
headers={'user-agent': 'test-purposes/0.0.1'})
url: Allows to pass an url of a document in constructor. If set, then it will automatically launch self.perform_url(url) after initialization. Default is None.
positive_keywords: A list of positive search patterns in classes and ids, for example: [“main”, “story”] . Default is None.
negative_keywords: A list of negative search patterns in classes and ids, for example: [“banner”, “adv”, “similar”, “top-ad”] . Default is None.
summary_sentences_qty: Maximum quantity of sentences in summarized text of the document. Set to 5 by default.
headers: Dict of additional custom headers for GET request to obtain web page of the article. Default is None.
Special Thanks
Metadata
Release files for wanish 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wanish-0.6.3.tar.gz | 1.9 MB | Without provenance | Details for wanish-0.6.3.tar.gz |
Release files / wanish-0.6.3.tar.gz
| Download URL | wanish-0.6.3.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2baed7f68873fe8001a02afd6350e6feae38321013cbef2960a2c21a52155d5
|
|
BLAKE2b-256 checksum How to use checksums |
def6f3f18386c0275db1e88092235b8af3a22ac1f7b1f9f7fef8d3b48314bf30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wanish 0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.