Skip to main content

Quran Phonetic Search

Quran Phonetic Search is a Python package and CLI tool that allows fuzzy searching of Quranic words using their phonetic or simplified Latin transliterations. The package includes a preprocessed CSV dataset mapping Arabic words to their phonetic and Latin representations.

Features

  • Fuzzy search for Arabic words based on phonetic input or Latin transliteration.
  • CLI tool for quick querying.
  • Configurable result limit.
  • Reloadable database for updates.
  • Python package ready for pip installation.

Installation

You can install the package locally from source or via pip once published.

Local installation

# Build the package
python -m build

# Install locally
pip install --force-reinstall dist/quran_phonetic_search-0.1.0-py3-none-any.whl

Dependencies

  • Python 3.10 or higher
  • rapidfuzz >= 3.0, < 4.0
  • pandas >= 2.0, < 3.0

Usage

After installation, the CLI command quran-search is available.

Query a word

quran-search query <word> [--limit N]
  • <word>: Phonetic or simple Latin representation of the Quranic word.
  • --limit N: Optional. Maximum number of results to return. Defaults to 3.

Example:

quran-search query besm --limit 3

Output:

Top 3 match(es) for 'besm':
1. بِسْمِ
2. فَتَبَسَّمَ
3. بِسَمْعِهِمْ

Reload the database

quran-search reload

Reloads the CSV dataset into memory in case of updates.

Python API

You can also use the package programmatically:

from quran_phonetic_search.search import QuranSearch

searcher = QuranSearch()
results = searcher.query_word("besm", limit=3)
print(results)

Project Structure

QuranPhoneticSearch/
├── quran_phonetic_search/      # Python package
│   ├── __init__.py
│   ├── search.py
│   ├── main.py
│   └── data/
│       └── quran_words.csv
├── data_preprocessing/         # Scripts and notebooks for data cleaning and preprocessing
│   └── preprocessing.ipynb     # Shows how the dataset was collected and processed
├── README.md
├── pyproject.toml

License

This project is licensed under the MIT License.

Metadata

Release files for quran-phonetic-search 0.1.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 quran-phonetic-search 0.1.0
File Size Uploaded
quran_phonetic_search-0.1.0.tar.gz 754.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quran-phonetic-search 0.1.0
File Interpreter ABI Platform
quran_phonetic_search-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / quran_phonetic_search-0.1.0.tar.gz

Download URL quran_phonetic_search-0.1.0.tar.gz
Size 754.2 kB
Tags Source
SHA-256 checksum
How to use checksums
60a3c9bce1546ae7fcae4643cfa556ffd42e5f18eccebe89277e25b8ae4b7d7d
BLAKE2b-256 checksum
How to use checksums
f24d7133b5fd789a6ba522a2df0a0da85c9d79ac02a96ea6598b3818a347bf91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / quran_phonetic_search-0.1.0-py3-none-any.whl

Download URL quran_phonetic_search-0.1.0-py3-none-any.whl
Size 752.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c5508f5965288a9ece4ab1e9b5a6a92065ac0b395f9eee4afc71dc864aaf363
BLAKE2b-256 checksum
How to use checksums
bff4f0c3b154571ed538004fda0d60de2ff3edb935c125d99cad967453880c46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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