A Persian calendar package and countdowns
Project description
Persian Calendar
A simple Python package to get the current Jalali (Persian) date.
Installation
pip install py_fa_calendar
usage
import py_fa_calendar def demo(self): print("== خروجی فارسی ==") print("تاریخ امروز (جلالی):", self.format_date(self.today_jalali())) print("تاریخ امروز (قمری تقریبی):", convert_number(self.get_hijri_date(), self.use_persian_numbers)) print("زمان تا نوروز:", convert_number(str(self.next_nowruz()).split('.')[0], self.use_persian_numbers)) print("زمان تا چهارشنبهسوری:", convert_number(self.next_chaharshanbe_suri(), self.use_persian_numbers)) print("زمان تا پایان مدارس:", convert_number(self.next_school_end(), self.use_persian_numbers)) print("زمان تا سیزده بدر:", convert_number(self.next_sizdah_bedar(), self.use_persian_numbers)) print("زمان فعلی:", self.current_time()) print("\n== English Output ==") eng = PersianCalendar(use_persian_numbers=False, nowruz_time=self.nowruz_time) print("Today's Jalali Date:", eng.format_date(eng.today_jalali())) print("Today's Hijri Date (approx.):", eng.get_hijri_date()) print("Time until Nowruz:", str(eng.next_nowruz()).split('.')[0]) print("Time until Chaharshanbe Suri:", eng.next_chaharshanbe_suri()) print("Time until School End:", eng.next_school_end()) print("Time until Sizdah Bedar:", eng.next_sizdah_bedar()) print("Current Time:", eng.current_time())
if name == "main": pc = PersianCalendar(use_persian_numbers=True, nowruz_time=datetime.time(12,30,31)) pc.demo()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_fa_calendar-0.1.0.tar.gz.
File metadata
- Download URL: py_fa_calendar-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bc47405757a5f298045370b56bbaa0d3d606570203202310a4017f78732f846
|
|
| MD5 |
31217e28dc20f2a26f8efda23e5f75cf
|
|
| BLAKE2b-256 |
638e7d1ac0e1086c41b4e7982c9a3b1c302872ebc2b8cb286e191f37bf02ce51
|
File details
Details for the file py_fa_calendar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: py_fa_calendar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d9562cb438b32e8a5bd41f7f36d812632067af2923f7eea414708816b0b7f86
|
|
| MD5 |
5e516b3f66564a873b0d564e89dea085
|
|
| BLAKE2b-256 |
e2b85151009007e93a774b81d04658bd52102257fcf4e6aba1de0df5a452b956
|