A Python library for Julian Day and Solar Date conversions.
Project description
🌞 Shamsi Calendar
Shamsi Calendar is a powerful and easy-to-use Python library designed for seamless conversion between Gregorian dates, Julian Day Numbers, and a custom Solar Calendar.
Whether you are building an astronomical application, a historical date converter, or a specialized scheduling tool, Shamsi Calendar provides the precision and flexibility you need.
✨ Features
- 📅 Gregorian to Solar Conversion: Instantly convert standard dates to the custom Solar Calendar.
- 🔢 Julian Day Support: Robust handling of Julian Day Numbers for astronomical calculations.
- 🗓️ Day & Month Names: Built-in support for retrieving localized Solar day and month names.
- 🚀 Lightweight & Fast: Optimized for performance with minimal dependencies.
📦 Installation
Install the package easily via pip:
pip install python-shamsi
🛠️ Usage
Here is a quick example to get you started:
from shamsi import JulianDay, SOLAR_DAYS_NAME, SOLAR_MONTHS_NAME
# 1. Convert Gregorian to Solar Date
# Input: Year, Month, Day
solar_date = JulianDay.to_solar(2025, 12, 1)
print(f"🌞 Solar Date: {solar_date}") # Output: [day, month_index, year]
# 2. Get the Solar Month Name
month_name = SOLAR_MONTHS_NAME[solar_date[1]]
print(f"📅 Month: {month_name}")
# 3. Get the Day of the Week
# Calculate the index and fetch the name
day_index = JulianDay.get_day_of_week_index(solar_date[0], solar_date[1], solar_date[2])
day_name = SOLAR_DAYS_NAME[day_index]
print(f"🗓️ Day: {day_name}")
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
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 python_shamsi-0.1.0.tar.gz.
File metadata
- Download URL: python_shamsi-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1b3de8baf9c7a6cd1765e24600fe9058c8c76c594614fd0561418b83e7b8b19
|
|
| MD5 |
0101d37bc85b22adf3e10c298a7832ad
|
|
| BLAKE2b-256 |
b312cde79e5f54d89421209f06399d15822f92f49eba12b4efbb76063a8cee5c
|
File details
Details for the file python_shamsi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_shamsi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63843dc7d4580ca01e4d75446b66000f0b7706c57dbc9b330bdaedd05798ba7f
|
|
| MD5 |
e2f7e9175cbf992ae9a0477a961fe296
|
|
| BLAKE2b-256 |
86dd0b2ef83b09520b3c2c14fcbfb2914b47c71f9fda7422faa51521d21045fe
|