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.5.tar.gz (281.5 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.5-py3-none-any.whl (296.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quran_ayas-0.1.5.tar.gz
  • Upload date:
  • Size: 281.5 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.5.tar.gz
Algorithm Hash digest
SHA256 52952ed81612f82522737b1a0fdddd77d16999b21cf4aeaa1f766d0cde7a356e
MD5 87a2c09ae2b7ca13c5ad09a28b40e9f3
BLAKE2b-256 f357b3654d7bc5be9fd9b2ef8f0030b0bbfd7e503697003efdeda75220b395ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quran_ayas-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 296.9 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2c98a804d98f05e10f4c2f8120da9fe5f43808701e5cb578184c2b4b08633c68
MD5 6309feb76dd088ff5e2bd09a67d0bf79
BLAKE2b-256 778347a9431d69ad7ce5cce47a4a352b2ee3f10fc8e4f56fa90c224f744d86fa

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