islamic-content-sdk 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,483 @@
1
+ Metadata-Version: 2.1
2
+ Name: islamic-content-sdk
3
+ Version: 1.0.0
4
+ Summary: An integrated and easy-to-use software library to fetch authentic Islamic content (Holy Quran and Hadith) in multiple languages.
5
+ Home-page: https://github.com/2yousefreda/islamic-content-sdk-npm
6
+ Author: The Association for Multi-lingual Islamic Content
7
+ Author-email: info@islamiccontent.sa
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: ISC License (ISCL)
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.7
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: requests>=2.25.0
14
+
15
+ # Islamic Content SDK (Python)
16
+
17
+ An integrated and easy-to-use software library for Python developers to fetch authentic Islamic content (The Holy Qur'an and Hadith) in multiple languages directly from official sources.
18
+
19
+ This project is developed for [The Association for Multi-lingual Islamic Content](https://islamiccontent.sa/).
20
+
21
+ ---
22
+
23
+ ## Services Overview
24
+
25
+ This SDK aggregates content from multiple major multi-lingual Islamic platforms:
26
+
27
+ - **QuranEnc (`quranenc`)**: Quran Translations, suras, verses, and audios.
28
+ - **HadeethEnc (`hadeethenc`)**: Hadith collections, category trees, and grades.
29
+ - **IslamHouse (`islamhouse`)**: Multi-lingual books, articles, audios, fatwas, and author details.
30
+ - **Risalat Al-Haramain (`risalatAlHaramain`)**: Platform content, Fatwas, Quran recitations, and Hadiths.
31
+ - **Bayan Al Islam (`bayanAlIslam`)**: Educational booklets and resources tailored for Muslims and Non-Muslims.
32
+ - **Al Montaka (`alMontaka`)**: Structured lookups, categories, content filters, and community comments.
33
+
34
+ ---
35
+
36
+ ## Installation
37
+
38
+ Install the package via pip:
39
+
40
+ ```bash
41
+ pip install islamic-content-sdk
42
+ ```
43
+
44
+ ## Usage
45
+
46
+ ### Initializing the SDK
47
+
48
+ ```python
49
+ from islamic_content_sdk import IslamicContentSdk
50
+
51
+ sdk = IslamicContentSdk()
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Detailed Service Methods Reference
57
+
58
+ Below is a complete guide on how to interact with every single method and option available in the SDK.
59
+
60
+ ### Quran Source (QuranEnc API)
61
+
62
+ **API Documentation Link:** [QuranEnc API](https://quranenc.com/en/home/api/)
63
+
64
+ ```python
65
+ # 1. Get available translations list on the platform
66
+ translations = sdk.quranenc.translationList({
67
+ "language": "es", # Optional: Filter list by language code
68
+ "localization": "ar" # Optional: Localize names in the response
69
+ })
70
+
71
+ # 2. Translate an entire sura (Al-Fatiha in Spanish)
72
+ sura = sdk.quranenc.translationSura("spanish_montada_eu", 1)
73
+
74
+ # 3. Translate a specific verse (Ayah 1 of Sura 1)
75
+ aya = sdk.quranenc.translationAya("spanish_montada_eu", 1, 1)
76
+
77
+ # 4. Get the audio MP3 file details for a specific verse
78
+ audio = sdk.quranenc.ayaAudio("chinese_suliman", 1, 1)
79
+ # Returns: {"status": 200, "file_url": "...", "content_type": "audio/mpeg"}
80
+
81
+ # 5. Submit translation feedback/note (POST request)
82
+ note_response = sdk.quranenc.addNote({
83
+ "sura": 1,
84
+ "aya": 1,
85
+ "name": "QA Tester",
86
+ "email": "qa@example.com",
87
+ "note": "Test note from SDK automated test suite",
88
+ "translation_key": "spanish_montada_eu",
89
+ "source": "sdk_test",
90
+ "version": "1.0.0",
91
+ "suggested_translation": "Suggested text" # Optional
92
+ })
93
+ ```
94
+
95
+ ---
96
+
97
+ ### Hadith Source (HadeethEnc API)
98
+
99
+ **API Documentation Link:** [HadeethEnc API](https://documenter.getpostman.com/view/5211979/TVev3j7q#intro)
100
+
101
+ ```python
102
+ # 1. Get available languages in the encyclopedia
103
+ languages = sdk.hadeethenc.languages()
104
+
105
+ # 2. Get all categories of Hadith translated in a specific language
106
+ categories = sdk.hadeethenc.categories("en")
107
+
108
+ # 3. Get main (root) categories of Hadith in English
109
+ root_categories = sdk.hadeethenc.rootCategories("en")
110
+
111
+ # 4. List Hadiths under a category with pagination
112
+ hadiths = sdk.hadeethenc.hadithsList({
113
+ "language": "en",
114
+ "categoryId": 1, # Optional: Category ID
115
+ "page": 1, # Optional: Page number
116
+ "perPage": 20 # Optional: Number of items per page
117
+ })
118
+
119
+ # 5. Get full explanation, translations, and grade of a specific Hadith by ID
120
+ hadith = sdk.hadeethenc.hadithDetails({
121
+ "id": 2962,
122
+ "language": "ar"
123
+ })
124
+ ```
125
+
126
+ ---
127
+
128
+ ### IslamHouse Source (IslamHouse v3 API)
129
+
130
+ **API Documentation Link:** [IslamHouse API Docs](https://documenter.getpostman.com/view/7929737/TzkyMfPc)
131
+
132
+ ```python
133
+ # ==========================================
134
+ # 1. Categories & Types (categoriesAndTypes)
135
+ # ==========================================
136
+
137
+ # Core material types (videos, books, fatwas, etc.)
138
+ types = sdk.islamhouse.categoriesAndTypes.allTypes("ar", "ar") # siteLang, contentLang
139
+
140
+ # Get all categories in the database
141
+ all_categories = sdk.islamhouse.categoriesAndTypes.allCategories("ar")
142
+
143
+ # Complete category hierarchy tree
144
+ tree = sdk.islamhouse.categoriesAndTypes.categoriesTree("ar")
145
+
146
+ # Subcategories of a category with content lang localization
147
+ child_cats = sdk.islamhouse.categoriesAndTypes.childCategories(1, "ar", "ar") # categoryId, siteLang, contentLang
148
+
149
+ # Basic details of a category by ID
150
+ single_category = sdk.islamhouse.categoriesAndTypes.singleCategoryBasic(1, "ar")
151
+
152
+ # Subcategories with nested children
153
+ sub_categories = sdk.islamhouse.categoriesAndTypes.subCategories(1, "ar")
154
+
155
+ # Available material types under a specific category ID
156
+ category_types = sdk.islamhouse.categoriesAndTypes.categoryTypes(1, "ar", "ar")
157
+
158
+ # Available languages for materials within a category ID
159
+ category_langs = sdk.islamhouse.categoriesAndTypes.categoryLanguages(1, "ar", "ar") # id, slang, language
160
+
161
+ # ==========================================
162
+ # 2. Items Listings (items)
163
+ # ==========================================
164
+
165
+ # List materials by type (e.g. "books", "videos", "audios") and language
166
+ items = sdk.islamhouse.items.listItems("books", "ar", "ar", 1, 25) # type, siteLang, slang, page, limit
167
+
168
+ # List materials published by a specific author ID
169
+ author_items = sdk.islamhouse.items.authorItems(1, "ar", "ar", "ar", 1, 20) # authorId, slang, siteLang, contentLang, page, limit
170
+
171
+ # List materials categorized under a category ID
172
+ cat_items = sdk.islamhouse.items.categoryItems(1, "ar", "ar", "ar", 1, 20) # categoryId, slang, siteLang, contentLang, page, limit
173
+
174
+ # List latest items by period (e.g., "week", "month")
175
+ latest_items = sdk.islamhouse.items.latestItems("week", "ar", "ar", "ar", 1, 25) # period, slang, siteLang, contentLang, page, limit
176
+
177
+ # Highlighted featured items on the homepage
178
+ highlights = sdk.islamhouse.items.highlightedItems("ar", "ar") # siteLang, contentLang
179
+
180
+ # Get the total count of items available for a specific type
181
+ items_count = sdk.islamhouse.items.itemsCount("books", "ar", "ar") # type, siteLang, contentLang
182
+
183
+ # ==========================================
184
+ # 3. Single Item Details (item)
185
+ # ==========================================
186
+
187
+ # Details, metadata, and description of a single item
188
+ item_details = sdk.islamhouse.item.details(228065, "ar")
189
+
190
+ # List downloadable media/PDF attachments for an item
191
+ attachments = sdk.islamhouse.item.attachments(228065)
192
+
193
+ # Category tree path leading to this item
194
+ item_tree = sdk.islamhouse.item.tree(228065, "ar")
195
+
196
+ # Translation card details of the item
197
+ item_card_trans = sdk.islamhouse.item.cardTranslations(228065, "ar")
198
+
199
+ # Other translation languages available for this item
200
+ translations = sdk.islamhouse.item.translations(228065, "ar")
201
+
202
+ # ==========================================
203
+ # 4. Authors and Publishers (authors)
204
+ # ==========================================
205
+
206
+ # List authors/sources with filter and sort parameters
207
+ authors = sdk.islamhouse.authors.list({
208
+ "kind": "author", # Optional: "showall" | "author" | "source"
209
+ "locale": "ar", # Optional: "showall" | language code
210
+ "sort": "countdesc", # Optional
211
+ "page": 1, # Optional
212
+ "perPage": 10 # Optional
213
+ })
214
+
215
+ # Specific author details by ID
216
+ author_details = sdk.islamhouse.authors.details(1, "ar")
217
+
218
+ # Translation card details of an author
219
+ author_card = sdk.islamhouse.authors.cardTranslations(1, "ar")
220
+
221
+ # Material types available for an author
222
+ author_types = sdk.islamhouse.authors.availableTypes(1, "ar", "ar")
223
+
224
+ # Languages available for an author
225
+ author_langs = sdk.islamhouse.authors.availableLocales(1, "ar", "ar")
226
+
227
+ # ==========================================
228
+ # 5. Languages & Terms (languages)
229
+ # ==========================================
230
+
231
+ # Details of all supported languages on the platform
232
+ lang_keys = sdk.islamhouse.languages.keys()
233
+
234
+ # Interface translation terms for localization
235
+ terms = sdk.islamhouse.languages.terms("ar")
236
+
237
+ # Available languages relative to another
238
+ avail_langs = sdk.islamhouse.languages.availableLanguages("ar", "ar")
239
+
240
+ # ==========================================
241
+ # 6. Holy Quran Recitations (quran)
242
+ # ==========================================
243
+
244
+ # Quran recitation categories (reciters, sections)
245
+ quran_categories = sdk.islamhouse.quran.categories("ar")
246
+
247
+ # Basic details of a Quran category
248
+ quran_category = sdk.islamhouse.quran.singleCategory(1, "ar")
249
+
250
+ # Details about a specific reciter
251
+ reciter_details = sdk.islamhouse.quran.authorDetails(1, "ar")
252
+
253
+ # Recitations list of a specific reciter
254
+ recitations = sdk.islamhouse.quran.authorRecitations(1, "ar")
255
+
256
+ # Detailed info of a specific Quran Surah
257
+ sura_details = sdk.islamhouse.quran.suraDetails(1, "ar")
258
+
259
+ # Audio recordings of a specific Surah by various reciters
260
+ sura_recitations = sdk.islamhouse.quran.suraRecitations(1, "ar")
261
+
262
+ # Details of a specific Quran recitation by ID
263
+ recitation = sdk.islamhouse.quran.recitationDetails(228065, "ar")
264
+ ```
265
+
266
+ ---
267
+
268
+ ### Risalat Al-Haramain Source (Risalat Al-Haramain API)
269
+
270
+ **API Documentation Link:** [Risalat Al-Haramain API](https://risala.prh.gov.sa/en/Api/content)
271
+
272
+ ```python
273
+ # ==========================================
274
+ # 1. Platform Contents (contents)
275
+ # ==========================================
276
+
277
+ # Get full content of the platform in a specific language
278
+ full_contents = sdk.risalatAlHaramain.contents.getFullContents({
279
+ "language": "en", # Optional: URL language path (default: "en")
280
+ "lang": "en" # Optional: Query parameter language (default: "en")
281
+ })
282
+
283
+ # Retrieve contents with optional parameters
284
+ contents = sdk.risalatAlHaramain.contents.getContents({
285
+ "language": "en",
286
+ "lang": "en"
287
+ })
288
+
289
+ # Get detailed content of a single item
290
+ single_content = sdk.risalatAlHaramain.contents.singleContent(1, "en")
291
+
292
+ # Quick search items by name
293
+ name_search_result = sdk.risalatAlHaramain.contents.nameSearch("حصن", "ar")
294
+
295
+ # Check available translation languages for an item
296
+ risala_avail_langs = sdk.risalatAlHaramain.contents.availableLanguages(1, "ar")
297
+
298
+ # Get translation of a content item into a target language
299
+ content_translation = sdk.risalatAlHaramain.contents.contentTranslation(1, "en", "ar") # id, targetLanguage, language
300
+
301
+ # ==========================================
302
+ # 2. Islamic Content Modules (islamicContent)
303
+ # ==========================================
304
+
305
+ # Get Fatwas
306
+ fatwas = sdk.risalatAlHaramain.islamicContent.fatwas({
307
+ "language": "en", # Optional
308
+ "lang": "ar", # Optional
309
+ "isFeatured": 1 # Optional: 0 or 1
310
+ })
311
+
312
+ # Get featured Hadiths
313
+ hadeeths = sdk.risalatAlHaramain.islamicContent.hadeeths({
314
+ "language": "en",
315
+ "lang": "ar",
316
+ "isFeatured": 1
317
+ })
318
+
319
+ # Get featured Quran recitations
320
+ quran_content = sdk.risalatAlHaramain.islamicContent.quran({
321
+ "language": "en",
322
+ "lang": "ar",
323
+ "isFeatured": 1
324
+ })
325
+
326
+ # ==========================================
327
+ # 3. Platform Search (search)
328
+ # ==========================================
329
+
330
+ # Keyword text search across platform content
331
+ search_result = sdk.risalatAlHaramain.search.contents("حصن", "en")
332
+
333
+ # ==========================================
334
+ # 4. Lookups & Meta (lookups)
335
+ # ==========================================
336
+
337
+ # Get available languages
338
+ risala_langs = sdk.risalatAlHaramain.lookups.languages("en")
339
+
340
+ # Get available content types
341
+ content_types = sdk.risalatAlHaramain.lookups.contentTypes("en")
342
+ ```
343
+
344
+ ---
345
+
346
+ ### Bayan Al Islam Source (Bayan Al Islam API)
347
+
348
+ **Postman Resources:** [Collection](https://byenah.com/download-request?name=Bayan%20Al%20Islam.postman_collection.json) | [Environment](https://byenah.com/download-request?name=Bayan%20al%20islam%20env.postman_environment.json)
349
+
350
+ ```python
351
+ # 1. Get list of available languages
352
+ bayan_langs = sdk.bayanAlIslam.languagesList("ar")
353
+
354
+ # 2. Get content list tailored for Muslims
355
+ muslim_list = sdk.bayanAlIslam.muslimList("en")
356
+
357
+ # 3. Get content list tailored for Non-Muslims
358
+ non_muslim_list = sdk.bayanAlIslam.nonMuslimList("en")
359
+
360
+ # 4. Get details of a specific content item by ID
361
+ content_details = sdk.bayanAlIslam.singleContent(22184, "en")
362
+
363
+ # 5. Get languages list paginated and filtered by name
364
+ paginated_langs = sdk.bayanAlIslam.paginatedLanguages({
365
+ "name": "English", # Optional
366
+ "page": 1, # Optional
367
+ "language": "en" # Optional
368
+ })
369
+
370
+ # 6. Get recent contents (Muslim/Non-Muslim updates)
371
+ recent = sdk.bayanAlIslam.recentContents({
372
+ "lang": "ar",
373
+ "init": True,
374
+ "ids": [22184], # Optional: content IDs list
375
+ "language": "en" # Optional
376
+ })
377
+
378
+ # 7. Get website lookup variables
379
+ lookups = sdk.bayanAlIslam.lookups("en")
380
+
381
+ # 8. Search materials by title/name
382
+ search_result = sdk.bayanAlIslam.nameSearch("حصن", "ar")
383
+
384
+ # 9. Check available translation languages for a content ID
385
+ avail_langs = sdk.bayanAlIslam.availableLanguages(22184, "ar")
386
+
387
+ # 10. Get specific translation of a content item
388
+ translation = sdk.bayanAlIslam.contentTranslation(22184, "en", "ar") # id, targetLanguage, language
389
+
390
+ # 11. Get translations for media or PDF attachments of a content item
391
+ attachments_trans = sdk.bayanAlIslam.attachmentsTranslation(22184, "en", "ar") # id, targetLanguage, language
392
+ ```
393
+
394
+ ---
395
+
396
+ ### Al Montaka Source (Al Montaka API)
397
+
398
+ **API Documentation Link:** [Al Montaka API](https://documenter.getpostman.com/view/5211979/2s8YzMZ6Fu)
399
+
400
+ ```python
401
+ # ==========================================
402
+ # 1. Content and Comments (contents)
403
+ # ==========================================
404
+
405
+ # Get all comments for a specific content ID
406
+ comments = sdk.alMontaka.contents.comments(1)
407
+
408
+ # Add a new comment to a specific content item
409
+ new_comment = sdk.alMontaka.contents.addComment(1, "Test comment")
410
+
411
+ # Get filtered content by category IDs
412
+ filtered_content = sdk.alMontaka.contents.content([1, 2])
413
+
414
+ # ==========================================
415
+ # 2. Site Lookups and Filters (lookups)
416
+ # ==========================================
417
+
418
+ # Get target age groups
419
+ age_groups = sdk.alMontaka.lookups.ageGroups()
420
+
421
+ # Get categories matching language and name filter
422
+ categories = sdk.alMontaka.lookups.categories({
423
+ "languageId": 1,
424
+ "nameCont": "General"
425
+ })
426
+
427
+ # Get publishing entities matching language and name filter
428
+ entities = sdk.alMontaka.lookups.entities({
429
+ "languageId": 1,
430
+ "nameCont": "Dar"
431
+ })
432
+
433
+ # Get expertise/scientific levels matching filter
434
+ expert_levels = sdk.alMontaka.lookups.expertLevels({
435
+ "languageId": 1,
436
+ "nameCont": "Level"
437
+ })
438
+
439
+ # Get ideologies matching filter
440
+ ideologies = sdk.alMontaka.lookups.ideologies({
441
+ "languageId": 1,
442
+ "nameCont": "Sunnah",
443
+ "parentId": 0
444
+ })
445
+
446
+ # Get available languages
447
+ languages = sdk.alMontaka.lookups.languages()
448
+
449
+ # Get/search scholars, narrators, or personalities
450
+ persons = sdk.alMontaka.lookups.persons({
451
+ "nameCont": "Muhammad", # Optional
452
+ "page": 1 # Optional
453
+ })
454
+
455
+ # Get website sections matching filter
456
+ sections = sdk.alMontaka.lookups.sections({
457
+ "languageId": 1,
458
+ "nameCont": "Section"
459
+ })
460
+
461
+ # Get tags matching filter
462
+ tags = sdk.alMontaka.lookups.tags({
463
+ "languageId": 1,
464
+ "nameCont": "Tag"
465
+ })
466
+
467
+ # Get targeted groups of audience
468
+ targeted_groups = sdk.alMontaka.lookups.targetedGroups()
469
+
470
+ # Get integrated YouTube channels list
471
+ youtube_channels = sdk.alMontaka.lookups.youtubeChannels()
472
+ ```
473
+
474
+ ---
475
+
476
+ ## Donation & Support
477
+
478
+ You can support the projects and efforts of The Association for Multi-lingual Islamic Content through the following official channels:
479
+
480
+ - [Support Projects (Wakfy)](https://islamiccontent.org/Wakfy)
481
+ - [Bank Accounts](https://islamiccontent.org/Accounts)
482
+ - [Association Store](https://store.islamiccontent.sa/)
483
+ - [Annual Operational Support (الدعم التشغيلي السنوي للجمعية)](https://store.islamiccontent.sa/%D8%A7%D9%84%D9%85%D8%B5%D8%B1%D9%88%D9%81%D8%A7%D8%AA-%D8%A7%D9%84%D8%AA%D8%B4%D8%BA%D9%8A%D9%84%D9%8A%D8%A9-%D8%A7%D9%84%D8%B3%D9%86%D9%88%D9%8A%D8%A9-%D9%84%D9%84%D8%AC%D9%85%D8%B9%D9%8A-%D8%A9/p1950956689)