Skip to content

Migration

This content is for v1.0.0. Switch to the latest version for up-to-date documentation.

This guide covers migrating from the original adhanpy package to al-falak.

Terminal window
# Old
pip install adhanpy
# New
pip install al-falak
# Old
from adhanpy import PrayerTimes, CalculationMethod
# New
from alfalak import PrayerTimes, CalculationMethod

The internal module structure has changed:

# Old
from adhanpy.calculation import CalculationMethod
from adhanpy.data import Coordinates
# New
from alfalak.calculation import CalculationMethod
from alfalak.data import Coordinates

The error hierarchy has been introduced in v1.0.0:

# Old (adhanpy 1.x)
try:
PrayerTimes(...)
except RuntimeError:
...
# New (al-falak 1.x)
from alfalak import AlFalakError, AstronomicalError
try:
PrayerTimes(...)
except AstronomicalError:
...
Change Old behavior New behavior
Error types RuntimeError, ValueError, TypeError AlFalakError subclasses
Package name adhanpy al-falak
Import name import adhanpy import alfalak
Python support 3.9+ 3.11+
  • Calculation math (same formulas, same results)
  • Public API surface (same class and method names)
  • CLI interface (same arguments, same output format)