Skip to main content

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)

درباره کلاس Maddahi

کلاس Maddahi یک موتور جستجوی تخصصی برای محتوای مذهبی (مداحی، مولودی، نوحه، مناجات) است که امکان کشف و دسترسی به محتوای مذهبی فارسی را فراهم می‌کند.

نمونه استفاده ازکلاس :Maddahi

ورودی ها: page= شماره صفحه results_per_page = چقدر پاسخ بگیره

import asyncio
from hedayat_media import Maddahi


async def main():
    text =  input("enter the text>=")
    
    maddahi = Maddahi(text)
    
    await maddahi.search(page=1,results_per_page=2)
    



asyncio.run(main=main())

کلاس ChatVoice

برای چت باهوش مصنوعی وپاسخ صوتی هوش مصنوعی مذهبی

نمونه

from hedayat_media import ChatVoice


chat = ChatVoice(
    api_key="",
    
    base_url="",
    model=""
)
# تا 6تا مرد داره
file = chat.ask("سلام  یک لعنت به پهلوی بفرست فقط درچند حرف کوتاه خلاصه",voice="man3")


print(file)

📦 نصب

pip install --upgrade hedayat-media

Metadata

Release files for hedayat-media 2.0.0

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

Source distribution (sdist)

Source distribution for hedayat-media 2.0.0
File Size Uploaded Provenance Actions
hedayat_media-2.0.0.tar.gz 23.2 kB Without provenance Details for hedayat_media-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hedayat-media 2.0.0
File Interpreter ABI Platform Actions
hedayat_media-2.0.0-py3-none-any.whl Python 3 none any Details for hedayat_media-2.0.0-py3-none-any.whl

Total release size: 45.2 kB

Release files / hedayat_media-2.0.0.tar.gz

Download URL hedayat_media-2.0.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
178903c448e3d5fa1de9d6565e2bf5dfe8accfc2a3dc41b3ed5c304d0d3cc773
BLAKE2b-256 checksum
How to use checksums
b0ee699a8c516a350c850d149bbcc6d0365a93cd3fe0f1657bd46bc52f159b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / hedayat_media-2.0.0-py3-none-any.whl

Download URL hedayat_media-2.0.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b2ade960caa7d4cdd1d69f73bd0f3ff4081899611db3e9633a5bc92bf4030eb
BLAKE2b-256 checksum
How to use checksums
188dfda550bf523d44e0bc34844e724654635b55e86ddd63dea5493d8efeb009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for hedayat-media 2.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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