usccb

class catholic_mass_readings.usccb.USCCB

Interface for querying the Daily Readings from https://bible.usccb.org/bible/readings/

DEFAULT_MASS_TYPES: Final[list[models.MassType]] = [DAY, YEARA, YEARB, YEARC, DEFAULT]

Default list of MassTypes to try when searching for a mass on a given mass date.

async close() Self

Closes the underlying connection.

async get_mass(date: datetime.date, type_: models.MassType) models.Mass | None

Gets the mass for the date and type.

static get_mass_dates(start: datetime.date, end: datetime.date | None = None, step: datetime.timedelta = datetime.timedelta(days=7)) Iterable[datetime.date]

Gets the list of mass dates from the current date until end or max_query_date stepping by the step arg.

async get_mass_from_date(date: datetime.date, types: list[models.MassType] | None = None) models.Mass | None

Gets the first mass for the specified date and type.

Parameters:
  • date (datetime.date) – The mass date.

  • types (list[models.MassType]) – The list of mass types to use (defaults to DEFAULT_MASS_TYPES)

Returns:

Mass if retrieved from one of the MassTypes on the date.

async get_mass_from_url(url: str) models.Mass | None

Gets the mass at the particular url.

async get_mass_types(date: date) list[MassType]

Gets the list of mass types for the specified date.

Parameters:

date (datetime.date) – The mass date.

Returns:

list[models.MassType] for each of the supported mass types.

static get_sunday_mass_dates(start: datetime.date, end: datetime.date | None = None) Iterable[datetime.date]

Gets the list of Sunday mass dates from the next Sunday until end or max_query_date.

async get_today_mass(type_: models.MassType | None = None) models.Mass | None

Gets the mass for today’s date.

Parameters:

type (MassType) – The type of Mass (if not specified, then will select the first mass from DEFAULT_MASS_TYPES).

Returns:

Mass if retrieved from one of the MassTypes on the date.

static max_query_date() date

Gets latest date that can be queried

static today() date

Gets today’s date