Skip to main content

Pyluach is a Python package for manipulating Hebrew dates, Gregorian-Hebrew calendar conversions, getting the weekly parsha, and other Jewish calendar related calculations.

Project description

Documentation Status https://travis-ci.org/simlist/pyluach.svg?branch=master https://coveralls.io/repos/github/simlist/pyluach/badge.svg?branch=master

Pyluach is a Python package for manipulating Hebrew (Jewish) calendar dates and Hebrew-Gregorian conversions.

Features

  • Conversion between Hebrew and Gregorian dates

  • Finding the difference between two dates

  • Finding a date at a given duration from the given date

  • Rich comparisons between dates

  • Finding the weekday of a given date

  • Finding the weekly Parsha reading of a given date

Installation

Use pip install pyluach.

Documentation

Documentation for pyluach can be found at https://readthedocs.org/projects/pyluach/.

Examples

>>> from pyluach import dates, hebrewcal, parshios

>>> today = dates.HebrewDate.today()
>>> lastweek_gregorian = (today - 7).to_greg()
>>> lastweek_gregorian < today
    True
>>> today - lastweek_gregorian
7
>>> greg = GregorianDate(1986, 3, 21)
>>> heb = HebrewDate(5746, 13, 10)
>>> greg == heb
True

>>> purim = HebrewDate(5781, 12, 14)
>>> purim.hebrew_day()
'י״ד'
>>> purim.hebrew_date_string()
'י״ד אדר תשפ״א'
>>> purim.hebrew_date_string(True)
'י״ד אדר ה׳תשפ״א'

>>> rosh_hashana = dates.HebrewDate(5782, 7, 1)
>>> rosh_hashana.holiday()
'Rosh Hashana'
>>> rosh_hashana.holiday(hebrew=True)
'ראש השנה'
>>> (rosh_hashana + 3).holiday()
None

>>> month = hebrewcal.Month(5781, 10)
>>> month.month_name()
'Teves'
>>> month.month_name(True)
'טבת'
>>> month + 3
Month(5781, 1)
>>> for month in hebrewcal.Year(5774).itermonths():
...     print(month.name)
Tishrei Cheshvan ...

>>> date = dates.GregorianDate(2010, 10, 6)
>>> parshios.getparsha(date)
[0]
>>> parshios.getparsha_string(date, israel=True)
'Beraishis'
>>> parshios.getparsha_string(date, hebrew=True)
'בראשית'
>>> new_date = dates.GregorianDate(2021, 3, 10)
>>> parshios.getparsha_string(new_date)
'Vayakhel, Pekudei'
>>> parshios.getparsha_string(new_date, hebrew=True)
'ויקהל, פקודי'

Contact

For questions and comments feel free to contact me at simlist@gmail.com.

License

Pyluach is licensed under the MIT license.

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

pyluach-1.3.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

pyluach-1.3.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file pyluach-1.3.0.tar.gz.

File metadata

  • Download URL: pyluach-1.3.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.5

File hashes

Hashes for pyluach-1.3.0.tar.gz
Algorithm Hash digest
SHA256 9cf95eaa600cc904d1adb015036ab135e0d732ca2a30253db92b676ee3415dea
MD5 8c30d01df32c5b245365fd74244cd94d
BLAKE2b-256 573ff75c277c2367a0b541b213a7fbf13d4b3d6a8e8ee5836b9432e62a496ae5

See more details on using hashes here.

File details

Details for the file pyluach-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyluach-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.5

File hashes

Hashes for pyluach-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43977d47c86695d66789f3d24c411c4d110363f760331136009e43ac9af61b1e
MD5 f0dc16cdd968e14121f152493494ff6d
BLAKE2b-256 c653467c6342f6a3c801409268a9bfe067ddfcdfaa79211c228af9bca9ffa32a

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