Skip to main content

Roman Catholic liturgical calendar computation

Project description

Litcal-roman

Roman Catholic liturgical calendar (Ordinary Form) computation in pure Python.

Given a date and a calendar configuration, litcal-roman returns the fully resolved liturgical day: the winning celebration after precedence resolution, any displaced celebrations, the liturgical season and week, vestment color, psalter week, and lectionary cycles.

Precedence rules follow the General Norms for the Liturgical Year and the Calendar) (GNLYC), with transfer rules applied per region. Currently only support US region.

[!NOTE] This entire project was vibe-coded over a weekend. I'm pretty confident that it's accurate because Claude tested it against four years of data from Romcal, the software Kenneth G. Bath first wrote in 1993. Even so, it is with great trepidation that I release a calendar (combining the complexities of the civil and liturgical calendar, no less) library into the world. I welcome issues and PRs and have every intention to deliver a quality library, but as the license says, this software is provided "as is."

Installation

# pip

pip install litcal-roman

# uv

uv add litcal-roman

Requires Python 3.12+.

Quick start

from datetime import date
from litcal_roman import get_liturgical_day, CalendarConfig

config = CalendarConfig.us()
day = get_liturgical_day(date(2026, 3, 29), config)

print(day.celebration.name)   # "Palm Sunday of the Passion of the Lord"
print(day.season)             # Season.LENT
print(day.celebration.color)  # LiturgicalColor.RED
print(day.sunday_cycle)       # SundayCycle.B

When a temporale celebration is displaced by a higher-ranked sanctorale day, it appears in day.displaced:

day = get_liturgical_day(date(2026, 6, 22), config)  # Saint Paulinus of Nola, Bishop / Saints John Fisher, Bishop, and Thomas More, Martyrs / 12th Sunday OT
print(day.celebration.name)    # "Saint Paulinus of Nola, Bishop"
print(day.displaced[0].name)   # "Saints John Fisher, Bishop, and Thomas More, Martyrs"
print(day.displaced[1].name)   # "Twelfth Sunday in Ordinary Time"

CalendarConfig

CalendarConfig.universal()   # No transfers, no national propers
CalendarConfig.us()          # USCCB propers + standard US transfers

The US configuration transfers Ascension to the 7th Sunday of Easter, Epiphany to the nearest Sunday, and Corpus Christi to the Sunday after Trinity Sunday. These can be overridden individually:

config = CalendarConfig(
    region="us",
    transfer_ascension=False,   # keep Ascension on Thursday
    transfer_epiphany=True,
    transfer_corpus_christi=True,
)

LiturgicalDay fields

Field Type Description
date date Civil date
season Season Liturgical season
week int Week within the season
weekday int ISO weekday (1=Mon, 7=Sun)
psalter_week int Week of the four-week Psalter (1–4)
celebration Celebration Winning celebration after precedence resolution
displaced tuple[Celebration, ...] Celebrations that lost precedence, descending by rank
scripture_cycle ScriptureCycle Year I or II (weekday lectionary)
sunday_cycle SundayCycle Cycle A, B, or C (Sunday lectionary)
region str Region key used to produce this day

Types

All enums and dataclasses are available under litcal_roman.models:

from litcal_roman import models

models.Season.LENT
models.Rank.SOLEMNITY
models.LiturgicalColor.WHITE
models.SundayCycle.A
models.ScriptureCycle.YEAR_I

Or import directly:

from litcal_roman.models import Season, Rank, LiturgicalColor

Regions

Key Description
"universal" General Roman Calendar, no transfers
"us" USCCB propers, US transfer rules

Changelog

Changelog

License

BSD-3-Clause

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

litcal_roman-0.1.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litcal_roman-0.1.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file litcal_roman-0.1.0.tar.gz.

File metadata

  • Download URL: litcal_roman-0.1.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for litcal_roman-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab0cc4d87d308c3f5b89fd5be3c3eee5474c27bc8a853bfa32cefff62dcea883
MD5 e3f1f96773655ec330f112a975711799
BLAKE2b-256 2640fde3c0ebff8b14fc8f28de48872c175cd1f2431509adb013175d99c26c3b

See more details on using hashes here.

File details

Details for the file litcal_roman-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: litcal_roman-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for litcal_roman-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c3a3e638f529718d7cf9ce77ead4b9b29d216ab9cb92c9ecc7740b5c285a4f8
MD5 f5ac8490ea5b3a1c15bfdc83abcffce4
BLAKE2b-256 695333e4e4dc138629edede2f4ab2774b54ea4f9e9aa005bdc1bae6b2c68b03c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page