Registry / serialization / pyluach

pyluach

JSON →
library2.3.0pypypi✓ verified 26d ago

Pyluach is a Python package designed for manipulating Hebrew (Jewish) calendar dates. It provides functionalities for converting between Hebrew and Gregorian dates, calculating date differences, finding weekdays, identifying weekly Torah readings (Parshios), and determining holidays. The library is actively maintained, with version 2.3.0 being the current stable release, and new minor versions released periodically.

pip install pyluach
INSTALL
IMPORT
SIG · PYLUACH
P
pyluach
serializationpythonv2.3.0
Install
1.5s avg
Import
10ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.010s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.004s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dates
from pyluach import dates
hebrewcal
from pyluach import hebrewcal
parshios
from pyluach import parshios
HebrewDate
from pyluach.dates import HebrewDate
GregorianDate
from pyluach.dates import GregorianDate

This quickstart demonstrates how to get the current Hebrew date, convert between Gregorian and Hebrew dates, identify Jewish holidays, and retrieve the weekly Torah portion (Parsha) using `pyluach`.

from pyluach import dates, hebrewcal, parshios # Get today's Hebrew date today = dates.HebrewDate.today() print(f"Today's Hebrew date: {today.hebrew_date_string(hebrew=True)}") print(f"Today's Gregorian equivalent: {today.to_greg()}") # Convert between Gregorian and Hebrew dates greg_date = dates.GregorianDate(1986, 3, 21) heb_date = greg_date.to_heb() print(f"Gregorian {greg_date} is Hebrew {heb_date}") # Check for holidays and parsha rosh_hashana = dates.HebrewDate(5782, 7, 1) print(f"Holiday on Rosh Hashana 5782: {rosh_hashana.holiday()}") # Get weekly Torah portion parsha_date = dates.GregorianDate(2021, 3, 10) print(f"Parsha for {parsha_date}: {parshios.getparsha_string(parsha_date)}")
Debug
Known issues
gotchaThe `holiday()` method (e.g., `HebrewDate.holiday()`) includes all major, minor, and fast days, whereas the `festival()` method (e.g., `HebrewDate.festival()` or `hebrewcal.festival()`) explicitly *excludes* fast days and often includes other working festival days (Chol Hamoed etc.). Using the wrong method can lead to unexpected holiday lists.
fix
Carefully choose between `holiday()` for comprehensive listings and `festival()` when fast days should be excluded or specific festival types are needed. Review the method documentation for precise behavior and parameters like `include_working_days`.
affects: 2.x
gotchaPyluach's `JulianDay` object, while representing a Julian day number, treats the day transition at midnight (like conventional dates) rather than the astronomical convention of noon. This can lead to off-by-one errors for users expecting traditional astronomical Julian Day behavior around midday.
fix
Be aware that `pyluach`'s internal `JulianDay` numbers align with midnight transitions. If astronomical precision around noon is critical, manual adjustment or external astronomical libraries might be needed to map to `pyluach`'s `JulianDay` representation correctly.
affects: 2.x
gotchaHebrew month numbering in `pyluach`, especially when instantiating `HebrewDate` or `hebrewcal.Month`, follows a non-sequential order: Tishrei (7) through Adar Sheni (13, if applicable for a leap year), then Nissan (1) through Elul (6). This differs from a simple 1-12 or 1-13 enumeration and can be a source of `ValueError` if incorrect month numbers are used.
fix
Always refer to the `pyluach` documentation or use named constants/functions (if available, or create your own mapping) to ensure correct Hebrew month integer representation, especially for months like Tishrei (7) or Nissan (1).
affects: 2.x
Errors
Common errors & fixes
ValueError: day does not exist in month
This error occurs when attempting to create a HebrewDate or GregorianDate object with a day value that is not valid for the specified month and year (e.g., 'February 30th' or a day number exceeding the actual number of days in a Hebrew month).
fix
Ensure that the day, month, and year values passed to the date constructor form a valid calendar date according to the respective calendar system. For example, check the number of days in the specific Hebrew month or handle Adar I/II correctly.
ModuleNotFoundError: No module named 'pyluach'
This error indicates that the 'pyluach' library is not installed in your Python environment or is not accessible via the Python path.
fix
Install the 'pyluach' package using pip: `pip install pyluach`. If using a virtual environment, ensure it is activated before installation.
TypeError: 'module' object is not callable
This error typically arises when you try to call a Python module directly as if it were a function or class, instead of calling a specific class or function within that module. For instance, attempting to call `pyluach.dates()` instead of `pyluach.dates.HebrewDate()` or `pyluach.dates.GregorianDate()`.
fix
Ensure you are instantiating the correct class (e.g., `HebrewDate`, `GregorianDate`) or calling the correct function from within the module. For example, `from pyluach import dates; my_date = dates.HebrewDate(5784, 1, 1)` to create a Hebrew date object.
TypeError: HebrewDate() missing 1 required positional argument: 'day'
This error occurs when you call the `HebrewDate` (or `GregorianDate`) constructor without providing all the necessary positional arguments. For example, `HebrewDate(year, month)` is missing the `day` argument.
fix
Provide all required positional arguments to the constructor. For `HebrewDate`, this typically means `year`, `month`, and `day`. Example: `from pyluach.dates import HebrewDate; date_obj = HebrewDate(5784, 7, 1)` for Tishrei 1, 5784.
Upgrade
Version history
2.3.0latest on PyPI · released Sep 9, 2025
Audit
Dependencies
pythonrequiredRequires Python 3.8 or higher.
Agent activity
17 hits · last 30 days
node
14
Amazon
1
Resources
pyluach — pip install pyluach · libregistry