Skip to content
Programmatically collect normalized news from (almost) any website.
Branch: master
Clone or download

Latest commit

kotartemiy Merge pull request #4 from dwardu89/master
Adding a gitignore, removing __pycache__ and adding requirements.txt
Latest commit 148cd6d Feb 27, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
dist first commit Feb 24, 2020
newscatcher Adding a gitignore and requirements.txt Feb 26, 2020
tests first commit Feb 24, 2020
.gitignore Adding a gitignore and requirements.txt Feb 26, 2020 Update Feb 24, 2020
newscatcherdemo.gif Add files via upload Feb 24, 2020
pyproject.toml first commit Feb 24, 2020
requirements.txt Adding a gitignore and requirements.txt Feb 26, 2020


Programmatically collect normalized news from (almost) any website. By



While working on newscatcherapi -- JSON API to query the news articles, I came up with an idea to make a simple Python package that would allow to easily grab the live news data.

When I used to be a junior data scientist working on my own side projects, it was difficult for me to operate with external data sources. I knew Python quite well, but in most cases it was not enough to build proper data pipelines that required gathering data on my own.

Even though I do not recommend to use this package for any production systems, I believe that it should be enough to test your assumptions and build some MVPs.


pip install newscatcher

Tech/framework used

The package itself is nothing more than a SQLite database with RSS feed endpoints for each website and some basic wrapper of feedparser.

Code Example/Documentation

Let's review all possible usage of the package.

In its core, it has a class called Newscatcher. This class is all you need in order to get latest news.

After installing your package, import the class:

from newscatcher import Newscatcher

Now you just need to put a url of a desired news source as an input into our class. Please take the base form url of a website (without www.,neither https://, nor / at the end of url).

For example: “nytimes”.com, “” or “”.

news_source = Newscatcher('')

If you have done it right and the source that you chose is presented in our database, you will get a variable with 3 components and 1 method:

  • -- the same string that you entered inside the class.
  • -- a list of a feedparser dictionary with latest news presented on the website.
  • news_source.headlines -- a list with latest headlines presented on the website.
  • news_source.print_headlines() -- print headlines of all latest articles.

Each element of news list is a json object with all relevant and available information regarding an article. If you want to know more about the attributes that you can extract from this json, go check the official documentation of feedparser following this link: feedparser_attributes. You can find everything that begins with entries[i]. But be aware that not all the attributes are provided by the news website.

If for some reason you do not like classes, you can always import 2 main methods and use them separately.

from newscatcher import get_news news = get_news('')


from newscatcher import get_headlines news = get_headlines('')



You can’t perform that action at this time.