Skip to main content

یک کتابخانه جامع برای دسترسی به احادیث، قرآن، ذکر و اطلاعات جغرافیایی مساجد

Project description

HedayatMedia 📖✨

Python License PyPI Downloads

کتابخانه HedayatMedia ابزاری جامع برای کار با داده‌های اسلامی است:

  • 📜 احادیث
  • 📖 قرآن (آیات، سوره‌ها، اجزاء)
  • 🕋 اذکار روزانه
  • 🌍 مکان‌یابی مساجد
  • اوقات شرعی شهروکشور -چت باهوش مصنوعی مذهبی میربات

نمونه ها

from hedayat_media import HedayatMedia

# نمونه‌سازی
media = HedayatMedia()

# دریافت یک حدیث تصادفی
print(media.get_random_hadith())

# دریافت یک آیه تصادفی
print(media.get_random_ayah())

# دریافت ذکر روز
print(media.get_zeker())


hadith = media.get_random_hadith()
print(hadith["text_arabic"])

# آیه تصادفی از جزء 5
ayah = media.fetch_random_ayah(juz_number=5)
print(ayah)

# کل سوره بقره
surah = media.get_surah(2)
print(surah["name_ar"], surah["number_of_ayahs"])


print(media.get_zeker())

lat, lon = media.get_coordinates("Mashhad")
bbox = media.get_bounding_box(lat, lon, radius_km=5)
data = media.get_overpass_data(bbox)
mosques = media.process_data(data)

for m in mosques:
    print(m["name"], m["map_link"])


print(media.get_prayer_times("Mashhad","IR"))

📖 API Reference

HedayatMedia.load_hadiths()

بارگذاری احادیث از فایل JSON.

HedayatMedia.get_random_hadith()

یک حدیث تصادفی برمی‌گرداند.

HedayatMedia.fetch_random_ayah(juz_number: int)

آیه تصادفی از یک جزء مشخص.

HedayatMedia.get_random_ayah()

آیه تصادفی از کل قرآن.

HedayatMedia.get_all_surahs()

لیست همه سوره‌ها.

HedayatMedia.get_surah(surah_number: int)

جزئیات یک سوره شامل متن و صوت.

HedayatMedia.get_zeker()

ذکر روز هفته.

HedayatMedia.get_coordinates(place_name: str)

مختصات یک مکان (شهر/محله).

HedayatMedia.get_bounding_box(lat, lon, radius_km=10)

ایجاد محدوده جغرافیایی برای جستجو.

HedayatMedia.get_overpass_data(bbox)

دریافت داده مساجد از Overpass API.

HedayatMedia.process_data(data)

پردازش داده API و برگرداندن لیست مساجد.

HedayatMedia.get_prayer_times(city,country) به دست اوردن اوقات شرعی که ورودی های شهروکشوردارد

HedayatMedia.get_response_from_chat(text,api_key) چت با هوش مصنوعی مذهبی


نمونه کد کامل از تمامی متد های کتابخانه

from hedayat_media import HedayatMedia

def main():
    media = HedayatMedia()

    print("📜 حدیث تصادفی:")
    print(media.get_random_hadith())
    print("="*60)

    print("📖 آیه تصادفی از کل قرآن:")
    print(media.get_random_ayah())
    print("="*60)

    print("📖 آیه تصادفی از جزء 5:")
    print(media.fetch_random_ayah(juz_number=5))
    print("="*60)

    print("📖 لیست همه سوره‌ها (فقط چندتا):")
    surahs = media.get_all_surahs()
    if isinstance(surahs, list):
        for s in surahs[:5]:
            print(f"{s['number']}. {s['englishName']} ({s['name']})")
    print("="*60)

    print("📖 دریافت سوره بقره:")
    surah = media.get_surah(2)
    print(f"{surah['name_ar']} - تعداد آیات: {surah['number_of_ayahs']}")
    print("="*60)

    print("🕋 ذکر امروز:")
    print(media.get_zeker())
    print("="*60)

    print("🌍 جغرافیا (مساجد مشهد):")
    coords = media.get_coordinates("Mashhad")
    if coords:
        lat, lon = coords
        bbox = media.get_bounding_box(lat, lon, radius_km=2)
        mosques_data = media.get_overpass_data(bbox)
        mosques = media.process_data(mosques_data)
        for m in mosques[:3]:
            print(f"{m['name']}{m['map_link']}")
    print("="*60)

if __name__ == "__main__":
    main()

🔑 پیش‌نیاز

  1. ثبت‌نام در لیارا و دریافت API Key: https://console.liara.ir/ai

نمونه استفاده از چت باهوش مصنوعی مذهبی

from hedayat_media import  HedayatMedia



m = HedayatMedia()


text = input("enter the mesage :")


api_key = ""

result = m.get_response_from_chat(text,api_key=api_key)

print(result)

📦 نصب

pip install --upgrade hedayat-media

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

hedayat_media-1.5.5.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

hedayat_media-1.5.5-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file hedayat_media-1.5.5.tar.gz.

File metadata

  • Download URL: hedayat_media-1.5.5.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for hedayat_media-1.5.5.tar.gz
Algorithm Hash digest
SHA256 bb2466de54684996c236df76376d08461cd5bd084c6e1b7615391c757ada2b2a
MD5 63811b06be053775470ac294f4dc0c6a
BLAKE2b-256 701f14d3cd43398ce62751525bcf68d2842fcc9b1e0b2414459ff9564ec55234

See more details on using hashes here.

File details

Details for the file hedayat_media-1.5.5-py3-none-any.whl.

File metadata

  • Download URL: hedayat_media-1.5.5-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for hedayat_media-1.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 84b49dc43f89bbe87120602093db84e38affc8db2d55ff9e24c044dfa1fb9b66
MD5 8b5d252236da10fbed02af3bcdbc7bee
BLAKE2b-256 5a4197b146ebe406829fe067ec740c8de7393e773faa1343aefad9bbb6932708

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