Skip to main content

 sunnah

One command. Every major Hadith collection.
Interactive package manager for the entire Sunnah ecosystem — npm + PyPI.


   

 


🌙 What is Sunnah?

sunnah is an interactive CLI package manager for the major hadith collections of Islam. Install, manage, and update every book in the Sunnah ecosystem from a single terminal command — for both npm (Node.js/React) and pip (Python).

npm install -g sunnah   # Node.js CLI
pip install sunnah      # Python CLI
sunnah                  # open interactive TUI

📦 Available Packages

Book npm pip Hadiths CLI
Sahih al-Bukhari sahih-al-bukhari sahih-al-bukhari 7,563 bukhari
Sahih Muslim sahih-muslim sahih-muslim 7,470 muslim
Sunan Abi Dawud sunan-abi-dawud sunan-abi-dawud 5,274 dawud
Jami al-Tirmidhi jami-al-tirmidhi jami-al-tirmidhi 3,956 tirmidhi
Sunan Ibn Majah sunan-ibn-majah sunan-ibn-majah 4,341 majah
Sunan al-Nasa'i sunan-al-nasai sunan-al-nasai 5,768 nasai

🚀 Installation

# JavaScript / Node.js
npm install -g sunnah

# Python
pip install sunnah

🖥️ Interactive TUI

sunnah

Opens a full-screen terminal UI. Navigate with ↑↓, toggle with space, press enter to install.

════════════════════════════════════════════════════════════
  📿 Sunnah Package Manager  v1.5.0
  ↑↓ nav  space select  a all  i info  u uninstall  U update  enter install  q quit
════════════════════════════════════════════════════════════

  ▶ [✓]  Sahih al-Bukhari   ● npm  (up to date)
         Imam Muhammad ibn Ismail al-Bukhari
         Most authentic hadith collection, second only to the Quran.
         Hadiths: 7,563   CLI: bukhari --help   npm: sahih-al-bukhari   pip: sahih-al-bukhari

    [ ]  Sahih Muslim        ○ not installed
    [ ]  Sunan Abi Dawud     ○ not installed
    ...

Keyboard Controls

Key Action
↑ ↓ Navigate
space Toggle select
a Select all / deselect all
i Show package info
u Uninstall selected
U Update selected
enter Install selected
q Quit

⚡ Commands

npm packages

sunnah list                          # all packages + npm/pip status
sunnah install bukhari               # npm install -g sahih-al-bukhari
sunnah install bukhari nasai majah   # install multiple at once
sunnah uninstall dawud               # uninstall
sunnah update                        # check for updates
sunnah update --install              # auto-install all updates

Python (pip) packages

sunnah pip install bukhari           # pip install sahih-al-bukhari
sunnah pip install bukhari nasai     # install multiple
sunnah pip uninstall dawud           # uninstall
sunnah pip list                      # show Python package status
sunnah pip update                    # check for pip updates
sunnah pip update --install          # auto-install pip updates

🔍 NEW: Cross-book search

sunnah search "prayer"               # search all installed books (top 3 each)
sunnah search "fasting" --all        # show all results

🎲 NEW: Random hadith

sunnah random                        # random hadith from a random installed book
sunnah random bukhari                # random hadith specifically from Bukhari

ℹ️ NEW: Book info

sunnah info nasai                    # detailed info: versions, CLI, Python import
sunnah info jami-al-tirmidhi         # works with full npm name too

⚛️ React hook generator

sunnah --react                       # generate useSunnah() for all installed books
sunnah --react bukhari muslim        # specific books only

🐍 Python API

After pip install sunnah, you also get the individual book packages:

sunnah pip install bukhari muslim nasai
from sahih_al_bukhari import Bukhari
from sahih_muslim      import Muslim
from sunan_al_nasai    import Nasai

bukhari = Bukhari()
bukhari.get(1)
bukhari.search("prayer", limit=5)
bukhari.getRandom()
bukhari.getByChapter(1)

🟨 JavaScript / Node.js

sunnah install bukhari muslim
import bukhari from 'sahih-al-bukhari';
import muslim  from 'sahih-muslim';

bukhari.get(1).english.text
muslim.search('prayer', 5)

📊 Version Stats

sunnah --version
────────────────────────────────────────────────────────────
  📿 sunnah  v1.5.0
────────────────────────────────────────────────────────────
  Available  : 6
  npm inst.  : 4 / 6
  pip inst.  : 3 / 6
  Collection : Sahih al-Bukhari, Sahih Muslim, Sunan al-Nasa'i, Jami al-Tirmidhi
  Hadiths    : 24,257

🗂️ Monorepo Structure

sunnah/
├── bin/index.js              ← npm CLI (interactive TUI + all commands)
├── python/sunnah_cli/        ← Python CLI (mirrors npm CLI exactly)
│   ├── __init__.py
│   ├── cli.py                ← main Python CLI entry
│   ├── packages.py           ← package registry (single source of truth)
│   ├── npm_utils.py          ← npm helpers
│   └── pip_utils.py          ← pip helpers
├── package.json
├── pyproject.toml
└── .github/workflows/        ← auto-publish to npm + PyPI on release

📄 License

GNU Affero General Public License v3.0 (AGPL-3.0)


Made with ❤️ for the Muslim community · Seeking knowledge together

Stars

📦 npm • 🐍 PyPI • 🐛 Issues

Metadata

Release files for sunnah 1.5.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 sunnah 1.5.0
File Size Uploaded
sunnah-1.5.0.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sunnah 1.5.0
File Interpreter ABI Platform
sunnah-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.8 kB

Release files / sunnah-1.5.0.tar.gz

Download URL sunnah-1.5.0.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
afa2ea5655d008a27145f50a624d6e91d7215b36844e135d5b50f6d02a9479f2
BLAKE2b-256 checksum
How to use checksums
fb3d931c6c01929bbcb84b6b62be415b642a19d1f2baa62dd3429988615a42f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / sunnah-1.5.0-py3-none-any.whl

Download URL sunnah-1.5.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a8dee38a8832b0dda20b2bde5c3258f2422c4efd428221a93eaadf542ad735b
BLAKE2b-256 checksum
How to use checksums
fd3ed2783df67f93b18a1173ad5a7f453810d02d2b77f45d176e3114266bc255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

1.5.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