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.1.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.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shamsinox-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a817856ccde99e9e6bf155c3a3e52139e3a1af9546cef8ff9e8a64dcaf9b524f
MD5 8250b7e3f999f375228c34b2e58c62ed
BLAKE2b-256 4a1ddeb340ee98f8d4b6fcb021a7c8099853e1a275fa4635259d59d9d9a9a601

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shamsinox-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48600757d6f262b028cff64c91c43ec377cb07c70913cbd756cc6591f54f95c7
MD5 c77103744b6afb8692379ec6cf7f9281
BLAKE2b-256 5baae1de0e960fea3a8aeb6f83299d9c5c63378f0a87018a6e95b6953f06cb9d

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