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 pyluachVerified import paths — ran on the pinned version, not inferred.
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`.
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`.
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.
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).
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.
Install the 'pyluach' package using pip: `pip install pyluach`. If using a virtual environment, ensure it is activated before installation.
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.
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.