alphahm / adhanpy

An offline prayer times library
MIT License
19 stars 6 forks source link

minimum python version is incorrect in readme #2

Closed mohammad-haque closed 2 years ago

mohammad-haque commented 2 years ago

Salaam,

I was just trying out this library and came accross this problem, not sure it is a known issue or not?

Traceback (most recent call last):
  File "/Users/mh/code/personal/workspace-python/oneplace/mosque/data/adhan/prayer_time_helper.py", line 2, in <module>
    from adhanpy.PrayerTimes import PrayerTimes
  File "/Users/mh/code/personal/workspace-python/oneplace/env/lib/python3.9/site-packages/adhanpy/PrayerTimes.py", line 4, in <module>
    from adhanpy.calculation.CalculationMethod import CalculationMethod
  File "/Users/mh/code/personal/workspace-python/oneplace/env/lib/python3.9/site-packages/adhanpy/calculation/__init__.py", line 2, in <module>
    from adhanpy.calculation.CalculationParameters import CalculationParameters
  File "/Users/mh/code/personal/workspace-python/oneplace/env/lib/python3.9/site-packages/adhanpy/calculation/CalculationParameters.py", line 54
    match self.high_latitude_rule:
          ^
SyntaxError: invalid syntax

The code I'm running is very simple:

import datetime
from adhanpy.PrayerTimes import PrayerTimes

class PrayerTimeHelper:

    @staticmethod
    def get_prayer_time(lat, lon):
        coordinates = (lat, lon)
        today = datetime.datetime.now()
        prayer_times = PrayerTimes(coordinates, today)
        print(prayer_times.fajr)

if __name__ == "__main__":
    PrayerTimeHelper().get_prayer_time(51.5636, 0.1795)

Any help would be appreciated, thanks

mohammad-haque commented 2 years ago

Solve:

Documentation said it need python 3.9 or above but it didn't work with that version. Updated to version 3.10 and it is working.

alphahm commented 2 years ago

Good catch. Thanks for reporting, match...case is only available from 3.10.