Accurate Hijri-Gregorian dates converter based on the Umm al-Qura calendar
Project description
HijriDate
formerly
hijri-converter
A Python package to convert accurately between Hijri and Gregorian dates using the Umm al-Qura calendar.
Features
- Accurate and verified date conversion.
- Optimized code performance compared to similar packages.
- Intuitive, clean, and easy-to-use interface.
- Most of the methods and formats are similar to those of standard library.
- Multilingual representation of weekday names, months, and calendar era notations.
- Easily extendable to support other natural languages.
- Rich comparison between dates.
- Validation of input dates.
- Works on Python 3.8+ with zero dependencies.
- Thoroughly tested with 100% test coverage.
Limitations
- The date range supported by converter is limited to the period from the beginning of 1343 AH (1 August 1924 CE) to the end of 1500 AH (16 November 2077 CE).
- The conversion is not intended for religious purposes where sighting of the lunar crescent at the beginning of Hijri month is still preferred.
Installation
To install using pip
, run:
pip install hijridate
To install using conda
, run:
conda install -c conda-forge hijridate
Basic Usage
from hijridate import Hijri, Gregorian
# Convert a Hijri date to Gregorian
g = Hijri(1403, 2, 17).to_gregorian()
# Convert a Gregorian date to Hijri
h = Gregorian(1982, 12, 2).to_hijri()
Documentation
Please see https://hijridate.readthedocs.io for full documentation of this package, including background, benchmarking, usage examples and API reference.
License
This project is licensed under the terms of the MIT license.
Acknowledgements
- R.H. van Gent — inspiration, scientific guidance and resources.
- @AZalshehri7 — support in dates review and conversion accuracy verification.
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
hijridate-2.4.1.tar.gz
(34.8 kB
view details)
Built Distribution
hijridate-2.4.1-py3-none-any.whl
(13.9 kB
view details)
File details
Details for the file hijridate-2.4.1.tar.gz
.
File metadata
- Download URL: hijridate-2.4.1.tar.gz
- Upload date:
- Size: 34.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19b81ba7341cdc11011ff88401b437c0bd1188473921d38fe01b78f8c09735ad |
|
MD5 | b33cfec05bda7ab645123191feaaff02 |
|
BLAKE2b-256 | 3e4f6c16f79e400a2ffa331a779a0c0c5da00378179f2dbbe337657faec5962c |
File details
Details for the file hijridate-2.4.1-py3-none-any.whl
.
File metadata
- Download URL: hijridate-2.4.1-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 599fcfca64a56936b50c5a92104a4465c4f1de713b09e55e42689d6db2634426 |
|
MD5 | 9cafc0350e51a5f8f62b052aee2063b5 |
|
BLAKE2b-256 | 9dfe5ec40f94f709b69284cb5d91dbf7bc9c62e512fd65420178b4faeafa9975 |