models

class catholic_mass_readings.models.Mass(date, type_, url, title, sections)
date: datetime.date | None

Alias for field number 0

property date_str: str

Gets the formatted date

sections: list[Section]

Alias for field number 4

title: str

Alias for field number 3

to_dict() dict[str, Any]

Returns a dictionary representation.

type_: MassType | str | None

Alias for field number 1

url: str

Alias for field number 2

class catholic_mass_readings.models.MassType(value: str, *args: list[Any], **kwargs: Any)

An enumeration.

to_url(dt: date) str

Generates a URL for the specified date.

Parameters:

dt (datetime.date) – The mass date.

Returns:

str containing the url.

>>> MassType.DEFAULT.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625.cfm'
>>> MassType.DAWN.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625-Dawn.cfm'
>>> MassType.DAY.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625-Day.cfm'
>>> MassType.NIGHT.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625-Night.cfm'
>>> MassType.VIGIL.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625-Vigil.cfm'
>>> MassType.YEARA.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625-YearA.cfm'
>>> MassType.YEARB.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625-YearB.cfm'
>>> MassType.YEARC.to_url(datetime.date(2025, 4, 6))
'https://bible.usccb.org/bible/readings/040625-YearC.cfm'
class catholic_mass_readings.models.Reading(verses, text)
format(parent: Section) str

Returns a formatted representation of the Reading

Parameters:

parent (Section) – The parent Section of this Reading.

Returns:

str representation of the reading.

property header: str

Gets the header for this reading.

text: str

Alias for field number 1

property title: str | None

Gets the display header for this reading.

to_dict() dict[str, Any]

Returns a Dictionary representation

verses: list[Verse]

Alias for field number 0

with_text(text: str) Reading

Replaces the text with the new text returning a new instance.

class catholic_mass_readings.models.Section(type_, header, readings)
add_alternative(reading: Reading | Iterable[Reading]) Section

Returns a new Section that appends the other alternative Reading

header: str

Alias for field number 1

readings: list[Reading]

Alias for field number 2

to_dict() dict[str, Any]

Returns a Dictionary representation

type_: SectionType

Alias for field number 0

class catholic_mass_readings.models.SectionType(value)

An enumeration.

class catholic_mass_readings.models.Verse(text, link, book)
book: str | None

The name of the book

property book_title: str | None

Gets the book title.

The link to the book.

text: str

The reference to the chapter and sentence.

to_dict() dict[str, Any]

Returns a Dictionary representation