Skip to main content

Accurate Hijri-Gregorian date converter based on the Umm al-Qura calendar

Project description

Hijri Converter

A Python package to convert accurately between Hijri and Gregorian dates based on astronomical calculation of the Umm al-Qura calendar.

Checks Status Coverage Status Code Quality Docs Status PyPI Downloads PyPI Version Package License

Features

  • Accurate and tested 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 notations.
  • Easily extendable to support other natural languages.
  • Rich comparison between dates.
  • Validation of input dates.
  • Works on Python 3.6+ with zero dependencies.
  • Thoroughly tested on all supported python versions.

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

pip install -U hijri-converter

Basic Usage

from hijri_converter import convert


# Convert a Hijri date to Gregorian
g = convert.Hijri(1403, 2, 17).to_gregorian()

# Convert a Gregorian date to Hijri
h = convert.Gregorian(1982, 12, 2).to_hijri()

Documentation

Please see https://hijri-converter.readthedocs.io for full documentation of this package, including background, benchmarking, usage examples and API reference.

Changelog

All notable changes to this package are documented in CHANGELOG.md.

Contributing

Contributions are always welcome! See CONTRIBUTING.md for ways to get started.

Acknowledgements

  • R.H. van Gent — inspiration, scientific guidance and resources.
  • @AZalshehri7 — support in dates review and conversion validation.

License

This package is distributed under an MIT license. See LICENSE.

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

hijri-converter-2.1.3.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

hijri_converter-2.1.3-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file hijri-converter-2.1.3.tar.gz.

File metadata

  • Download URL: hijri-converter-2.1.3.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for hijri-converter-2.1.3.tar.gz
Algorithm Hash digest
SHA256 7a22438be995f76d7ac78dcd8c5195261615069de2ddbb266aec4ce9c03e06b3
MD5 e46eac6bb531316144acd807f06255d4
BLAKE2b-256 c6cd1f22e25d44778a3214f59ceffdd798729e8d31df90302f0edd626842a3d1

See more details on using hashes here.

File details

Details for the file hijri_converter-2.1.3-py3-none-any.whl.

File metadata

  • Download URL: hijri_converter-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for hijri_converter-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61ee0260a1a3f97890cdfda432c96c1548e521e05fa0050e156c73781c3eb157
MD5 c16a739f411a8b3b138efdf027e448e4
BLAKE2b-256 db03136d14878505cd7d0f22761cf3e37543b9e76c396ffbee19fb7542d9d155

See more details on using hashes here.

Supported by

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