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.2.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: starlette-feedgen-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 38c3386202a74427a46aa871bbb251344372853a9dca277ae56408a78b43a0ab
MD5 10c638ab83b8bd03e13d78db23d26e5e
BLAKE2b-256 2ee6efcde81a9a143b803f3785ae8f50061932183673917906ee99010ba53d78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for starlette_feedgen-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 708e00788327da24e982ea9396e6bdf1415f4d07d6d43078f7d0993028e340ce
MD5 9fe3147b6423496c23ba2d774a76e40c
BLAKE2b-256 68d59b408c67fb96f9e8156c9d056afb605b7ee0e608c392d09660c869f9736f

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