application.workers.feeds package#

Submodules#

application.workers.feeds.api module#

class application.workers.feeds.api.API#

Bases: object

API class that encapsulates a various API clients.

reddit#

An instance of the PRAW Reddit client used to interact with the Reddit API.

Type:

praw.Reddit

reddit: Reddit#

application.workers.feeds.fetch_next_document module#

Attempt to fetch a new document for feeds.

application.workers.feeds.fetch_next_document.fetch_next_document(feed)#

Fetches the next document for a given feed and updates or creates a feed document accordingly.

If a new document is created and notifications are enabled, it sends a notification to the feed creator.

Any errors encountered during the process are logged.

Parameters:

feed (Feed) – The feed dictionary containing feed metadata and configuration.

Returns:

True if a new document was created or an existing document was updated,

False otherwise.

Return type:

bool

application.workers.feeds.get_feeds module#

Fetch a list of data feeds.

application.workers.feeds.get_feeds.get_feeds()#

Retrieves active feeds from the given API session in batches.

Yields:

Feed – An active feed object.

Return type:

Generator[Feed, None, None]

Module contents#

Automatically fetch and update data feeds.

application.workers.feeds.fetch_feeds(**kwargs)#

Automatically fetch and update data feeds.

Parameters:

kwargs – The max number of time that this process should run.

Return type:

None