Skip to main content

A library to deal with Quran Ayas

Project description

قارئ القرآن الكريم - Quran Reader

نظام الاستعلام عن بيانات القرءان الكريم بسهولة.

🚀 الاستخدام

قراءة البيانات

from quran_ayas.quran_reader import QuranReader

# تحميل قاعدة البيانات
reader = QuranReader()

أ) قراءة آية كاملة

ayah = reader.get_ayah(surah_number=1, ayah_number=1)
print(ayah)
# بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ

ب) قراءة كلمة محددة

# الكلمة الأولى (index 0)
word = reader.get_word_at_index(surah_number=1, ayah_number=1, word_index=0)
print(word)
# بِسْمِ

# الكلمة الثانية (index 1)
word = reader.get_word_at_index(surah_number=1, ayah_number=1, word_index=1)
print(word)
# اللَّهِ

ج) معلومات عن سورة

info = reader.get_surah_info(surah_number=1)
print(info)
# {'surah_number': 1, 'ayat_count': 7, 'ayat_numbers': [1, 2, 3, 4, 5, 6, 7]}

د) طباعة آية مع أرقام الكلمات

reader.print_ayah(surah_number=1, ayah_number=1, show_word_indices=True)

# النتيجة:
# ============================================================
# السورة 1 - الآية 1
# ============================================================
# 
# [0] بِسْمِ
# [1] اللَّهِ
# [2] الرَّحْمَٰنِ
# [3] الرَّحِيمِ
# 
# عدد الكلمات: 4
# ============================================================

هـ) قراءة كل آيات سورة

ayat = reader.get_all_ayat_in_surah(surah_number=1)
for ayah_num, ayah_text in ayat.items():
    print(f"{ayah_num}. {ayah_text}")

و) البحث في آية

found = reader.search_in_ayah(
    surah_number=1, 
    ayah_number=1, 
    search_text="الرَّحْمَٰنِ"
)
print(found)  # True

ز) عدد الكلمات في آية

count = reader.get_word_count(surah_number=1, ayah_number=1)
print(count)  # 4

📝 الدوال المتاحة

الدالة الوصف
get_ayah(surah, ayah) الحصول على آية كاملة
get_word_at_index(surah, ayah, index) الحصول على كلمة محددة
get_surah_info(surah) معلومات عن السورة
get_all_ayat_in_surah(surah) كل آيات السورة
search_in_ayah(surah, ayah, text) البحث في آية
get_word_count(surah, ayah) عدد كلمات الآية
print_ayah(surah, ayah, show_indices) طباعة منسقة

🎯 أمثلة عملية

مثال 2: استعراض سورة كاملة مع التحليل

reader = QuranReader()

# قراءة كل آيات الفاتحة
ayat = reader.get_all_ayat_in_surah(1)

for ayah_num, ayah_text in ayat.items():
    print(f"\n{'='*60}")
    print(f"الآية {ayah_num}: {ayah_text}")
    print('='*60)

⚙️ متطلبات التشغيل

  • Python 3.6+
  • لا توجد مكتبات خارجية مطلوبة (استخدام المكتبات القياسية فقط)

📦 الملفات

  • quran_reader.py - قراءة والاستعلام عن البيانات
  • quran.json - قاعدة البيانات (يتم إنشاؤها)

💡 ملاحظات

  • أرقام الآيات والكلمات تبدأ من 1 (ليس من 0)
  • لكن الـ word_index يبدأ من 0 (لأنه index في Python)
  • يتم تنظيف المسافات الزائدة تلقائياً
  • يدعم Unicode كامل للنصوص العربية

✅ التثبيت

pip install quran-ayas

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

quran_ayas-0.1.4.tar.gz (281.4 kB view details)

Uploaded Source

Built Distribution

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

quran_ayas-0.1.4-py3-none-any.whl (296.8 kB view details)

Uploaded Python 3

File details

Details for the file quran_ayas-0.1.4.tar.gz.

File metadata

  • Download URL: quran_ayas-0.1.4.tar.gz
  • Upload date:
  • Size: 281.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for quran_ayas-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2e147c11bc38f292c74cba0137f34516383562c748dfe682e607d513cf283a08
MD5 fa071eb35f22155cf940d8dc3841d8f2
BLAKE2b-256 531a2176483262b47aaa5c0b937fed9a8e31ae8ebed50ace8347578cd178a85e

See more details on using hashes here.

File details

Details for the file quran_ayas-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: quran_ayas-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 296.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for quran_ayas-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 69c11cd6ce8b9bc25de56b4b8264d197c00c5c3e9d22b8cc65abe31bb09c99b3
MD5 8bec2126c1bfa7d5b9c1ec37c6bcc7de
BLAKE2b-256 40efbb40f92126f59e10abc7d23fa49d9fc99ffb7b65ae833e07e5a524803f55

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