This library is about the display of the Jalali calendar and the moon in Scorpio.
Project description
Jalali Calendar with "Moon in Scorpio" Highlighting
This project provides functions to display the Jalali (Solar Hijri) calendar and highlight days when (according to a simplified empirical formula) the Moon is assumed to be in the constellation Scorpio. Highlighted days are shown in red.
Features
- Display the current month or any specific Jalali month.
- Identify days when the Moon is in Scorpio (approximate formula).
- Print the calendar with Scorpio days in red.
- Search for Scorpio days within a range of Gregorian years.
Requirements (Installation)
Before running, install the required libraries:
pip install jdatetime numpy hijri-converter gregorian
Note: gregorian might be available via pip install gregorian. hijri-converter is used for Gregorian to Hijri conversion.
Usage
Save the code in a Python file (e.g., persian_calendar.py) and call its functions.
- Show current month calendar
import jcalender
jcalender.Jalali_Calender()
- Show a specific Jalali month
jcalender.Jalali_Calender(your_year=1403, your_month=6) # Shahrivar 1403
- Show calendar with Scorpio days highlighted
jcalender.Moon_in_Scorpio_Calender() # current month
jcalender.Moon_in_Scorpio_Calender(your_year=1403, your_month=6) # specific month
- Search for Scorpio days across two consecutive Gregorian years
jcalender.Moon_in_Scorpio_Calender(Gregorian_year_1=2026, Gregorian_year_2=2027)
Note: your_year/your_month and Gregorian_year_1/Gregorian_year_2 are not used together.
Main Functions
Function Description Jalali_Calender(your_year, your_month) Prints the Jalali calendar week by week (Sat to Fri). Moon_in_Scorpio() Returns whether the Moon is in Scorpio for the current day. Moon_in_Scorpio_Choose_day(day, month, year) Checks a specific Gregorian date. Moon_in_Scorpio_Calender(...) Prints the Jalali calendar with Scorpio days highlighted in red. Mooon_is(months, years, mons) Returns a list of Scorpio days in a given Gregorian month (internal).
The "Moon in Scorpio" Formula
The formula used is empirical and not astronomically accurate – it's just a demonstration. For real calculations, use libraries like ephem or astropy.
Current formula:
total = (Hijri_day × 12.2) + (Jalali_day + 1)
result = (total / 30) + Jalali_month
If result is between 7.60 and 8.98 → Moon in Scorpio
Limitations & Known Issues
· The Scorpio formula is very crude; do not use for serious astronomical purposes. · Moon_in_Scorpio_Calender for two Gregorian years only checks months 1–4 of the second year (possible bug). · Colored output uses ANSI codes; may not work in all terminals/IDEs.
Sample Output
Shahrivar 1403
Sa Su Mo Tu We Th Fr
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
(Red numbers indicate Scorpio days)
License
This project is for educational purposes. Use the Scorpio formula with caution.
Contributions
Improvements (bug fixes, real astronomical calculations) are welcome.
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 Distributions
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 jcalender-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jcalender-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94952101cd6e8ff4d43aea5a417195ef780d5cd0da203b668f34bc0bfb3e2296
|
|
| MD5 |
54a1e2697704fce606bb9725729fb207
|
|
| BLAKE2b-256 |
2874d5888f6d2a36134d2e285e3af556d30539bdfc02b4b11c9a3ad936b00e58
|