r/Python • • Jul 19 '21

News reader 2.0 released – a Python feed reader library

Hi there!

I'm happy to announce version 2.0 of reader, a Python RSS / Atom / JSON feed reader library.

What's new?

  • Cleaner API, and more consistently named methods and attributes.

  • Timezone-aware datetimes.

  • Safer defaults: opening local (file:) feeds is now opt-in, instead of opt-out.

  • Stable plugin support.

  • The following plugins are now built-in:

    • enclosure_dedupe – deduplicate the enclosures of an entry

    • entry_dedupe – deduplicate the entries of a feed

    • mark_as_read – mark new entries of a feed as read if their title matches a regex

    • ua_fallback – retry feed requests that get 403 Forbidden with a different user agent

  • A new stable plugin hook, for running arbitrary actions for updated entries.

  • Reserved tag and metadata keys, to allow exposing reader and plugin functionality directly to the end users.

  • Improved update handling: update articles whenever their content changes, regardless of their updated date, while preventing excessive updates.

  • Lots of bug fixes.

  • Various documentation, CLI, and web application improvements.

  • PyPy 3.7 support.

  • Drop Python 3.6 support.

This is a major release, and contains some backwards incompatible changes.

What is reader?

reader takes care of the core functionality required by a feed reader, so you can focus on what makes yours different.

reader allows you to:

  • retrieve, store, and manage Atom, RSS, and JSON feeds

  • mark entries as read or important

  • add tags and metadata to feeds

  • filter feeds and articles

  • full-text search articles

  • write plugins to extend its functionality

...all these with:

  • a high-level, stable, clearly documented API

  • excellent test coverage

  • fully typed Python

To find out more, check out the GitHub repo and the docs, or give the tutorial a try.

Why use a feed reader library?

Have you been unhappy with existing feed readers and wanted to make your own, but:

  • never knew where to start?

  • it seemed like too much work?

  • you don't like writing backend code?

Are you already working with feedparser, but:

  • want an easier way to store, filter, sort and search feeds and entries?

  • want to get back type-annotated objects instead of dicts?

  • want to restrict or deny file-system access?

  • want to change the way feeds are retrieved by using Requests?

  • want to also support JSON Feed?

... while still supporting all the feed types feedparser does?

If you answered yes to any of the above, reader can help.

17 Upvotes

0 comments sorted by