Skip to content
Back to search

alfanous

Alfanous is an Arabic search engine API provides the simple and advanced search in Quran , more features and many interfaces...

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/alfanous-team--alfanous/badge.svg)](/listings/alfanous-team--alfanous)

HTML

<a href="/listings/alfanous-team--alfanous"><img src="/api/listings/alfanous-team--alfanous/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installation

Install from PyPI using pip:

$ pip install alfanous3

Basic Usage

Python Library

>>> from alfanous import api

# Simple search for a word
>>> api.search(u"الله")

# Advanced search with options
>>> api.do({"action": "search", "query": u"الله", "page": 1, "perpage": 10})

# Search using Buckwalter transliteration
>>> api.do({"action": "search", "query": u"Allh"})

# Get suggestions
>>> api.do({"action": "suggest", "query": u"الح"})

# Correct a query
>>> api.correct_query(u"الكتاب")

# Get metadata information
>>> api.do({"action": "show", "query": "translations"})

Web Service

You can also use the public web service:

* Search: http://alfanous.org/api/search?query=الله * With transliteration: http://alfanous.org/api/search?query=Allh

Or run your own web service locally (see [alfanous_webapi](src/alfanous_webapi/README.md)).

Quick Examples

Search for phrases:

>>> api.search(u'"الحمد لله"')

Boolean search (AND, OR, NOT):

>>> api.search(u'الصلاة + الزكاة')    # AND
>>> api.search(u'الصلاة | الزكاة')    # OR
>>> api.search(u'الصلاة - الزكاة')    # NOT

Fielded search:

>>> api.search(u'سورة:يس')           # Search in Sura Yasin
>>> api.search(u'سجدة:نعم')          # Search verses with sajda

Wildcard search:

>>> api.search(u'*نبي*')             # Words containing "نبي"

Faceted search (aggregate by fields):

>>> api.do({
...     "action": "search",
...     "query": u"الله",
...     "facets": "sura_id,juz"
... })

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 630 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![Tests](https://github.com/Alfanous-team/alfanous/workflows/tests/badge.svg)](https://github.com/Alfanous-team/alfanous/actions)
  2. <!-- mcp-name: io.github.Alfanous-team/alfanous -->
  3. # Alfanous API
  4. **Alfanous** is a Quranic search engine API that provides simple and advanced search capabilities for the Holy Qur'an. It enables developers to build applications that search through Quranic text in Arabic, with support for Buckwalter transliteration, advanced query syntax, and rich metadata.
  5. ## Features
  6. * **Powerful Search**: Search Quranic verses with simple queries or advanced Boolean logic
  7. * **Arabic Support**: Full support for Arabic text and Buckwalter transliteration
  8. * **Rich Metadata**: Access verse information, translations, recitations, and linguistic data
  9. * **Flexible API**: Use as a Python library or RESTful web service
  10. * **Faceted Search**: Aggregate results by Sura, Juz, topics, and more
  11. * **Multiple Output Formats**: Customize output with different views and highlight styles
  12. ## Quickstart
  13. ### Installation
  14. Install from PyPI using pip:
  15. ```sh
  16. $ pip install alfanous3
  17. ```
  18. ### Basic Usage
  19. #### Python Library
  20. ```python
  21. >>> from alfanous import api
  22. # Simple search for a word
  23. >>> api.search(u"الله")
  24. # Advanced search with options
  25. >>> api.do({"action": "search", "query": u"الله", "page": 1, "perpage": 10})
  26. # Search using Buckwalter transliteration
  27. >>> api.do({"action": "search", "query": u"Allh"})
  28. # Get suggestions
  29. >>> api.do({"action": "suggest", "query": u"الح"})
  30. # Correct a query
  31. >>> api.correct_query(u"الكتاب")
  32. # Get metadata information
  33. >>> api.do({"action": "show", "query": "translations"})
  34. ```
  35. #### Web Service
  36. You can also use the public web service:
  37. * Search: http://alfanous.org/api/search?query=الله
  38. * With transliteration: http://alfanous.org/api/search?query=Allh
  39. Or run your own web service locally (see [alfanous_webapi](src/alfanous_webapi/README.md)).
  40. #### Quick Examples
  41. Search for phrases:
  42. ```python
  43. >>> api.search(u'"الحمد لله"')
  44. ```
  45. Boolean search (AND, OR, NOT):
  46. ```python
  47. >>> api.search(u'الصلاة + الزكاة') # AND
  48. >>> api.search(u'الصلاة | الزكاة') # OR
  49. >>> api.search(u'الصلاة - الزكاة') # NOT
  50. ```
  51. Fielded search:
  52. ```python
  53. >>> api.search(u'سورة:يس') # Search in Sura Yasin
  54. >>> api.search(u'سجدة:نعم') # Search verses with sajda
  55. ```
  56. Wildcard search:
  57. ```python
  58. >>> api.search(u'*نبي*') # Words containing "نبي"
  59. ```
  60. Faceted search (aggregate by fields):
  61. ```python
  62. >>> api.do({
  63. ... "action": "search",
  64. ... "query": u"الله",
  65. ... "facets": "sura_id,juz"
  66. ... })
  67. ```
  68. ## Documentation
  69. ### API Reference
  70. #### Core Functions
  71. * `api.search(query, **options)` - Search Quran verses
  72. * `api.do(params)` - Unified interface for all actions (search, suggest, show, list_values, correct_query)
  73. * `api.correct_query(query, unit, flags)` - Get a spelling-corrected version of a query
  74. * `api.get_info(category)` - Get metadata information
  75. The underlying `Raw` output engine is exposed as `Engine` in `alfanous.api` (and re-exported from `alfanous` directly). Use it as a context manager to ensure index resources are properly released:
  76. ```python
  77. from alfanous.api import Engine
  78. # or equivalently:
  79. # from alfanous import Engine
  80. with Engine() as engine:
  81. result = engine.do({"action": "search", "query": u"الله"})
  82. ```
  83. #### Search Parameters
  84. Common parameters for `api.do()` with `action="search"`:
  85. * `query` (str): Search query (required)
  86. * `unit` (str): Search unit - "aya", "word", or "translation" (default: "aya")
  87. * `page` (int): Page number (default: 1)
  88. * `perpage` (int): Results per page, 1-100 (default: 10)
  89. * `sortedby` (str): Sort order - "score", "relevance", "mushaf", "tanzil", "ayalength" (default: "score")
  90. * `reverse` (bool): Reverse the sort order (default: False)
  91. * `view` (str): Output view - "minimal", "normal", "full", "statistic", "linguistic" (default: "normal")
  92. * `highlight` (str): Highlight style - "css", "html", "bold", "bbcode" (default: "css")
  93. * `script` (str): Text script - "standard" or "uthmani" (default: "standard")
  94. * `vocalized` (bool): Include Arabic vocalization (default: True)
  95. * `translation` (str): Translation ID to include
  96. * `recitation` (str): Recitation ID to include (1-30, default: "1")
  97. * `fuzzy` (bool): Enable fuzzy search — searches both `aya_` (exact) and `aya` (normalised/stemmed) fields, plus Levenshtein distance matching (default: False). See [Exact Search vs Fuzzy Search](#exact-search-vs-fuzzy-search).
  98. * `fuzzy_maxdist` (int): Maximum Levenshtein edit distance for fuzzy term matching — `1`, `2`, or `3` (default: `1`, only used when `fuzzy=True`).
  99. * `facets` (str): Comma-separated list of fields for faceted search
  100. * `filter` (dict): Filter results by field values
  101. For a complete list of parameters and options, see the [detailed documentation](#advanced-features).
  102. ### Advanced Features
  103. #### Exact Search vs Fuzzy Search
  104. Alfanous provides two complementary search modes that control which index fields are queried.
  105. ##### Exact Search (default — `fuzzy=False`)
  106. When fuzzy search is **off** (the default), queries run against the **`aya_`** field, which stores the fully-vocalized Quranic text with diacritical marks (tashkeel) preserved. This mode is designed for precise, statistical matching:
  107. * Diacritics in the query are significant — `مَلِكِ` and `مَالِكِ` are treated as different words.
  108. * No stop-word removal, synonym expansion, or stemming is applied to the query.
  109. * Ideal when you need exact phrase matches, reproducible result counts, or statistical analysis.
  110. ```python
  111. # Default exact search — only the vocalized aya_ field is used
  112. >>> api.search(u"الله")
  113. >>> api.search(u"الله", fuzzy=False)
  114. # Phrase match with full diacritics
  115. >>> api.search(u'"الْحَمْدُ لِلَّهِ"')
  116. ```
  117. ##### Fuzzy Search (`fuzzy=True`)
  118. When fuzzy search is **on**, queries run against **both** the `aya_` field (exact matches) **and** the `aya` field (a separate index built for broad, forgiving search). At index time the `aya` field is processed through a richer pipeline:
  119. 1. **Normalisation** — shaped letters, tatweel, hamza variants and common spelling errors are unified.
  120. 2. **Stop-word removal** — high-frequency function words (e.g. مِنْ، فِي، مَا) are filtered out so they do not dilute result relevance.
  121. 3. **Synonym expansion** — each token is stored together with its synonyms, so a query for one word automatically matches equivalent words.
  122. 4. **Arabic stemming** — words are reduced to their stem using the [Snowball Arabic stemmer](https://snowballstem.org/) (via `pystemmer`), so different morphological forms of the same root match each other.
  123. No heavy operations are performed on the query string at search time; all the linguistic enrichment lives in the index.
  124. Additionally, for each Arabic term in the query, a **Levenshtein distance** search is performed against the `aya_ac` field (unvocalized, non-stemmed). This catches spelling variants and typos within a configurable edit-distance budget controlled by `fuzzy_maxdist`.
  125. ```python
  126. # Fuzzy search — aya_ (exact) + aya (normalised/stemmed) + Levenshtein distance on aya_ac
  127. >>> api.search(u"الكتاب", fuzzy=True)
  128. # Increase edit distance to 2 to tolerate more spelling variation
  129. >>> api.search(u"الكتاب", fuzzy=True, fuzzy_maxdist=2)
  130. # Via the unified interface
  131. >>> api.do({
  132. ... "action": "search",
  133. ... "query": u"مؤمن",
  134. ... "fuzzy": True,
  135. ... "fuzzy_maxdist": 1,
  136. ... "page": 1,
  137. ... "perpage": 10
  138. ... })
  139. ```
  140. | `fuzzy_maxdist` | Behaviour |
  141. |---|---|
  142. | `1` (default) | Catches single-character insertions, deletions, or substitutions |
  143. | `2` | Broader tolerance — useful for longer words or noisy input |
  144. | `3` | Maximum supported — use with care as recall increases significantly |
  145. Fuzzy mode is particularly useful when:
  146. * The user does not know the exact vocalized form of a word.
  147. * You want morphologically related words to appear in the same result set (e.g. searching *كتب* also surfaces *كتاب*, *كاتب*, *مكتوب*).
  148. * You want synonym-aware retrieval without writing explicit OR queries.
  149. > **Note:** `pystemmer` must be installed for stemming to take effect (`pip install pystemmer`). If the package is absent the stem filter degrades silently to a no-op, leaving normalisation and stop-word removal still active.
  150. #### List Field Values
  151. `list_values` returns every unique indexed value for a given field. Use it to discover the full vocabulary of searchable fields — for example, all available translation identifiers, part-of-speech tags, or root words — before composing a query.
  152. ```python
  153. # Get all unique root values in the index
  154. >>> api.do({"action": "list_values", "field": "root"})
  155. # Returns: {"list_values": {"field": "root", "values": [...], "count": N}}
  156. # Discover all indexed translation IDs
  157. >>> api.do({"action": "list_values", "field": "trans_id"})
  158. # Discover all part-of-speech categories for word search
  159. >>> api.do({"action": "list_values", "field": "pos"})
  160. # Retrieve all indexed lemmas on demand (replaces the former show/lemmas)
  161. >>> api.do({"action": "list_values", "field": "lemma"})
  162. ```
  163. **Parameters:**
  164. * `field` (str): The name of the indexed field whose unique values you want (required).
  165. **Return value:**
  166. A dictionary with a `list_values` key containing:
  167. * `field` — the requested field name.
  168. * `values` — sorted list of unique non-empty indexed values.
  169. * `count` — length of the `values` list.
  170. #### Query Correction
  171. `correct_query()` uses Whoosh's built-in spell-checker to compare each term in the query against the index vocabulary and replace unknown terms with the closest known alternative. When the query is already valid (all terms appear in the index) the `corrected` value in the response is identical to the original input.
  172. ```python
  173. # Correct a query via the dedicated function
  174. >>> api.correct_query(u"الكتاب")
  175. # Returns:
  176. # {"correct_query": {"original": "الكتاب", "corrected": "الكتاب"}, "error": ...}
  177. # Correct a misspelled / out-of-vocabulary term
  178. >>> api.correct_query(u"الكتب")
  179. # Returns:
  180. # {"correct_query": {"original": "الكتب", "corrected": "الكتاب"}, "error": ...}
  181. # Via the unified interface
  182. >>> api.do({"action": "correct_query", "query": u"الكتب", "unit": "aya"})
  183. ```
  184. **Parameters:**
  185. * `query` (str): The raw query string to correct (required).
  186. * `unit` (str): Search unit — currently only `"aya"` is supported; other units return `None` (default: `"aya"`).
  187. * `flags` (dict): Optional dictionary of additional flags.
  188. **Return value:**
  189. A dictionary with a `correct_query` key containing:
  190. * `original` — the input query string as provided.
  191. * `corrected` — the corrected query string; identical to `original` when no correction is needed.
  192. #### Query Syntax
  193. Alfanous supports advanced query syntax:
  194. * **Phrases**: Use quotes - `"الحمد لله"`
  195. * **Boolean AND**: Use `+` - `الصلاة + الزكاة`
  196. * **Boolean OR**: Use `|` - `الصلاة | الزكاة`
  197. * **Boolean NOT**: Use `-` - `الصلاة - الزكاة`
  198. * **Wildcards**: Use `*` for multiple chars, `?` for single char - `*نبي*`, `نعم؟`
  199. * **Fielded Search**: Use field name - `سورة:يس`, `سجدة:نعم`
  200. * **Ranges**: Use `[X الى Y]` - `رقم_السورة:[1 الى 5]`
  201. * **Partial Vocalization**: Search with some diacritics - `آية_:'مَن'`
  202. * **Derivation (stem)**: Use `>` - `>رحيم` (searches `aya_stem` — corpus-derived stem)
  203. * **Derivation (lemma)**: Use `>>` - `>>رحيم` (searches `aya_lemma` — all inflections of the same lexeme)
  204. * **Derivation (root)**: Use `>>>` - `>>>ملك` (searches `aya_root` — all words from the same root)
  205. * **Tuples**: Use `{root,type}` - `{قول،اسم}`
  206. #### Derivation-Level Search
  207. Control how broadly the search expands morphologically using the `derivation_level` parameter:
  208. | Level | Value | Index field | Description |
  209. |---|---|---|---|
  210. | 0 | `"word"` | `aya` | Exact match only (default) |
  211. | 1 | `"stem"` | `aya_stem` | Corpus-derived stem — words sharing the same morphological stem |
  212. | 2 | `"lemma"` | `aya_lemma` | Corpus lemma — all inflections of the same lexeme |
  213. | 3 | `"root"` | `aya_root` | Trilateral root — all words from the same root |
  214. Each derivation field is pre-indexed at build time so queries run against a compact, pre-computed representation rather than expanding at search time.
  215. ```python
  216. # Level 0 — exact match
  217. >>> api.do({"action": "search", "query": "رَحِيمٌ"})
  218. # Level 1 — stem (corpus-derived stem)
  219. >>> api.do({"action": "search", "query": "رحيم", "derivation_level": 1})
  220. # Level 2 — all words sharing the same lemma (e.g. all forms of رَحِيمٌ)
  221. >>> api.do({"action": "search", "query": "رحيم", "derivation_level": 2})
  222. # Level 3 — all words from root رحم (رحمة، رحمن، رحيم، يرحم، …)
  223. >>> api.do({"action": "search", "query": "رحيم", "derivation_level": 3})
  224. # String aliases are also accepted
  225. >>> api.do({"action": "search", "query": "كتب", "derivation_level": "root"})
  226. ```
  227. The derivation syntax `>word`, `>>word`, `>>>word` maps to levels 1, 2, 3 respectively and can be embedded directly in queries:
  228. ```python
  229. # Stem-level derivation in a query expression
  230. >>> api.do({"action": "search", "query": ">رحيم"})
  231. # Root-level: all words from root ملك
  232. >>> api.do({"action": "search", "query": ">>>ملك"})
  233. # Combined with field filters
  234. >>> api.do({"action": "search", "query": ">>الله AND سورة:الإخلاص"})
  235. ```
  236. #### Word Search (`unit="word"`)
  237. When `unit="word"` the engine searches word-level child documents instead of verse-level parent documents. Each word child carries its full morphological annotation — part-of-speech, lemma, stem, root, pattern, gender, number, person, voice, mood, derivation level, and more.
  238. ```python
  239. # Search all words matching "الله" at word level
  240. >>> api.do({"action": "search", "query": "الله", "unit": "word"})
  241. # Derivation levels also apply to word search:
  242. # Level 1 — search word_stem (corpus-derived stem)
  243. >>> api.do({"action": "search", "query": "رحيم", "unit": "word", "derivation_level": 1})
  244. # Level 2 — search word_lemma (normalized lemma)
  245. >>> api.do({"action": "search", "query": "رحيم", "unit": "word", "derivation_level": 2})
  246. # Level 3 — search root (exact root value, e.g. "رحم")
  247. >>> api.do({"action": "search", "query": "رحم", "unit": "word", "derivation_level": 3})
  248. ```
  249. ##### Morphological Filtering (`search_by_word_linguistics`)
  250. Filter words by any combination of morphological properties using the `search_by_word_linguistics` action:
  251. ```python
  252. # Find all nouns from root قول
  253. >>> api.do({
  254. ... "action": "search_by_word_linguistics",
  255. ... "root": "قول",
  256. ... "type": "أسماء" # Arabic POS category name
  257. ... })
  258. # Find all active-voice past-tense verbs from root كتب
  259. >>> api.do({
  260. ... "action": "search_by_word_linguistics",
  261. ... "root": "كتب",
  262. ... "pos": "V",
  263. ... "voice": "مبني للمعلوم",
  264. ... "aspect": "فعل ماضي"
  265. ... })
  266. # Find all proper nouns
  267. >>> api.do({
  268. ... "action": "search_by_word_linguistics",
  269. ... "pos": "PN"
  270. ... })
  271. ```
  272. Available morphological filter fields include: `pos`, `type`, `root`, `lemma`, `stem`, `pattern`, `gender`, `number`, `person`, `voice`, `mood`, `state`, `case`, `form`, `aspect`, `derivation`, `special`, `prefix`, `suffix`, `segments`.
  273. Faceted search allows you to aggregate search results by fields:
  274. ```python
  275. >>> result = api.do({
  276. ... "action": "search",
  277. ... "query": u"الله",
  278. ... "facets": "sura_id,juz,chapter"
  279. ... })
  280. >>> print(result["search"]["facets"])
  281. ```
  282. Available facet fields:
  283. * `sura_id` - Sura (chapter) number (1-114)
  284. * `juz` - Juz (part) number (1-30)
  285. * `hizb` - Hizb (section) number
  286. * `chapter` - Main topic/chapter
  287. * `topic` - Subtopic
  288. * `sura_type` - Meccan/Medinan classification
  289. #### Filtering Results
  290. Filter search results by field values:
  291. ```python
  292. >>> api.do({
  293. ... "action": "search",
  294. ... "query": u"الله",
  295. ... "filter": {"sura_id": "2"} # Only from Sura Al-Baqarah
  296. ... })
  297. ```
  298. #### Search Fields
  299. Available fields for fielded search:
  300. * `سورة` (sura) - Sura name
  301. * `رقم_السورة` (sura_id) - Sura number
  302. * `رقم_الآية` (aya_id) - Verse number
  303. * `جزء` (juz) - Juz number
  304. * `حزب` (hizb) - Hizb number
  305. * `صفحة` (page) - Page number in Mushaf
  306. * `سجدة` (sajda) - Has prostration
  307. * `موضوع` (subject) - Subject/theme
  308. * `فصل` (chapter) - Chapter
  309. * `باب` (subtopic) - Subtopic
  310. * `نوع_السورة` (sura_type) - Sura type (Meccan/Medinan)
  311. Word-level fields (use with `unit="word"`):
  312. * `englishstate` - Nominal state in English (e.g. "Definite state", "Indefinite state")
  313. * `englishmood` - Verb mood in English (e.g. "Indicative mood", "Subjunctive mood", "Jussive mood")
  314. For the complete field list, call:
  315. ```python
  316. >>> api.do({"action": "show", "query": "fields"})
  317. ```
  318. #### Output Views
  319. Different views provide different levels of detail:
  320. * **minimal** - Basic verse text and identifier
  321. * **normal** - Verse text with essential metadata
  322. * **full** - All available information
  323. * **statistic** - Include statistical information
  324. * **linguistic** - Include linguistic analysis
  325. Example:
  326. ```python
  327. >>> api.do({
  328. ... "action": "search",
  329. ... "query": u"الله",
  330. ... "view": "full",
  331. ... "word_info": True,
  332. ... "aya_theme_info": True
  333. ... })
  334. ```
  335. #### Metadata Access
  336. Get various metadata using the "show" action:
  337. ```python
  338. # Get list of available translations
  339. >>> api.do({"action": "show", "query": "translations"})
  340. # Get list of recitations
  341. >>> api.do({"action": "show", "query": "recitations"})
  342. # Get Sura information
  343. >>> api.do({"action": "show", "query": "surates"})
  344. # Get search fields
  345. >>> api.do({"action": "show", "query": "fields"})
  346. # Get default values
  347. >>> api.do({"action": "show", "query": "defaults"})
  348. ```
  349. > **Note:** Lemmas are no longer exposed via `show`. Use `api.do({"action": "list_values", "field": "lemma"})` to retrieve them on demand.
  350. #### Adding New Translations
  351. You can extend the local search index with additional Zekr-compatible `.trans.zip` translation files using `index_translations()`. This requires the `alfanous_import` package (included in the repository under `src/alfanous_import/`).
  352. ```python
  353. import alfanous.api as alfanous
  354. # Index all .trans.zip files found in a folder
  355. count = alfanous.index_translations(source="/path/to/translations")
  356. print(f"{count} translation(s) newly indexed")
  357. ```
  358. The function:
  359. - Iterates over every `*.trans.zip` file in `source`
  360. - Skips translations that are already in the index (idempotent — safe to call repeatedly)
  361. - Returns the **count** of newly indexed translations (`0` means nothing new was added)
  362. - Automatically updates `configs/translations.json` so the new translations are immediately visible via `api.get_info("translations")` and searchable with `unit="translation"`
  363. After indexing, search in the new translation:
  364. ```python
  365. # Search in a newly indexed translation
  366. result = alfanous.search(u"الرحمن", unit="translation", flags={"translation": "en.newt"})
  367. ```
  368. See [`examples/index_translations_example.py`](examples/index_translations_example.py) for a complete walkthrough.
  369. ## Examples
  370. The [examples/](examples/) directory contains example scripts demonstrating various features:
  371. * **facet_search_examples.py** - Faceted search and filtering examples
  372. See [examples/README.md](examples/README.md) for more information.
  373. ## MCP Server
  374. Alfanous ships an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that lets AI assistants (Claude, Copilot, etc.) search and explore the Qur'an directly. See [alfanous_mcp/README.md](src/alfanous_mcp/README.md) for the full reference.
  375. Quick start:
  376. ```sh
  377. $ pip install alfanous3-mcp
  378. $ python -m alfanous_mcp.mcp_server # stdio – works with Claude Desktop
  379. ```
  380. To connect Claude Desktop, add the following to your `claude_desktop_config.json`:
  381. ```json
  382. {
  383. "mcpServers": {
  384. "alfanous": {
  385. "type": "stdio",
  386. "command": "python",
  387. "args": ["-m", "alfanous_mcp.mcp_server"],
  388. "tools": [
  389. "search_quran",
  390. "search_translations",
  391. "get_quran_info",
  392. "search_quran_by_themes",
  393. "search_quran_by_stats",
  394. "search_quran_by_position",
  395. "suggest_query",
  396. "correct_query",
  397. "search_by_word_linguistics",
  398. "list_field_values"
  399. ]
  400. }
  401. }
  402. }
  403. ```
  404. ## Web Interface
  405. Alfanous includes a FastAPI-based web service for RESTful access. See [alfanous_webapi/README.md](src/alfanous_webapi/README.md) for:
  406. * Installation and setup
  407. * API endpoints
  408. * Request/response examples
  409. * Interactive API documentation (Swagger UI)
  410. Quick start:
  411. ```sh
  412. $ pip install alfanous3 fastapi uvicorn
  413. $ cd src/
  414. $ uvicorn alfanous_webapi.web_api:app --reload
  415. ```
  416. Then visit http://localhost:8000/docs for interactive documentation.
  417. ## Contributing
  418. We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for:
  419. * Setting up a development environment
  420. * Building from source
  421. * Running tests
  422. * Submitting pull requests
  423. * Code style guidelines
  424. Quick development setup:
  425. ```sh
  426. # Clone the repository
  427. $ git clone https://github.com/Alfanous-team/alfanous.git
  428. $ cd alfanous
  429. # Install dependencies
  430. $ pip install pyparsing whoosh pystemmer pytest
  431. # Build indexes (required for development)
  432. $ make build
  433. # Run tests
  434. $ pytest -vv --rootdir=src/
  435. ```
  436. ## Support
  437. * **GitHub Issues**: https://github.com/Alfanous-team/alfanous/issues
  438. * **Mailing List**: alfanous@googlegroups.com
  439. * **Website**: http://alfanous.org
  440. ## License
  441. Alfanous is licensed under the **GNU Lesser General Public License v3 or later (LGPLv3+)**.
  442. See [LICENSE](LICENSE) for details.
  443. ## Credits
  444. * **Contributors**: See [AUTHORS.md](AUTHORS.md) and [THANKS.md](THANKS.md)
  445. This project handles sacred religious text (the Holy Qur'an) - please treat the data and code with respect.
  446. ## Legacy
  447. If you are looking for the legacy Alfanous code, you can find it under the `legacy` branch.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.