Skip to main content

A Python library for working with the Persian (Jalali) calendar

Project description

shamsinox A Python library for working with the Persian (Jalali) calendar, similar to Python's datetime module. Features

Create and validate Persian dates Convert between Persian and Gregorian calendars Support for Persian leap year calculations Basic date arithmetic (add/subtract days, difference between dates) Get today's date in the Persian calendar

Installation pip install shamsinox

Usage from shamsinox import PersianDate from datetime import timedelta

Create a Persian date

pd = PersianDate(1404, 5, 12) print(pd) # 1404/05/12 (Mordad)

Convert to Gregorian

gd = pd.to_gregorian() print(gd) # 2025-08-03

Get today's Persian date

today = PersianDate.today() print(today) # e.g., 1404/05/11 (Mordad)

Add 10 days

future_date = today + timedelta(days=10) print(future_date) # e.g., 1404/05/21 (Mordad)

Calculate difference between dates

diff = future_date - today print(f"Difference in days: {diff}") # Difference in days: 10

Development To contribute or run tests:

Clone the repository: git clone https://github.com/ArshamH011/shamsinox.git Install dependencies: pip install -r requirements.txt (if any) Run tests: python -m unittest discover tests

License MIT License Contact For issues or suggestions, please open an issue on the GitHub repository.

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

shamsinox-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

shamsinox-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file shamsinox-0.1.0.tar.gz.

File metadata

  • Download URL: shamsinox-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for shamsinox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4c368dbfcb4a95e55fe5e71092a7394b48645764868b1c7d99525eca001ece5
MD5 164d95c810085de7134823a7808d542d
BLAKE2b-256 72feeed9f41e8c4f189f1bdd16f61994a37493d2abb4c6e92f9e8f0f9b97ee2f

See more details on using hashes here.

File details

Details for the file shamsinox-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shamsinox-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for shamsinox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 523034d083b56945b025f768cb2593d7b0373ae5f771febc7f460e91430067b6
MD5 11ec399b136a1b14fb0c625a311dfc6c
BLAKE2b-256 264ba3572e6dea36c9423bd2ccd935b3039fd5bb1b1992cf913cca50fad5f98c

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