gorschal/wanish
gorschal/wanish has 47 GitHub stars and 15 forks. Star changes are not measured yet. Last checked 2026-11-11 16:07 UTC. Last push 2026-07-19.
Summarize web articles: extract clean content, title, image, language, and generate text summaries
측정된 스타 증가
- in 24h
- 업데이트 지연
- in 7 days
- 업데이트 지연
- in 15 days
- 업데이트 지연
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAbout
Wanish is a lightweight Python package for extracting key information from web articles and generating concise summaries. It reduces full-length articles to a few essential sentences while preserving the core meaning.
.. note:: This project is in maintenance mode. No new features are being added, but the code remains stable and fully functional for production use.
Key Features
* **Smart Summarization:** Extracts the main idea of the text into a short summary.
* **Content Extraction:** Cleans HTML by removing ads, navigation, headers, and footers.
* **Metadata Retrieval:** Automatically detects:
* Canonical URL
* Article Title
* Main Image URL
* Language Code (e.g., 'en', 'de', 'es')
* **Clean HTML Output:** Returns structured, clean HTML based on schema.org data.
Installation
------------
You can install Wanish via pip:
.. code-block:: bash
pip install wanish
Usage
-----
Basic usage example:
.. code-block:: python
from wanish import Wanish
# Initialize the parser
wanish = Wanish()
# Process the URL
wanish.perform_url("https://example.com/article")
# Access extracted data
print(wanish.url) # Canonical URL
print(wanish.title) # Article title
print(wanish.image_url) # Main image URL
print(wanish.language) # Language code (e.g., 'en')
print(wanish.clean_html) # Cleaned HTML content
print(wanish.description) # Generated summary (5 sentences by default)
Configuration
-------------
You can customize the behavior by passing optional arguments to the ``Wanish`` class:
.. code-block:: python
wanish = Wanish(
url="https://example.com/article", # Optional: auto-processes URL on init
positive_keywords=["main", "story"], # Class/ID patterns to keep
negative_keywords=["banner", "ad"], # Class/ID patterns to remove
summary_sentences_qty=5, # Length of summary
headers={'user-agent': 'my-bot/1.0'} # Custom HTTP headers
)
Parameter Details
- url (str, optional): If provided, the URL is processed immediately upon initialization. Default:
None. - positive_keywords (list, optional): List of CSS class or ID substrings that indicate important content (e.g.,
["article-body", "content"]). Default:None. - negative_keywords (list, optional): List of CSS class or ID substrings to exclude (e.g.,
["sidebar", "ads", "footer"]). Default:None. - summary_sentences_qty (int, optional): Number of sentences in the generated summary. Default:
5. - headers (dict, optional): Custom HTTP headers for the request. Useful for bypassing basic bot protection. Default:
None.
Special Thanks
This project builds upon the excellent work of the following libraries:
NLTK <https://github.com/nltk/nltk>_python-readability <https://github.com/buriy/python-readability>_langid.py <https://github.com/saffsd/langid.py>_
관련 프로젝트 살펴보기
freeCodeCamp/freeCodeCamp
freeCodeCamp.org의 오픈 소스 코드베이스와 커리큘럼입니다. 수학, 프로그래밍, 컴퓨터 과학을 무료로 배울 수 있습니다.
459,013 스타donnemartin/system-design-primer
대규모 시스템 설계 방법을 배우고 시스템 설계 면접을 준비할 수 있습니다. Anki 플래시카드가 포함되어 있습니다.
377,634 스타react/react
웹과 네이티브 사용자 인터페이스를 위한 라이브러리.
252,533 스타vuejs/vue
Vue 2 저장소입니다. Vue 3은 https://github.com/vuejs/core를 방문하세요.
212,530 스타