Skip to main content

Pyluach is a Python package for manipulating Hebrew dates,

Project description

Documentation Status https://github.com/simlist/pyluach/actions/workflows/testing-and-coverage.yml/badge.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 = dates.GregorianDate(1986, 3, 21)
>>> heb = dates.HebrewDate(5746, 13, 10)
>>> greg == heb
True

>>> purim = dates.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.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 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.4.1.tar.gz (16.4 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.4.1-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyluach-1.4.1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/26.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.46.0 importlib-metadata/4.5.0 keyring/21.2.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for pyluach-1.4.1.tar.gz
Algorithm Hash digest
SHA256 19d3c911971a351fd6c59b3ada47ae315de8e854a1f45a4c6f15610e06356b05
MD5 e802845b09840ba64c8597db935d28e4
BLAKE2b-256 0056abc3a44b2928dcbdfd788586a7560aaa04a587a5dcce0c51988ca9744de4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyluach-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/26.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.46.0 importlib-metadata/4.5.0 keyring/21.2.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for pyluach-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1087e985030ac7740029bfc8cb25acc8e1de70b85d55250237ab36279f7e0806
MD5 a1c491e6e9c38e58f375794032bfe9ed
BLAKE2b-256 bc9369c6d9b9c4e7e72e44c1641773ffe1a83b60af760e169729a40ec43a139e

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