Skip to main content

A library to generate RSS feeds for FastAPI

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_rss-0.1.3.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

fastapi_rss-0.1.3-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page