An open API service indexing awesome lists of open source software.

https://github.com/sbordeyne/fastapi_rss

A simple plug-in to FastAPI, that allows easy RSS feed generation.
https://github.com/sbordeyne/fastapi_rss

fastapi python3 rss-generator

Last synced: 15 days ago
JSON representation

A simple plug-in to FastAPI, that allows easy RSS feed generation.

Awesome Lists containing this project

README

          

# FastAPI RSS

A library to easily integrate RSS Feeds into FastAPI

## Rationale

The RSS standard has been around for a long time, and the specification has not
changed much in the past 20 years. Regardless, it is still a useful format, and
there is an added value to have an automated feed for updates about an API
(notify users of upcoming changes), or in general as a backend for full-featured
applications

## Usage

You will need to import at least three classes to use that library:

- `RSSResponse`, which is a subclass of `starlette.Response`. It's a `text/xml` typed response which will handle generating the XML from the pydantic models
- `RSSFeed` which is a pydantic model that represents an RSS feed according to the `RSS v2.0` specification from the **World Wide Web Consortium**
- `Item` which is another pydantic model that represents an item in the feed.

Once those are imported, instanciate an `RSSFeed` object, with the appropriate parameters, then return an `RSSResponse` with that feed.

Your endpoint should now return an appropriate XML document representing your RSS feed.
Look at example/app.py for an example app that uses the **W3C** RSS example.