DataSource

class todays_paper_web.widgets.datasource.DataSource(params)[source]

Bases: object

Params: ClassVar[Type[DataSourceParams] | None] = None

See View.Params - same opt-in typed-attribute mechanism, for a data source’s params: config block instead of a widget’s XML attributes. Unlike View.Params, left as None by default: nothing reads a data source’s params except its own fetch(), so there’s no requirement that every source (registered or not) have a working one.

fetch()[source]
property params: DataSourceParams
property timestamp: datetime
static get(name, params)[source]

DataSourceParams

Every data source’s Params base — see Python API reference for why it’s separate from View’s equivalent rather than shared.

pydantic model todays_paper_web.widgets.datasource.DataSourceParams[source]

Bases: BaseModel

Base Params for every data source. Unlike ViewParams, there’s no field common to every data source - a data source has no parent/child relationship for something else to read a value off it generically the way a widget’s x/y/align/valign are - so this exists only to carry the shared extra=ignore config.