hebrewcal¶
A pure-Python library for the Hebrew calendar.
hebrewcal makes the Hebrew calendar usable programmatically and converts it
bidirectionally against the Gregorian and Julian calendars. Every computation is
performed locally — the library never issues network calls to any external service.
It serves both religious use (holidays, Shabbat, Havdalah, zmanim, Torah readings, the Omer, yahrzeit, the sabbatical and jubilee cycle, for Israel and the Diaspora) and academic use (historical, medieval and ancient dates, Babylonian and biblical month names, proleptic calendars, the Julian/Gregorian reform, and the documented “missing years” of the Anno Mundi count).
Project status
Early development. The calendar core, conversion and date handling (Phase 1) are implemented and documented here. Astronomy, holidays and religious times follow on the roadmap.
The idea in one sentence¶
Everything pivots on the Rata Die (RD) day count from Dershowitz & Reingold,
Calendrical Calculations: every calendar implements only to_rd and from_rd, and
conversion between any two calendars always goes through RD.
from hebrewcal import GregorianDate, to_hebrew, weekday
g = GregorianDate(1867, 10, 31)
print(to_hebrew(g)) # HebrewDate(year=5628, month=8, day=2)
print(weekday(g).name) # THURSDAY
Getting started
User guide
- User guide
- Rata Die — the conversion pivot
- Calendars and conversion
- Parsing dates
- Formatting dates
- Hebrew numerals (gematria)
- Month and weekday names
- Hebrew calendar internals
- The Anno Mundi era and the “missing years”
- Astronomy and locations
- Holidays
- Religious times
- Alternative calendars
- Command-line interface
- How the pieces fit together
Reference
- Examples
- Answer a historical conversion question
- List the Gregorian date of Rosh Hashanah for several years
- Compute a yahrzeit (anniversary) date
- Label a date with a gematria year
- Work with a historical (Julian) date
- Parse user input and report the Hebrew date
- Survey the keviah of a decade
- Round-trip any date through Rata Die
- Testing and development
- API reference
- Contributing to hebrewcal
- Changelog