Migration
This content is for v1.0.0. Switch to the latest version for up-to-date documentation.
Migration
Section titled “Migration”This guide covers migrating from the original adhanpy package to al-falak.
Package rename
Section titled “Package rename”# Oldpip install adhanpy
# Newpip install al-falakImport changes
Section titled “Import changes”# Oldfrom adhanpy import PrayerTimes, CalculationMethod
# Newfrom alfalak import PrayerTimes, CalculationMethodModule structure
Section titled “Module structure”The internal module structure has changed:
# Oldfrom adhanpy.calculation import CalculationMethodfrom adhanpy.data import Coordinates
# Newfrom alfalak.calculation import CalculationMethodfrom alfalak.data import CoordinatesError handling
Section titled “Error handling”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: ...Breaking changes in v1.0.0
Section titled “Breaking changes in v1.0.0”| 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+ |
Unchanged
Section titled “Unchanged”- Calculation math (same formulas, same results)
- Public API surface (same class and method names)
- CLI interface (same arguments, same output format)
See also
Section titled “See also”- Changelog — full version history
- API Reference — current API