Skip to main content

Production-ready Python CLI application for playing Ayatul Kursi audio in the background

Project description

Ayatul Kursi Background Player CLI

A production-ready Python CLI application that continuously plays Ayatul Kursi audio in the background with various playback modes and options.


Features

  • ๐ŸŽต Infinite Loop Playback: Play Ayatul Kursi continuously forever
  • โฑ๏ธ Timed Playback: Specify duration in minutes or hours
  • ๐Ÿคซ Whisper Mode: Low-volume mode (10%) for background recitation
  • ๐Ÿ”Š Volume Control: Customize volume from 0.0 to 1.0
  • ๐Ÿ–ฅ๏ธ Background Playback: Runs in the background without blocking the terminal
  • ๐Ÿ”„ Smooth Transitions: Seamless looping between audio repetitions
  • ๐Ÿ›‘ Graceful Shutdown: Clean exit with Ctrl+C
  • ๐ŸŒ Cross-Platform: Works on Windows, Linux, and macOS
  • ๐Ÿ“ Detailed Logging: Optional debug logging for troubleshooting
  • ๐ŸŽจ User-Friendly Output: Clear messages and status information

๐Ÿ“‹ Requirements

  • Python 3.10 or higher
  • pygame (for audio playback)
  • click (for CLI interface)

๐Ÿš€ Installation

Method 1: Install from PyPI (Recommended - Coming Soon)

pip install ayatulkursi

Method 2: Install from Source

  1. Clone the repository:
git clone https://github.com/yourusername/ayatulkursi.git
cd ayatulkursi
  1. Install the package in development mode:
pip install -r requirements.txt
pip install -e .
  1. Verify installation:
ayatulkursi --help

Method 3: Local Setup

  1. Navigate to the project directory
  2. Install dependencies:
pip install -r requirements.txt
  1. Create symbolic link or alias for easy access:
# On Windows
python -m ayatulkursi.cli --help

# Or add to PATH and run directly
ayatulkursi --help

๐Ÿ“– Usage

Basic Usage

Infinite Playback (Default)

Play Ayatul Kursi continuously forever:

ayatulkursi

Output:

============================================================
  ๐ŸŽต Ayatul Kursi - Background Audio Player
============================================================

๐Ÿ“‹ Mode: Normal Mode - Volume: 70% - Duration: Infinite
๐ŸŽต Audio: /path/to/audio/ayatul-kursi-saad-al-ghamdi.mp3

๐Ÿ’ก Press Ctrl+C to stop playback

โœ“ Playback started in background

Timed Playback

Play for 30 minutes:

ayatulkursi --minutes 30

Play for 2 hours:

ayatulkursi --hours 2

Play for 1 hour and 30 minutes:

ayatulkursi --hours 1 --minutes 30

Output:

============================================================
  ๐ŸŽต Ayatul Kursi - Background Audio Player
============================================================

๐Ÿ“‹ Mode: Normal Mode - Volume: 70% - Duration: 30m
๐ŸŽต Audio: /path/to/audio/ayatul-kursi-saad-al-ghamdi.mp3

๐Ÿ’ก Press Ctrl+C to stop playback

โœ“ Playback started in background

Advanced Options

Whisper Mode

Low-volume mode perfect for continuous background recitation:

# Infinite whisper mode
ayatulkursi --whisper

# Whisper mode for 8 hours
ayatulkursi --whisper --hours 8

# Whisper mode for 2 hours
ayatulkursi --whisper --hours 2

Output:

============================================================
  ๐ŸŽต Ayatul Kursi - Background Audio Player
============================================================

๐Ÿ“‹ Mode: Whisper Mode - Volume: 10% - Duration: 8h 0m
๐ŸŽต Audio: /path/to/audio/ayatul-kursi-saad-al-ghamdi.mp3

๐Ÿ’ก Press Ctrl+C to stop playback

๐Ÿคซ Whisper mode activated - playing at low volume
โœ“ Playback started in background

Custom Volume

Set volume between 0.0 (silent) and 1.0 (maximum):

# Very low volume (30%)
ayatulkursi --volume 0.3

# Medium volume (50%)
ayatulkursi --volume 0.5

# High volume (90%)
ayatulkursi --volume 0.9

# With duration
ayatulkursi --volume 0.4 --hours 2

Output:

============================================================
  ๐ŸŽต Ayatul Kursi - Background Audio Player
============================================================

๐Ÿ“‹ Mode: Normal Mode - Volume: 30% - Duration: Infinite
๐ŸŽต Audio: /path/to/audio/ayatul-kursi-saad-al-ghamdi.mp3

๐Ÿ’ก Press Ctrl+C to stop playback

โœ“ Playback started in background

Custom Audio File

Use a different audio file:

ayatulkursi --audio-file /path/to/custom/audio.mp3

Debug Mode

Enable detailed logging for troubleshooting:

ayatulkursi --debug

Command-Line Options

Options:
  --minutes INTEGER           Play for specified number of minutes
  --hours INTEGER             Play for specified number of hours
  --whisper                   Enable whisper mode (volume 10%)
  --volume FLOAT              Set volume level (0.0-1.0), default is 0.7
  --audio-file TEXT           Path to audio file (uses default if not provided)
  --debug                     Enable debug logging
  --help                      Show this message and exit

๐ŸŽฏ Use Cases

1. Daily Recitation Routine

# Play for 15 minutes in the morning
ayatulkursi --minutes 15

2. All-Day Background Recitation

# Play continuously with whisper mode
ayatulkursi --whisper

3. Work/Study Sessions

# Play quietly during work
ayatulkursi --volume 0.3 --whisper --hours 8

4. Night-Time Listening

# Low volume for 6 hours before sleep
ayatulkursi --whisper --hours 6

5. Prayer Time Sessions

# Dedicated recitation for 1 hour
ayatulkursi --hours 1 --volume 0.8

๐Ÿคซ Understanding Whisper Mode

Whisper Mode is a special feature designed for continuous, non-intrusive playback:

  • Volume: Automatically set to 10% (very low)
  • Duration: Can be infinite or limited (use --hours and --minutes)
  • Purpose: Background recitation while working, studying, or relaxing
  • Example: ayatulkursi --whisper --hours 8

Why Use Whisper Mode?

  • โœ… Minimizes distraction while maintaining presence
  • โœ… Ideal for work/study environments
  • โœ… Comfortable for extended listening
  • โœ… Respectful volume for shared spaces

๐Ÿ”ง Troubleshooting

Issue: "Audio file not found"

Solution: Ensure the audio file ayatul-kursi-saad-al-ghamdi.mp3 is located in the assets/ directory relative to the installation.

# Check audio file location
ls ayatulkursi/assets/
# Should show: ayatul-kursi-saad-al-ghamdi.mp3

Issue: "pygame not found" or "ModuleNotFoundError"

Solution: Install required dependencies:

pip install -r requirements.txt

Issue: Audio cuts off or has crackling

Solution:

  • Try adjusting volume: --volume 0.6
  • Check system audio settings
  • Ensure no other applications are using audio
  • Update pygame: pip install --upgrade pygame

Issue: Command not found after installation

Solution:

  • Reinstall the package: pip install -e .
  • Or run with Python module: python -m ayatulkursi.cli
  • Ensure ~/.local/bin is in your PATH (Linux/macOS)

Issue: Graceful shutdown not working

Solution:

  • Press Ctrl+C (may need to press twice)
  • On Windows, you can also close the terminal window
  • Check if debug mode provides more information: --debug

Getting Help

Enable debug mode to see detailed logs:

ayatulkursi --debug

๐Ÿ“ฆ Project Structure

ayatulkursi/
โ”œโ”€โ”€ ayatulkursi/
โ”‚   โ”œโ”€โ”€ __init__.py           # Package initialization
โ”‚   โ”œโ”€โ”€ cli.py                # Command-line interface
โ”‚   โ”œโ”€โ”€ player.py             # Audio player logic
โ”‚   โ””โ”€โ”€ config.py             # Configuration management
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ ayatul-kursi-saad-al-ghamdi.mp3  # Audio file
โ”œโ”€โ”€ README.md                 # This file
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ pyproject.toml            # Project configuration
โ””โ”€โ”€ LICENSE                   # MIT License

๐Ÿ› ๏ธ Development

Setting up Development Environment

  1. Clone the repository:
git clone https://github.com/yourusername/ayatulkursi.git
cd ayatulkursi
  1. Install in development mode with dev dependencies:
pip install -r requirements.txt
pip install -e ".[dev]"
  1. Run tests:
pytest
  1. Run linting:
black ayatulkursi/
flake8 ayatulkursi/
mypy ayatulkursi/
isort ayatulkursi/

Code Style

  • Uses Black for code formatting
  • PEP 8 compliant
  • Type hints throughout
  • Comprehensive docstrings

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Built with pygame for audio playback
  • CLI powered by click
  • Ayatul Kursi recitation by Saad Al-Ghamdi

๐Ÿ“ž Support & Feedback


๐ŸŽ“ Learn More

What is Ayatul Kursi?

Ayatul Kursi (Verse of the Throne) is the 255th verse of Surah Al-Baqarah (Chapter 2) in the Quran. It is considered one of the most powerful and important verses in Islam.

This application allows you to continuously listen to beautiful recitations of this verse in the background.

Recommended Listening Times

  • Morning: 10-15 minutes after Fajr prayer
  • Throughout the day: Use whisper mode while working
  • Before sleep: 1-2 hours in whisper mode
  • During stress: 30+ minutes at any comfortable volume

Made with โค๏ธ for spiritual wellness

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ayatulkursi-1.0.0.tar.gz (869.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ayatulkursi-1.0.0-py3-none-any.whl (865.4 kB view details)

Uploaded Python 3

File details

Details for the file ayatulkursi-1.0.0.tar.gz.

File metadata

  • Download URL: ayatulkursi-1.0.0.tar.gz
  • Upload date:
  • Size: 869.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ayatulkursi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 429d2cfd84fdefdbb7a8a8c0e1400a2c86cd797b5d6d77c8cb233572adb9311f
MD5 8766e9fed0b0ee881251647542aa4eab
BLAKE2b-256 9f1d3b6d97cb894d482ee635f9e09ff78a6ba76b685c42956a5efd6398e9883e

See more details on using hashes here.

File details

Details for the file ayatulkursi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ayatulkursi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 865.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ayatulkursi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 103add598e5b45b3d311307358d6f881aa188eb33dcb59988a3f0cf4b4108cc8
MD5 5b815dd8635a5fa1943e86c6b3b81c6d
BLAKE2b-256 cf9cf8c930e6f16e43616a6b9d62295826a222fcd8531210c6eadd7badf7d11a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page