cata_log_hub.providers.penny module

class cata_log_hub.providers.penny.Penny[source]

Bases: Provider

Provider class for Kaufland Wochenangebote catalog.

uid: str = 'penny-de'

A unique identifier for this provider class. Must not be changed after definition.

name: str = 'Penny'

The name of this catalog provider.

description: str = 'Penny Katalog'

The user-facing description for this provider

schedule: str = '0 3 * * *'

The crontab schedule for fetching this provider

class Configuration[source]

Bases: Configuration

markt_id: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: str = 'https://www.penny.de/angebote#handout'

The url of this catalog provider

region

alias of Germany

first_page_number: int = 0

The number of the first page in the providers api

pdf_url_template = 'https://penny-publish.blaetterkatalog.de/frontend/catalogs/{catalog_id}/2/pdf/complete.pdf'
market_url_template = 'https://www.penny.de/.rest/market/markets/market_{markt_id}'
market_catalog_url_key = 'flippingBookURL'
_get_catalog_data()[source]

Get and store the data for this providers catalog. Can be passed if no data beside the pagenumber is required to fetch pages from the provider.

Return type:

None

_get_page(page_number)[source]

Get one page from the provider.

Parameters:

page_number (PageNumber) – The number of the page in the numbering of the provider.

Return type:

bytes

Returns:

The downloaded page in bytes.

_get_valid_since()[source]

Get the datetime since which this providers catalog is valid.

Return type:

datetime

_get_valid_until()[source]

Get the datetime until which this providers catalog is valid.

Return type:

datetime

_cleanup()[source]

Additional cleanup.

Return type:

None

_logger = <Logger cata_log_hub.providers.penny.Penny (WARNING)>
class cata_log_hub.providers.penny.PennyPreview[source]

Bases: Preview, Penny

Provider class for Kaufland Wochenangebote preview catalog for next week.

uid: str = 'penny-de-preview'

A unique identifier for this provider class. Must not be changed after definition.

name: str = 'Penny-Vorschau'

The name of this catalog provider.

description: str = 'Penny Katalog im nächsten Katalog'

The user-facing description for this provider

_get_preview_timedelta()[source]

Get the dynamic timedelta between the relevant datetime and the relevant datetime of the preview.

Return type:

timedelta

Returns:

The preview timedelta.

market_catalog_url_key = 'nextWeekFlippingBookURL'
_logger = <Logger cata_log_hub.providers.penny.PennyPreview (WARNING)>