Skip to main content

Feed Filter

Build Status PyPI Version

Feed Filter is a Pelican plugin that filters elements from feeds.

Installation

This plugin can be installed via:

python -m pip install pelican-feed-filter

Usage

This plugin is configured through your Pelican configuration file, by setting the following variable:

FEED_FILTER = {}

Define feed paths and include/exclude filters to apply to matching feeds. Both feed paths and filters are matched using Unix shell-stye wildcards.

Filters are defined as:

  • include.item attribute
  • exclude.item_attribute

where item_attribute can be any feed item attribute, ie. title, link, author_name, categories, ...

You can also match pubdate and updateddate item attributes as strings formatted with the following format: %a, %d %b %Y %H:%M:%S (e.g. 'Thu, 28 Jun 2001 14:17:15')

Filter priorities

If an inclusion filter is defined, only feed elements that match the filter will be included in the feed.

If an exclusion filter is defined, all feed elements except those which match the filter will be included in the feed.

If both include and exclude filters are defined, all feed elements except those which match some exclusion filter but no inclusion filter, will be included in the feed.

If multiple inclusion/exclusion filters are defined for the same feed path, a single match is enough to include the item in the feed.

Usage examples

  • Include only posts in some categories into the global feed:
FEED_ATOM = 'feed/atom'
FEED_RSS = 'feed/rss'
FEED_FILTER = {
    'feed/*': {
        'include.categories': ['software-*', 'programming']
    }
}
  • Exclude an author from a category feed:
CATEGORY_FEED_ATOM = 'feed/{slug}.atom'
CATEGORY_FEED_RSS = 'feed/{slug}.rss'
FEED_FILTER = {
    'feed/a-category-slug.*': {
        'exclude.author_name': 'An Author name'
    }
}
  • Exclude an author from all category feeds:
CATEGORY_FEED_ATOM = 'feed/{slug}.atom'
CATEGORY_FEED_RSS = 'feed/{slug}.rss'
FEED_FILTER = {
    'feed/*.*': {
        'exclude.author_name': 'An Author name'
    }
}
  • In the global feed, exclude all posts in a category, except if written by a given author:
FEED_ATOM = 'feed/atom'
FEED_RSS = 'feed/rss'
FEED_FILTER = {
    'feed/*': {
        'include.author_name': 'An Author name',
        'exclude.category': 'software-development'
    }
}
  • In the global feed, exclude all posts whose title starts with "Review":
FEED_ATOM = 'feed/atom'
FEED_RSS = 'feed/rss'
FEED_FILTER = {
    'feed/*': {
        'exclude.title': 'Review*'
    }
}
  • In the global feed, include all posts written by a given author OR in a certain category, except if the title starts with "Review":
FEED_ATOM = 'feed/atom'
FEED_RSS = 'feed/rss'
FEED_FILTER = {
    'feed/*': {
        'include.author_name': 'An Author name',
        'include.category': 'software-development'
        'exclude.title': 'Review*'
    }
}

Contributing

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.

To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.

Release files for pelican-feed-filter 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pelican-feed-filter 1.1.0
File Size Uploaded
pelican_feed_filter-1.1.0.tar.gz 17.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pelican-feed-filter 1.1.0
File Interpreter ABI Platform
pelican_feed_filter-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.4 kB

Release files / pelican_feed_filter-1.1.0.tar.gz

Download URL pelican_feed_filter-1.1.0.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fe689ab4cc0db506e919154ab0b28e604e4e09f50c200b16a487001bf8ff045d
BLAKE2b-256 checksum
How to use checksums
1273ded4c54bb785b8246dd45135de4ad817122cbf798730f32e30ef7d1e684a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.7.15 Linux/5.15.0-1031-azure

Release files / pelican_feed_filter-1.1.0-py3-none-any.whl

Download URL pelican_feed_filter-1.1.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23c6f49538a06503a37ca25b981be8d1604d1b282a341371cd9fa88582e00945
BLAKE2b-256 checksum
How to use checksums
015566582a4246eb5d27407b55da045c97263b5d8d313b8da7a28a8d4afdea83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.7.15 Linux/5.15.0-1031-azure

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page