Skip to main content

Gregorian to Hijri and Hijri to Gregorian date conversion using the Umm al-Qura calendar

Project description

taqwim.py

Gregorian to Hijri and Hijri to Gregorian date conversion using the Umm al-Qura calendar.

Python port of arabic_date_time Flutter package.

Installation

pip install taqwim

Usage

from taqwim import Date, gregorian_to_hijri, hijri_to_gregorian

# Gregorian to Hijri
hijri = gregorian_to_hijri(Date(day=1, month=1, year=2024))
print(hijri)  # 19-6-1445

# Hijri to Gregorian
gregorian = hijri_to_gregorian(Date(day=1, month=1, year=1445))
print(gregorian)  # 19-7-2023

# Date arithmetic on Hijri dates
next_month = hijri.any_next_arabic_month_date()
prev_month = hijri.any_previous_arabic_month_date()
added = hijri.add_to_arabic_date(days=10)
subtracted = hijri.subtract_from_arabic_date(days=5)

# Convert Hijri to Python datetime
dt = hijri.to_english_datetime()

# Create Date from Python datetime
from datetime import datetime
date = Date.from_datetime(datetime.now())

Valid Date Range

  • Gregorian: August 1, 1924 to November 16, 2077
  • Hijri: 1343/1/1 to 1500/12/30

License

MIT

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

taqwim-0.0.1b1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

taqwim-0.0.1b1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file taqwim-0.0.1b1.tar.gz.

File metadata

  • Download URL: taqwim-0.0.1b1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for taqwim-0.0.1b1.tar.gz
Algorithm Hash digest
SHA256 96f817084a03d64781e5ee2de7a5e0b4402206caea1733ade37c5839fa982c04
MD5 ff91c63196d9b9292f3ca265231fa2dd
BLAKE2b-256 17976ca38bea7360eec2cf3e8c621ff4c15de3432a98543c41cbc78a42650184

See more details on using hashes here.

Provenance

The following attestation bundles were made for taqwim-0.0.1b1.tar.gz:

Publisher: publish.yaml on Greentech-Apps-Limited/taqwim.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taqwim-0.0.1b1-py3-none-any.whl.

File metadata

  • Download URL: taqwim-0.0.1b1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for taqwim-0.0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 701357039edb387fa25d8863d01fb7b13cef163fcdfad7c705b74f09dee699a4
MD5 6e8f7962d79178a530f2707eeadaa431
BLAKE2b-256 eac3372ed5a3c8ac86e09612b8c6201ecaafb07f164dad29d5b2638585414dd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for taqwim-0.0.1b1-py3-none-any.whl:

Publisher: publish.yaml on Greentech-Apps-Limited/taqwim.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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