Metadata-Version: 2.5
Name: fiqhboard
Version: 0.0.2
Summary: Comparative fiqh of the four Sunni schools: side-by-side matrices, every ruling with its source and evidence, a glossary and decision diagrams
Project-URL: Homepage, https://github.com/bayramkotan/fiqhboard
Project-URL: Repository, https://github.com/bayramkotan/fiqhboard
Project-URL: Issues, https://github.com/bayramkotan/fiqhboard/issues
Author: Bayram Kotan
License-Expression: MIT
License-File: LICENSE
Keywords: fiqh,hanafi,hanbali,islamic law,islamic studies,madhhab,maliki,shafii
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: Arabic
Classifier: Natural Language :: English
Classifier: Natural Language :: Turkish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Education
Classifier: Topic :: Religion
Requires-Python: >=3.10
Requires-Dist: pyside6>=6.6
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/icon.png" width="96" alt="fiqhboard">
</p>

<h1 align="center">fiqhboard &nbsp;<sub>الفقه المقارن</sub></h1>

<p align="center">
  <strong>Comparative fiqh of the four Sunni schools</strong><br>
  <sub>Hanafi, Maliki, Shafi'i and Hanbali side by side — every position in its school's own words, with its source and its evidence</sub>
</p>

<p align="center">
  <a href="https://pypi.org/project/fiqhboard/">
    <img src="https://img.shields.io/badge/PyPI-v0.0.2-1D4777?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI">
  </a>
  <img src="https://img.shields.io/badge/Python-3.10%2B-A47E24?style=for-the-badge&logo=python&logoColor=white" alt="Python">
  <img src="https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-5B6878?style=for-the-badge" alt="Platform">
  <a href="https://www.npmjs.com/package/fiqhboard">
    <img src="https://img.shields.io/badge/npm-v0.0.2-14304F?style=for-the-badge&logo=npm" alt="npm">
  </a>
  <img src="https://img.shields.io/badge/License-MIT-D6B25E?style=for-the-badge" alt="License">
</p>

<p align="center">
  <a href="#-why-fiqhboard">Why</a> •
  <a href="#%EF%B8%8F-the-window">The window</a> •
  <a href="#-how-a-row-is-built">How a row is built</a> •
  <a href="#-install">Install</a> •
  <a href="#%EF%B8%8F-command-line">Command line</a> •
  <a href="#-roadmap">Roadmap</a> •
  <a href="#-license">License</a>
</p>

<p align="center">
  <img src="https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/matrix-light.png" alt="The obligatory acts of wudu: one question per row, the four schools in the columns, the evidence drawer on the right">
</p>

> **Pre-alpha (0.0.2).** The window works end to end — a start page with the comparison in numbers, the matrix with its evidence drawer, comparing two schools, decision diagrams, search, saved questions with notes, export to PDF, PNG and Markdown, the glossary and the sources; the interface and the content in English, Turkish and Arabic; portable applications for Windows, Linux and macOS — on **pilot data**: five topics of purity and the prostration of forgetfulness, every cell marked *draft*. The works are named; the volume and page of each position are still to be checked. Do not cite it yet.

---

## 💡 Why fiqhboard

Comparing the four schools usually means reading four books, each in its own vocabulary. fiqhboard puts them in one table — without flattening them into one vocabulary:

- **One question per row.** A row does not ask "is it fard?"; it asks something every school can answer, such as *"Is wudu valid without an intention?"* The colours and the agree / differ filter come from that answer.
- **Each school in its own terms.** The Hanafi *wājib* is not the Shafi'i *wājib*; a Hanbali *sharṭ* is not a *farḍ*. Every cell shows the school's own term, in Arabic and in transliteration, and no term is mapped onto another school's.
- **The relied-upon view, and the others.** A cell shows the school's relied-upon position, named the way the school names it — *al-muftā bihi*, *al-mashhūr*, *al-aṣaḥḥ*, *al-madhhab* — and marks the other views held within the school.
- **Nothing without a source.** Every position names the book, volume and page it comes from; every piece of evidence — verse, hadith, principle — is cited.
- **Agreement of the four is not ijmāʿ.** When the four schools agree, fiqhboard says *the four agree*. Ijmāʿ is shown only where a source claims it, attributed to that source.
- **For learning, not fatwa.** For your own situation, ask a qualified scholar.

## 🖥️ The window

<p align="center">
  <img src="https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/home.png" alt="The start page: the topics as cards, how often two schools give the same answer, which school stands alone">
</p>

| | |
|---|---|
| ![Comparing two schools](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/matrix-compare.png) | ![The same matrix in Arabic, right to left](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/matrix-arabic.png) |
| **Compare two schools.** Choose a pair — Maliki ↔ Hanbali here — and the other two fade; *same answer / different* is then about the pair. A scale (how much of the sock is wiped) is shaded light to deep. | **Arabic, right to left.** The interface and the content each in English, Turkish or Arabic; in Arabic the whole window turns right to left, set in Amiri. |
| ![Turkish, Paper theme](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/matrix-turkish.png) | ![Lapis Night](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/matrix-dark.png) |
| **Turkish, Paper theme.** Seven themes — Lapis, Lapis Night, Paper, Slate, Emerald, Midnight, High Contrast — or follow the system. | **Lapis Night.** Each answer has its own colour, so the eye sees who stands with whom; the words are always written too. |
| ![Search](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/search.png) | ![Saved questions](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/saved.png) |
| ![The prostration of forgetfulness, school by school](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/diagram.png) | ![The diagram in Arabic, right to left](https://raw.githubusercontent.com/bayramkotan/fiqhboard/main/assets/screenshots/diagram-arabic.png) |
| **Decision diagrams.** The prostration of forgetfulness as four trees, one per school, each asking in its own terms; the rulings coloured by what they ask for — before or after the salam, make it up, pray again. | **The same, in Arabic**: the trees grow from the right. Ctrl + wheel zooms, *Fit* shows the whole. |
| **Search** everything at once: questions, topics, terms, evidence, books. Arabic diacritics and letter forms are ignored (النية finds النِّيَّة), and so are case and accents (wajib finds wājib). | **Saved questions** with your own notes: the star on a row, or <kbd>Ctrl</kbd> <kbd>D</kbd>. |

- **The start page** — the topics as cards with their share of agreement, the totals, a 4 × 4 grid of how often two schools give the same answer, and which school stands alone how often.
- **The matrix** — one row per question, the four schools in the columns; *Show: All · Four agree · Differ*; *Compare:* all four or any two. <kbd>↑</kbd> <kbd>↓</kbd> move between rows, <kbd>Esc</kbd> closes one.
- **The evidence drawer** — each school's answer, its own term, its basis, its note, its other views and its source; the verses and hadith in Arabic with a translation, each hadith one click from [isnady.net](https://isnady.net) with its chains and narrators; the terms of the row, each with what it means in each school. **Copy** puts the whole row on the clipboard with its sources.
- **Decision diagrams** — one tree per school, the answers on the branches, the rulings coloured by what they ask for; for learning how each school reasons, never a fatwa.
- **Export** a topic or a question as PDF (Arabic joined and right to left, as on the screen), PNG, Markdown or HTML — each with the list of its sources.
- **Terms explained where they are read** — hover over a school's term in a cell for its definition and what it means in that school.
- **The glossary** — rulings, concepts, method and ranks (qiyās, istiḥsān, maṣlaḥa, ʿurf, istiṣḥāb, the schools' names for their relied-upon views…): each term's root, its general definition, its sense in each school, and the terms related to it. **The sources** — the works by school, with the author's death year, and every row that cites each work, one click away.
- **Back and forward** through everything visited (<kbd>Alt</kbd> <kbd>←</kbd> / <kbd>Alt</kbd> <kbd>→</kbd>), search with <kbd>Ctrl</kbd> <kbd>K</kbd>, the pages with <kbd>Ctrl</kbd> <kbd>1</kbd>–<kbd>6</kbd>, all shortcuts with <kbd>F1</kbd>. **Help → Check the installation** shows every copy of fiqhboard on the computer (as `fqb doctor`).

## 🧩 How a row is built

```text
topic        Purity › Wudu › The obligatory acts of wudu
question     Is wudu valid without an intention?
answers      valid · invalid
             ┌───────────────┬───────────────┬───────────────┬───────────────┐
             │ Hanafi        │ Maliki        │ Shafi'i       │ Hanbali       │
             ├───────────────┼───────────────┼───────────────┼───────────────┤
answer       │ valid         │ invalid       │ invalid       │ invalid       │
own term     │ sunna  سنة    │ farḍ  فرض     │ farḍ  فرض     │ sharṭ  شرط    │
basis        │ al-muftā bihi │ al-mashhūr    │ al-aṣaḥḥ      │ al-madhhab    │
source       │ al-Qudūrī     │ Khalīl        │ al-Nawawī     │ al-Buhūtī     │
             └───────────────┴───────────────┴───────────────┴───────────────┘
evidence     al-Bukhari 1  ·  Qur'an 5:6
```

### The data, and its validator

The data is a folder of JSON files — the shape the `fiqhboard-data` repository will have:

```text
catalog.json                    format, status, the four schools, the bases, the list of topics
works.json                      the books positions are taken from (author, death year)
evidence.json                   verses, hadith, reports, principles — in Arabic, with a translation
terms/general.json              every term: transliteration, Arabic, kind, a general definition
terms/hanafi.json … hanbali.json  the terms each school uses, each with that school's own definition
topics/taharah/wudu.obligatory.json   a topic: its questions and the four positions of each
diagrams/sahw.json              a decision diagram: one tree per school
```

`fqb validate` checks a folder before anything reads it, and the window and the command line do not load data that fails. It refuses a position whose answer is not one of the question's answers, a term that is not in **its own school's** dictionary, another school's basis, a position without a source, a *reviewed* position without a page, an unknown work or piece of evidence, a misspelt key. It warns when a row is not phrased as a question, and when a note mentions ijmāʿ — which fiqhboard gives only attributed to the source that claims it.

```text
$ fqb validate
  5 topics, 28 questions, 112 positions, 29 terms, 11 works, 14 pieces of evidence, 1 diagram
  0 error(s), 0 warning(s): the data loads
```

A question whose answers form a scale (*any part · a quarter · the whole head*) is marked `ordered` and shaded in one hue, light to deep; other answers each get their own colour. Hadith evidence uses the same references as [isnady](https://github.com/bayramkotan/isnady).

## 📦 Install

```bash
pip install fiqhboard
fqb
```

On Linux distributions that protect the system Python (Arch, CachyOS, Debian, Ubuntu), use `pipx install fiqhboard`, a virtual environment, or add `--break-system-packages`. `fqb update` brings every installed copy up to date where it is; `fqb doctor` lists them.

**Portable applications** — nothing to install — are on the [latest release](https://github.com/bayramkotan/fiqhboard/releases/latest): `fiqhboard-…-windows-portable.exe`, `fiqhboard-…-linux-x86_64.AppImage`, `fiqhboard-…-macos-arm64.zip` and `…-macos-x86_64.zip`. A folder named `fiqhboard-portable` beside the file keeps the settings and saved questions there.

## ⌨️ Command line

Everything the window shows, the command line shows too — from the same core, without loading Qt, so it runs over SSH and in scripts.

| Command | What it does |
|---|---|
| `fqb` | Opens the window (`fiqhboard-gui`: the window without a console on Windows) |
| `fqb topics` | The topics and their questions; `=` the four agree, `≠` they differ |
| `fqb topic wudu.obligatory` | A topic as a table: the answer, the own term and the basis of each school |
| `fqb topic wudu.obligatory --differ` | Only the rows where the schools differ (`--agree`: only where they agree) |
| `fqb topic wudu.obligatory niyya` | One question in full: notes, other views, sources, evidence |
| `fqb term wajib` | Glossary terms (all of them without a word) |
| `fqb sources` | The works the positions come from |
| `fqb search النية` | Search questions, topics, terms, evidence and works (`--kind term`, …) |
| `fqb stats` | How often two schools give the same answer; who stands alone; each topic |
| `fqb diagram sahw --school maliki` | A decision diagram as a tree (all four schools without `--school`) |
| `fqb export khuff.wiping -f pdf` | A topic (or one question) as Markdown, HTML, PDF or PNG (`-o FILE`, `-o -` for the screen) |
| `fqb bookmark add wudu.obligatory niyya --note "…"` | Saved questions: `list`, `add`, `remove`, `note`, `export FILE`, `import FILE` — the window's star |
| `fqb validate [FOLDER]` | Check a data folder (without one: the data in use); exit code 1 on an error |
| `fqb db build -o fiqhboard.db` | The data as one SQLite file with a full-text index (`info`, `search`) |
| `fqb config data.folder ~/fiqhboard-data` | Read the data from another folder (`default` for the bundled data) |
| `fqb config view.ui_language tr` | Show or change a setting (`view.theme`, `view.text_scale`, `view.ui_language`, `content.language`, `data.folder`) |
| `fqb doctor` · `fqb update` | Every installed copy and which command starts which · bring each up to date where it is |
| `fqb -V` | The version (`-v`, `-V`, `--version`, `version`) |

`--lang en|tr|ar` chooses the content language and `--json` gives machine-readable output, for every data command. `fiqhboard` is the long name of `fqb`.

```text
$ fqb topic wudu.obligatory niyya
niyya: Is wudu valid without an intention?   (they differ)
  Hanafi   valid                   sunna سنة         al-muftā bihi
  Maliki   invalid                 farḍ فرض          al-mashhūr
  Shafi'i  invalid                 farḍ فرض          al-aṣaḥḥ
  Hanbali  invalid                 sharṭ شرط         al-madhhab
```

## 🗺️ Roadmap

- [x] **0.0.1** — the name, the package, a welcome window
- [x] The interface on pilot data: the matrix, the evidence drawer, the glossary, the sources, themes, English / Turkish / Arabic content, the command line
- [x] The data format and its validator (`fqb validate`), each school with its own term dictionary
- [x] The start page, comparing two schools, search, saved questions, export to PDF / Markdown / HTML, the interface in English, Turkish and Arabic; four topics of purity
- [x] **0.0.2** — decision diagrams (the prostration of forgetfulness), portable applications, tayammum, the method terms, export to PNG, another data folder, the SQLite file, `fqb doctor` / `update`
- [ ] The data repository (`tools/build_data_repo.py` writes it); every cell sourced to volume and page
- [ ] Purity (*ṭahāra*) and prayer (*ṣalāt*) in full; more decision diagrams

## 📄 License

The application is released under the [MIT License](https://github.com/bayramkotan/fiqhboard/blob/main/LICENSE). The bundled Amiri typeface is under the SIL Open Font License. Quoted works keep their own licences; modern works under copyright are cited, never reproduced.
