Skip to content

Python Umalqurra Calender is an API that will give you the ability to convert Gregorian to Hijri and Hijri to Gregorian.

License

Notifications You must be signed in to change notification settings

QuantumPrayerTimes/hijricalendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hijri Calendar Converter

Build

https://coveralls.io/repos/github/QuantumPrayerTimes/hijricalendar/badge.svg?branch=master Code Health Code Climate Test Coverage Code issues

Python Umalqurra Calender is an API that will give you the ability to convert Gregorian to Hijri and hijri to Gregorian. It will give you the day name in arabic and english, and the month name in Hijri arabic and Gregorian.

The Hijri algorithm code has been translatde from javascript to python.

The javascript was developed by Suhail Alkowaileet: https://github.com/xsoh/Hijri.js/blob/master/Hijri.js

also this code for more understanding: https://github.com/kbwood/calendars/blob/master/src/js/jquery.calendars.ummalqura.js

The project is based on : https://github.com/tytkal/python-hijiri-ummalqura

Compatibility: Compatible with Python 2.x and 3.x

This is an improved version PEP8 compliant, bugs fixed and ready to use.

Prerequisites

You will need the following software properly installed on your computer.

Installation

Clone the repo and run :

git clone https://github.com/QuantumPrayerTimes/hijricalendar.git
cd hijricalendar
python setup.py install

Usage

Example of usage :

import datetime
from hijricalendar.hijri_date_wrap import HijriDateWrapper

today = datetime.date.today()

# Create a gregorian date
hdw = HijriDateWrapper(date=today, gregorian=True)
print(hdw)

# Get the associated Hijri date
hdw.get_hijri_date()
hdw.get_gregorian_date()

# Set the date to another one
hdw.set_date_from_gr(2016, 10, 15)
hdw.get_hijri_date()
hdw.get_gregorian_date()

# Set a Hijri date
hdw.set_date_from_hr(1437, 10, 15)
hdw.get_hijri_date()
hdw.get_gregorian_date()

Resources

Issues

If you have any issues or improvements, do not hesitate to create an issue or submit a pull request.

About

Python Umalqurra Calender is an API that will give you the ability to convert Gregorian to Hijri and Hijri to Gregorian.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages