Metadata-Version: 2.4
Name: rssrender
Version: 0.1.0
Summary: Render RSS feeds with customizable templates
Project-URL: Homepage, https://github.com/berkeley-stat/rssrender
Project-URL: Repository, https://github.com/berkeley-stat/rssrender
Project-URL: Issues, https://github.com/berkeley-stat/rssrender/issues
Author-email: Ryan Lovett <rylo@berkeley.edu>
Maintainer-email: Ryan Lovett <rylo@berkeley.edu>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: feed,render,rss,template,terminal
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Terminals
Classifier: Topic :: Text Processing :: Markup
Requires-Python: >=3.8
Requires-Dist: feedparser>=6.0.0
Requires-Dist: jinja2>=3.0.0
Provides-Extra: dev
Requires-Dist: black>=22.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.0.250; extra == 'dev'
Description-Content-Type: text/markdown

# rssrender

Render RSS feeds for terminal display with customizable Jinja2 templates.

## Features

- Parse RSS feeds and render them for terminal output
- Filter entries by age (only show recent entries)
- Customizable output using Jinja2 templates
- HTML to plain text conversion with formatting preservation
- Content length limiting
- Optional link hiding

## Installation

```bash
pip install rssrender
```

Or install from source:

```bash
git clone git@github.com:berkeley-stat/rssrender.git
cd rssrender
pip install -e .
```

## Usage

```bash
rssrender --feed-url <RSS_FEED_URL> [--template <TEMPLATE_PATH>]
```

### Options

- `--feed-url` (required): RSS feed URL
- `--template`: Path to Jinja2 template file (default: included example template)
- `--day-threshold`: Number of days to consider an entry as recent (default: 30)
- `--max-body-length`: Maximum length of the body content (default: 400)
- `--hide-http-link`: If set, the HTTP link will not be displayed in the output

### Example

```bash
# Use the default template
rssrender --feed-url https://example.com/feed.xml

# Use a custom template and filter by last 7 days
rssrender --feed-url https://example.com/feed.xml --template ./my-template.j2 --day-threshold 7
```

## Template Format

Templates use Jinja2 syntax and have access to:

- `description`: Feed description (if available)
- `entries`: List of entries with the following fields:
  - `date`: Publication date (YYYY-MM-DD format)
  - `title`: Entry title
  - `link`: Entry URL (if not hidden)
  - `content`: Entry content (HTML converted to plain text)

### Custom Filters

Two custom filters are available in templates:

- `wrap(width, subsequent_indent, indent_all)`: Wrap text to specified width
- `indent(width, first)`: Indent lines by specified number of spaces

See the included example template for reference.

## Use Cases

- Generate MOTD (Message of the Day) from RSS feeds
- Display news feeds in terminal dashboards
- Create plain text digests from blogs
- Any terminal-based RSS feed display

## License

BSD 3-Clause License - See LICENSE file for details.
