pelican-feed-filter


Namepelican-feed-filter JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/pelican-plugins/feed-filter
SummaryFilter elements from feeds according to custom rules
upload_time2023-01-26 08:24:37
maintainer
docs_urlNone
authorDavid Alfonso
requires_python>=3.7,<4.0
licenseAGPL-3.0
keywords pelican plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Feed Filter

[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/feed-filter/main.yml?branch=master)](https://github.com/pelican-plugins/feed-filter/actions)
[![PyPI Version](https://img.shields.io/pypi/v/pelican-feed-filter)](https://pypi.org/project/pelican-feed-filter/)

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][1].

Filters are defined as:
* `include.item attribute`
* `exclude.item_attribute`

where `item_attribute` can be any [feed item attribute][2], 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.

[1]: https://docs.python.org/3/library/fnmatch.html "Fnmatch Python module"
[2]: https://github.com/getpelican/feedgenerator/blob/master/feedgenerator/django/utils/feedgenerator.py#L132 "Feed item attributes"
[existing issues]: https://github.com/pelican-plugins/feed-filter/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pelican-plugins/feed-filter",
    "name": "pelican-feed-filter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "pelican,plugin",
    "author": "David Alfonso",
    "author_email": "developer@davidalfonso.es",
    "download_url": "https://files.pythonhosted.org/packages/12/73/ded4c54bb785b8246dd45135de4ad817122cbf798730f32e30ef7d1e684a/pelican_feed_filter-1.1.0.tar.gz",
    "platform": null,
    "description": "# Feed Filter\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/feed-filter/main.yml?branch=master)](https://github.com/pelican-plugins/feed-filter/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/pelican-feed-filter)](https://pypi.org/project/pelican-feed-filter/)\n\nFeed Filter is a Pelican plugin that filters elements from feeds.\n\nInstallation\n------------\n\nThis plugin can be installed via:\n\n    python -m pip install pelican-feed-filter\n\nUsage\n-----\n\nThis plugin is configured through your Pelican configuration file, by setting the following variable:\n\n`FEED_FILTER = {}`\n\nDefine feed paths and include/exclude filters to apply to matching feeds. Both feed paths and filters are matched using [Unix shell-stye wildcards][1].\n\nFilters are defined as:\n* `include.item attribute`\n* `exclude.item_attribute`\n\nwhere `item_attribute` can be any [feed item attribute][2], ie. `title`, `link`, `author_name`, `categories`, ...\n\nYou 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')\n\n**Filter priorities**\n\nIf an inclusion filter is defined, only feed elements that match the filter will be included in the feed.\n\nIf an exclusion filter is defined, all feed elements except those which match the filter will be included in the feed.\n\nIf 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.\n\nIf multiple inclusion/exclusion filters are defined for the same feed path, a single match is enough to include the item in the feed.\n\nUsage examples\n--------------\n\n* Include only posts in some categories into the global feed:\n```\nFEED_ATOM = 'feed/atom'\nFEED_RSS = 'feed/rss'\nFEED_FILTER = {\n    'feed/*': {\n        'include.categories': ['software-*', 'programming']\n    }\n}\n```\n\n* Exclude an author from a category feed:\n```\nCATEGORY_FEED_ATOM = 'feed/{slug}.atom'\nCATEGORY_FEED_RSS = 'feed/{slug}.rss'\nFEED_FILTER = {\n    'feed/a-category-slug.*': {\n        'exclude.author_name': 'An Author name'\n    }\n}\n```\n\n* Exclude an author from all category feeds:\n```\nCATEGORY_FEED_ATOM = 'feed/{slug}.atom'\nCATEGORY_FEED_RSS = 'feed/{slug}.rss'\nFEED_FILTER = {\n    'feed/*.*': {\n        'exclude.author_name': 'An Author name'\n    }\n}\n```\n\n* In the global feed, exclude all posts in a category, except if written by a given author:\n```\nFEED_ATOM = 'feed/atom'\nFEED_RSS = 'feed/rss'\nFEED_FILTER = {\n    'feed/*': {\n        'include.author_name': 'An Author name',\n        'exclude.category': 'software-development'\n    }\n}\n```\n\n* In the global feed, exclude all posts whose title starts with \"Review\":\n```\nFEED_ATOM = 'feed/atom'\nFEED_RSS = 'feed/rss'\nFEED_FILTER = {\n    'feed/*': {\n        'exclude.title': 'Review*'\n    }\n}\n```\n\n* In the global feed, include all posts written by a given author OR in a certain category, except if the title starts with \"Review\":\n```\nFEED_ATOM = 'feed/atom'\nFEED_RSS = 'feed/rss'\nFEED_FILTER = {\n    'feed/*': {\n        'include.author_name': 'An Author name',\n        'include.category': 'software-development'\n        'exclude.title': 'Review*'\n    }\n}\n```\n\nContributing\n------------\n\nContributions 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][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.\n\n[1]: https://docs.python.org/3/library/fnmatch.html \"Fnmatch Python module\"\n[2]: https://github.com/getpelican/feedgenerator/blob/master/feedgenerator/django/utils/feedgenerator.py#L132 \"Feed item attributes\"\n[existing issues]: https://github.com/pelican-plugins/feed-filter/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "Filter elements from feeds according to custom rules",
    "version": "1.1.0",
    "split_keywords": [
        "pelican",
        "plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "015566582a4246eb5d27407b55da045c97263b5d8d313b8da7a28a8d4afdea83",
                "md5": "a5650544163ff9f90b220fb855ea3224",
                "sha256": "23c6f49538a06503a37ca25b981be8d1604d1b282a341371cd9fa88582e00945"
            },
            "downloads": -1,
            "filename": "pelican_feed_filter-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a5650544163ff9f90b220fb855ea3224",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 17653,
            "upload_time": "2023-01-26T08:24:35",
            "upload_time_iso_8601": "2023-01-26T08:24:35.904965Z",
            "url": "https://files.pythonhosted.org/packages/01/55/66582a4246eb5d27407b55da045c97263b5d8d313b8da7a28a8d4afdea83/pelican_feed_filter-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1273ded4c54bb785b8246dd45135de4ad817122cbf798730f32e30ef7d1e684a",
                "md5": "2e7391c6d240ede477592bc5a1739c88",
                "sha256": "fe689ab4cc0db506e919154ab0b28e604e4e09f50c200b16a487001bf8ff045d"
            },
            "downloads": -1,
            "filename": "pelican_feed_filter-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2e7391c6d240ede477592bc5a1739c88",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 17737,
            "upload_time": "2023-01-26T08:24:37",
            "upload_time_iso_8601": "2023-01-26T08:24:37.346896Z",
            "url": "https://files.pythonhosted.org/packages/12/73/ded4c54bb785b8246dd45135de4ad817122cbf798730f32e30ef7d1e684a/pelican_feed_filter-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-26 08:24:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pelican-plugins",
    "github_project": "feed-filter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pelican-feed-filter"
}
        
Elapsed time: 0.03596s