summaryrefslogtreecommitdiff
path: root/hebrew/py-pyluach/files
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/py-pyluach/files
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/py-pyluach/files')
-rw-r--r--hebrew/py-pyluach/files/test.py16
1 files changed, 16 insertions, 0 deletions
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)}")