QuranKit
QuranKit is a query-first Python toolkit for computational Quran analysis, providing structured access to Quranic text, morphology, roots, lemmas, translations, tafsir, and linguistic pattern discovery.
Features
- Quranic verse retrieval
- Root-based search
- Lemma-based search
- Word-level linguistic analysis
- POS tagging access
- Morphological feature access
- Multi-language translations
- Tafsir retrieval
- Root-order pattern discovery
- Frequency analysis
- Research-oriented querying
- Memory-only dataset loading
Design Philosophy
QuranKit is designed around feature-level access rather than dataset export.
Users interact with the Quran through focused search and analysis functions instead of downloading or manipulating the complete dataset.
Core Principles
- Returns only the requested information
- Compact results by default
- No API key required
- No remote inference
- Query-first architecture
- Memory-only dataset loading
- Translation and tafsir access only when explicitly requested
QuranKit intentionally does not provide:
q.to_dataframe()
q.export_json()
q.export_dataset()
q.dump_all()
This keeps the package focused on analysis, exploration, and research rather than dataset replication.
Installation
pip install qurankit
For development:
pip install -e .
Quick Start
from qurankit import QuranKit
q = QuranKit()
print(q.stats())
ayah = q.get_ayah(1, 1)
print(ayah)
results = q.search_root("رحم", limit=3)
translation = q.get_translation(2, 255, lang="en")
print(translation["translation"])
Statistics
q.stats()
Example:
{
"surahs": 114,
"ayahs": 6236,
"languages": 20,
"roots": 1600,
"lemmas": 14000
}
Verse Retrieval
q.get_ayah(1, 1)
Example output:
{
"sura": 1,
"ayah": 1,
"sura_ar": "الفاتحة",
"sura_en": "Al-Fātiḥah",
"ayatext_nt": "بسم الله الرحمن الرحيم"
}
Linguistic Features
Retrieve individual linguistic layers without loading unnecessary information.
q.get_words(2, 255)
q.get_roots(2, 255)
q.get_lemmas(2, 255)
q.get_pos(2, 255)
q.get_morph_tags(2, 255)
q.get_analysis(2, 255)
q.word_analysis(2, 255)
Search
Search Text
q.search_text("الله", limit=5)
Search Word
q.search_word("جنة", limit=5)
Search Root
q.search_root("رحم", limit=5)
Search Lemma
q.search_lemma("ٱللَّه", limit=5)
Search POS Tags
q.search_pos("V", limit=5)
Search results remain compact and exclude long translations and tafsir content.
Translations
List available languages:
q.available_languages()
Retrieve a specific translation:
q.get_translation(2, 255, lang="en")
Retrieve multiple translations:
q.get_translations(
1,
1,
langs=["en", "tr", "de"]
)
Search inside translations:
q.search_translation(
"mercy",
lang="en",
limit=5
)
Tafsir
Retrieve tafsir only when requested.
Al-Muyassar
q.get_tafsir(
1,
1,
source="muyassar"
)
Al-Jalalayn
q.get_tafsir(
1,
1,
source="jalalayn"
)
Pattern Discovery
Repeated root-order patterns:
q.find_repeated_root_orders(
min_occurrences=2,
limit=10
)
Root frequency statistics:
q.root_frequency(limit=20)
Random Verse
q.random_ayah()
Dataset Handling
QuranKit ships with a minimal bundled sample dataset for testing and fallback purposes.
The complete Quran dataset is loaded from the internal default dataset source into memory only.
QuranKit does not intentionally persist the full dataset to local storage and does not provide dataset export utilities.
Performance
import time
start = time.time()
q = QuranKit()
print(
"Load time:",
round(time.time() - start, 2),
"seconds"
)
Example Research Workflow
from qurankit import QuranKit
q = QuranKit()
verses = q.search_root("رحم", limit=10)
for verse in verses:
print(
verse["sura"],
verse["ayah"],
verse["ayatext_nt"]
)
Disclaimer
QuranKit is intended for computational analysis, research, education, and software development.
It is not a source of religious rulings, legal opinions, or authoritative tafsir.
Metadata
Release files for qurankit 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| qurankit-0.4.1.tar.gz | 19.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qurankit-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.1 kB
Release files / qurankit-0.4.1.tar.gz
| Download URL | qurankit-0.4.1.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27e8749375064573ccf37d39fcf46aa2948265dd0e8dd9d7e5537aa7c692fcb1
|
|
BLAKE2b-256 checksum How to use checksums |
39e7b4b205140e3fb7afe382b29616c644b6ce8a5e1035651252927544cf4101
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / qurankit-0.4.1-py3-none-any.whl
| Download URL | qurankit-0.4.1-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7cab6f44d969f26c71a864302bcfa1949dc91516f3de102a800395fc09a5dd5c
|
|
BLAKE2b-256 checksum How to use checksums |
2a466c48fb4da6810354ba20d5ac2503289fef7b531ea778802ab14e364393a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for qurankit 0.4.1
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.