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.1.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.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mawaqit_astro-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8c5760b0a1155c3c420a4edc2cebc6c640b76cb351f0be4260ea69fe0381188b
MD5 d8b18f69d6da3b2af129340b61d69ba8
BLAKE2b-256 93a5148484462cad4aa42155cb2c482b029e91fbb88d6688ed45b21089cf1d4d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mawaqit_astro-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4620bbaa65b2c2637a49bc78b77a40ed07209a2142311c3815804c9c99b41b9c
MD5 e73440daf4c23eefddc7cb7e83c255fb
BLAKE2b-256 ccc560e496e8cf5fe0d3e898d2220211d6a9a928698640968c4e6463cba08ff4

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