RamanMalykhin / pyrsspipe

Simple and extendable CLI utility for building RSS feeds
Apache License 2.0
0 stars 0 forks source link
python rss

PyRSSPipe is a simple and extendable CLI utility for building RSS feeds. It is built on top of feedparser and rfeed.

Installation

  1. Grab a release wheel from the releases page.
  2. Install it with pip: pip install pyrsspipe-<version>.whl
  3. Set PYRSSPIPE_PIPECONFIG_DIR and PYRSSPIPE_LOG_DIR environment variables to the directories where you want to store your pipeconfigs and the log of PyRSSPipe.

Usage

PyRSSPipe is inspired by the "ETL" concept. In PyRSSPipe, "Extract" and "Load" phases for data that is supposed to make it into an RSS feed are handled by input and output modules. input modules are responsible for getting the data from whatever source. The "Transform" phase is universal and handled by the makefeed module, which creates an RSS feed from the data. output modules are responsible for writing that RSS feed to wherever. PyRSSPipe is quite agnostic to what input and output modules actually do under the hood. The only expectations are that:

PyRSSPipe is actually used with the help of JSON files called "pipeconfigs". A pipeconfig file defines what input and output modules are used for a single run of PyRSSPipe. It also defines the parameters that are passed to get_feed_items and write_feed functions in these modules respectively. In addition, it defines some parameters which are mandatory for any pipeconfig. It can be thought of in the same way as a DAG file in Apache Airflow.

After installation, PyRSSPipe exposes a CLI command pyrsspipe, which takes one and only one argument - the name of the pipeconfig file to run.

PyRSSPipe ships with some input and output modules that I built for my own use: