RSS feeds from TSV, CSV, JSON or Python lists, for any Python web framework or a static site.

0 downloads

dbbasic-rss/dbbasic_rss/__init__.py
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-rss.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-rss.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-rss.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Initial release of dbbasic-rss v1.0.0 bbf4a01 1 year, 1 month ago History
__init__.py · 1.3 KB · 53 lines
1"""
2dbbasic-rss: Simple, composable RSS feed generation for Python
3
4A Unix-philosophy approach to RSS feeds:
5- Read from simple data sources (TSV, CSV, JSON, lists)
6- Generate standards-compliant RSS 2.0
7- Framework-agnostic (works with Flask, Django, FastAPI, static sites)
8- No heavy dependencies
9- Composable with dbbasic-tsv and other modules
10
11Quick Start:
12 # One-liner
13 import dbbasic_rss as rss
14 rss.generate('articles.tsv', 'feed.xml')
15
16 # From TSV (works with dbbasic-tsv)
17 feed = rss.from_tsv('articles.tsv',
18 title='My Blog',
19 url_pattern='https://example.com/{slug}/')
20 feed.write('feed.xml')
21
22 # From list of dicts
23 posts = [{'title': 'Post 1', 'date': '2025-10-19', 'url': 'https://...'}]
24 feed = rss.from_posts(posts)
25 print(feed.to_xml())
26
27 # Custom feed
28 feed = rss.Feed(title='My Blog', link='https://example.com')
29 feed.add_post(title='Article', link='https://example.com/article/')
30 feed.write('feed.xml')
31"""
32
33from .feed import Feed, FeedItem
34from .generators import (
35 from_posts,
36 from_tsv,
37 from_csv,
38 from_json,
39 from_directory,
40 generate,
41)
42
43__version__ = "1.0.0"
44__all__ = [
45 "Feed",
46 "FeedItem",
47 "from_posts",
48 "from_tsv",
49 "from_csv",
50 "from_json",
51 "from_directory",
52 "generate",
53]