Skip to main content

A comprehensive Python library for astronomical calculations and prayer times.

Project description

Mawaqit-Astro

PyPI version License: MIT

Mawaqit-Astro is a high-precision Python library for astronomical calculations and Islamic prayer times. It is a port of advanced astronomical logic, providing features for sun and moon positioning, sidereal time, and prayer time calculations based on various global standards.

Features

  • Comprehensive Astronomical Data: Compute Sun, Moon, Polaris positions, Nutation, and more.
  • Accurate Prayer Times: Default support for Islamic Scholar Ala Hazrat method, with full support for custom angles and minute-based offsets.
  • Flexible Madhab Support: Shafi and Hanafi methods for Asr calculations.
  • High Latitude Support: Robust rules for regions with extreme day/night cycles.
  • Pure Python: No external dependencies required.

Installation

pip install mawaqit-astro

Quick Start

1. Calculate Prayer Times

from mawaqit_astro import PrayerCalculator, Location

# 1. Provide only required location data
location = Location(latitude=24.8607, longitude=67.0011, timezone=5.0)

# 2. Calculate using professional defaults
# (Current date, Ala Hazrat method, Hanafi Madhab)
times = PrayerCalculator().calculate(location)

print(f"Fajr: {times.fajr}")
print(f"Isha: {times.isha}")

2. High-Level Almanac Calculations

from mawaqit_astro.core.almanac import compute_almanac, InputData

# Advanced astronomical data for a specific moment
data = InputData(year=2025, month=12, day=24, hour=12, minute=0, second=0)
almanac = compute_almanac(data)

print(f"Sun Right Ascension: {almanac.sun.rightAscension}")
print(f"Moon Phase: {almanac.moon.phase}")

Project Structure

mawaqit-astro/
├── src/
│   └── mawaqit_astro/
│       ├── core/       # High-precision astronomy logic (Sun, Moon, Nutation, etc.)
│       ├── prayers/    # Prayer time calculation modules
│       ├── utils/      # Mathematical and date utilities
│       └── types.py    # Common data structures
├── tests/              # Comprehensive test suite
├── pyproject.toml      # Package configuration
└── README.md           # Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mawaqit_astro-1.0.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mawaqit_astro-1.0.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file mawaqit_astro-1.0.0.tar.gz.

File metadata

  • Download URL: mawaqit_astro-1.0.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mawaqit_astro-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4a9e50878564dd764109010e9aaf9596f69db01e6aecaeee15ef6249e8759482
MD5 ad8f9e91b6d962b4116d09d2adb1d767
BLAKE2b-256 2b1950a74024a5a9a7b44acfc674802e837b1c56dcf7a027ba0f291cc971b037

See more details on using hashes here.

File details

Details for the file mawaqit_astro-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mawaqit_astro-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mawaqit_astro-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc395383676d1825413197d6bc8809b612d196c08a4f207711831af8983d32a6
MD5 47ccaa67084b8a9e283876f7e14b77a0
BLAKE2b-256 d50c94452dfa02bb5ab7191ac7fcef5fe013a4aea13db56e83c7a761234ab587

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page