Skip to main content

RSS/Atom feeds generation for Starlette, adapted from Django syndication feed framework

Project description

Starlette FeedGen

RSS/Atom feeds generation for Starlette, adapted from Django syndication feed framework.

Installation

pip install starlette_feedgen

Usage

from typing import NamedTuple
from starlette.applications import Starlette
from starlette_feedgen import FeedEndpoint

class FeedItem(NamedTuple):
    title = 'Hello'
    description = 'There'
    link = 'http://example.com/article'

app = Starlette()

@app.route('/feed')
class Feed(FeedEndpoint):
    title = 'Example RSS Feed'
    description = 'With example item'
    link = 'http://example.com'

    async def get_items(self):
        yield FeedItem()

Example RSS Output:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Example RSS Feed</title>
        <link>http://example.com</link>
        <description>With example item</description>
        <atom:link rel="self" href="/feed"></atom:link>
        <lastBuildDate>Wed, 27 May 2020 13:38:55 +0000</lastBuildDate>
        <item>
            <title>Hello</title>
            <link>http://example.com/article</link>
            <description>There</description>
            <guid>http://example.com/article</guid>
        </item>
    </channel>
</rss>

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

starlette-feedgen-0.1.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

starlette_feedgen-0.1.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file starlette-feedgen-0.1.1.tar.gz.

File metadata

  • Download URL: starlette-feedgen-0.1.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.23.0

File hashes

Hashes for starlette-feedgen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1a8a976fa2bfc3f1eaee70aa3061322801b887e1feb988fdf1475b3ed3975230
MD5 0140cec49f12fd08970393361a8739f2
BLAKE2b-256 6f28e5d3a15eb1e608ead78971e6926583b468bd3f75e9a1fb0e9e4b330417a5

See more details on using hashes here.

File details

Details for the file starlette_feedgen-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for starlette_feedgen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b62d594854f2b6230336647f92b688df845de85220858cb586db8c3551ddf308
MD5 b22e3cfddd8ef4e63bfa24fbc7c17817
BLAKE2b-256 ccd7fbeebed660507f8b360d14d5afda6e9e6a27671dfd565f1ae5147fd92d1e

See more details on using hashes here.

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