Skip to the content.

PyPI version License Documentation Status Downloads

πŸ“° news-fetch

news-fetch extracts structured data from a news article URL with one call: Newspaper(url=...).get_dict 🌐. Under the hood it’s built on newspaper4k, but it isn’t just a wrapper around it β€” it exists to fix the gaps single-engine extraction leaves:


Source Link
PyPI: https://pypi.org/project/news-fetch/
Repository: https://santhoshse7en.github.io/news-fetch/
Documentation: https://santhoshse7en.github.io/news-fetch_doc/ (Not Yet Created!)

πŸ“¦ Dependencies

news-fetch is intentionally lightweight (~50MB): newspaper4k, beautifulsoup4, requests, and Unidecode. No optional extras.

πŸ“ Extracted Information

news-fetch extracts the following attributes from news articles. You can also check out an example JSON file.

πŸ”§ Installation

Install from PyPI with pip:

pip install news-fetch

Or install from source:

git clone https://github.com/santhoshse7en/news-fetch.git
cd news-fetch
pip install .

πŸš€ Usage

To scrape all the news details, use the newspaper function:

from newsfetch.news import Newspaper

news = Newspaper(url='https://www.thehindu.com/news/cities/Madurai/aa-plays-a-pivotal-role-in-helping-people-escape-from-the-grip-of-alcoholism/article67716206.ece')
print(news.headline)
# Output: 'AA plays a pivotal role in helping people escape from the grip of alcoholism'
print(news.word_count, news.reading_time_minutes)
# Output: 812 4

To discover recent article URLs from a news site (via its sitemaps/RSS feeds β€” no browser required):

from newsfetch.discovery import NewsSiteURLExtractor

site = NewsSiteURLExtractor(news_domain='https://www.bbc.com', limit=10)
for article in site.articles:
    print(article)
# Output: {'url': 'https://www.bbc.com/news/articles/...', 'title': '...', 'date': '2026-07-10T16:56:53Z'}

To scrape many URLs at once, with per-URL failures isolated:

from newsfetch.news import Newspaper

results = Newspaper.from_urls(site.urls, max_workers=5)
for result in results:
    if result is not None:
        print(result.headline)

🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Make sure to update tests as appropriate.

πŸ“„ License

This project is licensed under the MIT License.