{"id":2699,"library":"pyluach","title":"Pyluach: Hebrew (Jewish) Calendar Dates","description":"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.","status":"active","version":"2.3.0","language":"en","source_language":"en","source_url":"https://github.com/simlist/pyluach","tags":["hebrew calendar","jewish calendar","dates","holidays","parsha","gregorian conversion"],"install":[{"cmd":"pip install pyluach","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Requires Python 3.8 or higher.","package":"python","optional":false}],"imports":[{"symbol":"dates","correct":"from pyluach import dates"},{"symbol":"hebrewcal","correct":"from pyluach import hebrewcal"},{"symbol":"parshios","correct":"from pyluach import parshios"},{"symbol":"HebrewDate","correct":"from pyluach.dates import HebrewDate"},{"symbol":"GregorianDate","correct":"from pyluach.dates import GregorianDate"}],"quickstart":{"code":"from pyluach import dates, hebrewcal, parshios\n\n# Get today's Hebrew date\ntoday = dates.HebrewDate.today()\nprint(f\"Today's Hebrew date: {today.hebrew_date_string(hebrew=True)}\")\nprint(f\"Today's Gregorian equivalent: {today.to_greg()}\")\n\n# Convert between Gregorian and Hebrew dates\ngreg_date = dates.GregorianDate(1986, 3, 21)\nheb_date = greg_date.to_heb()\nprint(f\"Gregorian {greg_date} is Hebrew {heb_date}\")\n\n# Check for holidays and parsha\nrosh_hashana = dates.HebrewDate(5782, 7, 1)\nprint(f\"Holiday on Rosh Hashana 5782: {rosh_hashana.holiday()}\")\n\n# Get weekly Torah portion\nparsha_date = dates.GregorianDate(2021, 3, 10)\nprint(f\"Parsha for {parsha_date}: {parshios.getparsha_string(parsha_date)}\")","lang":"python","description":"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`."},"warnings":[{"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`.","message":"The `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.","severity":"gotcha","affected_versions":"2.x"},{"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.","message":"Pyluach'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.","severity":"gotcha","affected_versions":"2.x"},{"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).","message":"Hebrew 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.","severity":"gotcha","affected_versions":"2.x"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}