### Install adhanpy Source: https://github.com/alphahm/adhanpy/blob/master/README.md Install the adhanpy library using pip. ```bash pip install adhanpy ``` -------------------------------- ### Install adhanpy for Development Source: https://github.com/alphahm/adhanpy/blob/master/README.md Set up a virtual environment and install adhanpy with development dependencies. ```bash python3 -m virtualenv venv source venv/bin/activate pip install --upgrade pip pip install -r requirements.txt pip install -e . ``` -------------------------------- ### Create PrayerTimes with CalculationMethod Source: https://github.com/alphahm/adhanpy/blob/master/README.md Instantiate a PrayerTimes object using coordinates, date, and a predefined CalculationMethod. ```python prayer_times = PrayerTimes(coordinates, today, CalculationMethod.MOON_SIGHTING_COMMITTEE) ``` -------------------------------- ### Create PrayerTimes with CalculationParameters Source: https://github.com/alphahm/adhanpy/blob/master/README.md Instantiate a PrayerTimes object with custom calculation parameters like angles. ```python parameters = CalculationParameters(fajr_angle=18, isha_angle=18) prayer_times = PrayerTimes(coordinates, today, calculation_parameters=parameters) ``` -------------------------------- ### Set PrayerTimes TimeZone with ZoneInfo Source: https://github.com/alphahm/adhanpy/blob/master/README.md Instantiate PrayerTimes with a specific time zone using ZoneInfo for localized output. ```python london_zone = ZoneInfo("Europe/London") prayer_times = PrayerTimes( coordinates, today, CalculationMethod.MOON_SIGHTING_COMMITTEE, time_zone=london_zone, ) # this will display the time in the chosen time zone print(f"Fajr: {prayer_times.fajr.strftime('%H:%M')}") ``` -------------------------------- ### Convert PrayerTimes to Different TimeZone Source: https://github.com/alphahm/adhanpy/blob/master/README.md Convert UTC prayer times to a different time zone using the astimezone method. ```python prayer_times = PrayerTimes( coordinates, today, CalculationMethod.MOON_SIGHTING_COMMITTEE, ) # the following will be in UTC print(f"Fajr: {prayer_times.fajr.strftime('%H:%M')}") # and to use a different timezone on the datetime object itself: london_zone = ZoneInfo("Europe/London") print(f"Fajr: {prayer_times.fajr.astimezone(london_zone).strftime('%H:%M')}") ``` -------------------------------- ### CalculationMethod Precedence Source: https://github.com/alphahm/adhanpy/blob/master/README.md Demonstrates that CalculationMethod overrides specific parameters like fajr_angle when creating PrayerTimes. ```python parameters = CalculationParameters(fajr_angle=12, method=CalculationMethod.MOON_SIGHTING_COMMITTEE) prayer_times = PrayerTimes(coordinates, today, calculation_parameters=parameters) print(parameters.fajr_angle) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.