Metadata-Version: 2.3
Name: django-feedparser-low
Version: 0.1.0
Summary: Django backend only working with Feedparser
Author: Paul Traylor
Author-email: Paul Traylor <kungfudiscomonkey@gmail.com>
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: 3.16
Requires-Dist: django>=6.0
Requires-Dist: django-crontask>=2.0.0
Requires-Dist: feedparser>=6.0.14
Requires-Dist: python-dateutil
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# Django backend only working with Feedparser

There are other [feedparser] apps for [django tasks], but they have varied support levels.
Hopefully this will be simple enough for maintainace to be simple.

The goal of this project is to have a simple `Feed` object that can be registered and a simple task to schedule scrapes.

Those that want to integrate should use Django [post_save] signal.

```python
@reciever(post_save, Entry)
def entry_post_save(instance: Entry, **kwargs):
    # Feed was scraped and entry was either newly created, or updated
```

There is an optional helper that combines checks with automatically calling a task.

```python
from django.tasks import task
from django_feedparser_low.decorators import feed_filter
from django_feedparser_low.models import Entry


@feed_filter(lambda entry: entry.feed.url == "https://example.com/index.xml")
@task
def process_entry(pk: str):
    # Only trigger this task, if the scraped Entry matches our filter
    entry: Entry = Entry.objects.get(pk=pk)
```

[feedparser]: https://pypi.org/project/feedparser/
[django tasks]: https://docs.djangoproject.com/en/6.0/topics/tasks/
[post_save]: https://docs.djangoproject.com/en/6.0/ref/signals/#django.db.models.signals.post_save
