summaryrefslogtreecommitdiff
path: root/hebrew
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2022-12-25 14:00:19 -0800
committerYuri Victorovich <yuri@FreeBSD.org>2022-12-25 18:34:58 -0800
commit8585a47067e7f55d68409c693f48e87a3fc7667c (patch)
treef0f2b58c8d16957335335a51c4ac38eba0fc934c /hebrew
parentfinance/py-finviz: New port: Unofficial API for FinViz.com (diff)
hebrew/py-pyluach: New port: Python package for manipulating Hebrew dates
Diffstat (limited to 'hebrew')
-rw-r--r--hebrew/Makefile1
-rw-r--r--hebrew/py-pyluach/Makefile23
-rw-r--r--hebrew/py-pyluach/distinfo3
-rw-r--r--hebrew/py-pyluach/files/test.py16
-rw-r--r--hebrew/py-pyluach/pkg-descr12
5 files changed, 55 insertions, 0 deletions
diff --git a/hebrew/Makefile b/hebrew/Makefile
index d4d9b631a1d6..d334197b7f44 100644
--- a/hebrew/Makefile
+++ b/hebrew/Makefile
@@ -7,5 +7,6 @@
SUBDIR += hspell
SUBDIR += hunspell
SUBDIR += libreoffice
+ SUBDIR += py-pyluach
.include <bsd.port.subdir.mk>
diff --git a/hebrew/py-pyluach/Makefile b/hebrew/py-pyluach/Makefile
new file mode 100644
index 000000000000..7eafe9784c61
--- /dev/null
+++ b/hebrew/py-pyluach/Makefile
@@ -0,0 +1,23 @@
+PORTNAME= pyluach
+DISTVERSION= 2.0.2
+CATEGORIES= hebrew python
+MASTER_SITES= CHEESESHOP
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Python package for manipulating Hebrew dates
+WWW= https://github.com/simlist/pyluach
+
+LICENSE= MIT
+
+USES= python:3.7+
+USE_PYTHON= distutils autoplist
+
+NO_ARCH= yes
+
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+do-test:
+ @${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${FILESDIR}/test.py
+
+.include <bsd.port.mk>
diff --git a/hebrew/py-pyluach/distinfo b/hebrew/py-pyluach/distinfo
new file mode 100644
index 000000000000..a95f7296eeea
--- /dev/null
+++ b/hebrew/py-pyluach/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1672004952
+SHA256 (pyluach-2.0.2.tar.gz) = 97894311f1b0d59f5fcab1d12147f8049bce315915d8dcd806bfbf41c94b50cf
+SIZE (pyluach-2.0.2.tar.gz) = 21562
diff --git a/hebrew/py-pyluach/files/test.py b/hebrew/py-pyluach/files/test.py
new file mode 100644
index 000000000000..d234c73a2cee
--- /dev/null
+++ b/hebrew/py-pyluach/files/test.py
@@ -0,0 +1,16 @@
+from pyluach import dates, hebrewcal, parshios
+
+today = dates.HebrewDate.today()
+lastweek_gregorian = (today - 7).to_greg()
+print(f"lastweek_gregorian<today: ={lastweek_gregorian < today}")
+print(f"today-lastweek_gregorian={today - lastweek_gregorian}")
+greg = dates.GregorianDate(1986, 3, 21)
+heb = dates.HebrewDate(5746, 13, 10)
+print(f"greg==heb: {greg == heb}")
+purim = dates.HebrewDate(5781, 12, 14)
+print(f"purim.hebrew_day()={purim.hebrew_day()}")
+print(f"purim.hebrew_date_string()={purim.hebrew_date_string()}")
+print(f"purim.hebrew_date_string(True)={purim.hebrew_date_string(True)}")
+rosh_hashana = dates.HebrewDate(5782, 7, 1)
+print(f"rosh_hashana.holiday={rosh_hashana.holiday()}")
+print(f"rosh_hashana.holiday={rosh_hashana.holiday(hebrew=True)}")
diff --git a/hebrew/py-pyluach/pkg-descr b/hebrew/py-pyluach/pkg-descr
new file mode 100644
index 000000000000..e25b0b27f6f6
--- /dev/null
+++ b/hebrew/py-pyluach/pkg-descr
@@ -0,0 +1,12 @@
+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
+* Getting the holiday occuring on a given date
+* Generating html and text Hebrew calendars