Skip to main content

A Python library for Julian Day and Solar Date conversions.

Project description

🌞 Shamsi Calendar

Python Version License

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.

👨‍💻 Author

Muhammad Sajid

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_shamsi-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_shamsi-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file python_shamsi-1.0.0.tar.gz.

File metadata

  • Download URL: python_shamsi-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for python_shamsi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 747aa584ecd2d3dbeace578f26aa765fc8a0acc2c18fb68e77729addc52a5257
MD5 a3fc2822c7061a5ebd93edf3ffea5a68
BLAKE2b-256 5d9eeb5f086715cb75cd1b6ecb6b6634930113d839252f5170115161c67faf91

See more details on using hashes here.

File details

Details for the file python_shamsi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: python_shamsi-1.0.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

Hashes for python_shamsi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 945d36c7f2393a4dc287f1f40fe86021b3cee49ff7a11ad03835c7641bf77d24
MD5 64467080252917b2fb484e0b5e50d27a
BLAKE2b-256 0cc3e59b575986c71973d5aaf4bed116df25fcf560167a988245353298c10e6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page