Skip to main content

mihrab-methods in Python

The methods of mihrab-methods — Sweden, Diyanet, Morocco, Algeria, Indonesia, Türkiye Takvimi, Kazakhstan, Egypt, Brunei, Qatar, Kuwait, Jordan, Tatarstan, Russia's Central Muftiate, Albania, Bulgaria, Pakistan's Jamia Banuri Town, the United Arab Emirates, Iran's Institute of Geophysics and the United Kingdom's Wifaqul Ulama — in plain Python, with no dependencies beyond the standard library (Python 3.9 or later, for zoneinfo).

The TypeScript library is the reference. This port follows it line for line, is held to test/vectors.json, and names the method revisions it reproduces in mihrab_methods.REVISIONS. A correction list belongs to one revision: when a method's revision is raised in the library, this port is behind until it is raised here too.

pip install mihrab-methods

The package carries the correction lists of its release; a version has the same number as the npm package it was built with.

from mihrab_methods import load_corrections, times_for

lists = load_corrections()          # the package's own; or a directory laid out as data/corrections
stockholm = {'authority': 'sweden', 'lat': 59.33, 'lon': 18.034, 'tz': 'Europe/Stockholm'}
day = times_for(stockholm, '2026-11-12', lists['sweden'])
print(day['printed'])     # the six times as 'HH:MM' on the clock the table prints
print(day['instants'])    # the same six times as timezone-aware datetimes

A place is a dict shaped like the library's Place: authority, lat, lon, tz, and the fields a list gives some of its places (ishaDeg, clock, prayerPoints, dipDeg, dipMaghribDeg, highland, twilightDip, afternoon, temkin, dipDegEarlier, dipDegUntil). The places themselves are in data/places/; use the coordinates exactly as the list has them, since the correction lists are looked up by them.

Without a correction list times_for gives the bare method: within a minute of the full answer on the days a list has an entry for, the same on every other day.

Check

From the repository root:

python3 ports/python/test_vectors.py

The zone offsets come from the machine's time-zone database, as they do in the library; two machines with different editions of it can differ on a zone whose rules changed between them.

What is where

File What
mihrab_methods/sun.py The three positions of the sun the methods use
mihrab_methods/methods.py The methods: the Congress method (Sweden, Diyanet), Morocco, Algeria, Indonesia, Türkiye Takvimi, Kazakhstan, Egypt, Brunei, Qatar, Kuwait, Jordan, Tatarstan, Russia's Central Muftiate, Albania, Bulgaria, Pakistan's Jamia Banuri Town, the United Arab Emirates, Iran's Institute of Geophysics, the United Kingdom's Wifaqul Ulama, Tunisia's Institut National de la Météorologie
mihrab_methods/api.py Place and date in, the day out: clock, correction list, printing
test_vectors.py Holds the port to test/vectors.json

Metadata

Release files for mihrab-methods 1.24.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mihrab-methods 1.24.3
File Size Uploaded Provenance Actions
mihrab_methods-1.24.3.tar.gz 154.9 kB With provenance Details for mihrab_methods-1.24.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mihrab-methods 1.24.3
File Interpreter ABI Platform Actions
mihrab_methods-1.24.3-py3-none-any.whl Python 3 none any Details for mihrab_methods-1.24.3-py3-none-any.whl

Total release size: 317.0 kB

Release files / mihrab_methods-1.24.3.tar.gz

Download URL mihrab_methods-1.24.3.tar.gz
Size 154.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e12ab05a08d16774c802467a86bf13e22c637fef06b211fa6c337e0d3f13c1ca
BLAKE2b-256 checksum
How to use checksums
ef4de70d3ca8cb60aec9e914c7e1ea41db9ff44fcd93df9c801d9283630d1f8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / mihrab_methods-1.24.3-py3-none-any.whl

Download URL mihrab_methods-1.24.3-py3-none-any.whl
Size 162.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56d5bff0f452ad834a2c57e52f5aaf1184b9b26c2c34b9fccf4c1584a3b9b85c
BLAKE2b-256 checksum
How to use checksums
2be22e118bdb30d5ce7a4bd48fb7719cd2e321064d1b5f1bc65a9384c6526ff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for mihrab-methods 1.24.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mihrab_methods-1.24.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.24.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page