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
- Clone the repository:
git clone https://github.com/nawaz0x1/ayatulkursi.git
cd ayatulkursi
- Install the package in development mode:
pip install -r requirements.txt
pip install -e .
- Verify installation:
ayatulkursi --help
Method 3: Local Setup
- Navigate to the project directory
- Install dependencies:
pip install -r requirements.txt
- 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
--hoursand--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/binis 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
- Clone the repository:
git clone https://github.com/nawaz0x1/ayatulkursi.git
cd ayatulkursi
- Install in development mode with dev dependencies:
pip install -r requirements.txt
pip install -e ".[dev]"
- Run tests:
pytest
- 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
๐ Support & Feedback
- ๐ Report bugs: GitHub Issues
- ๐ก Suggest features: GitHub Discussions
- ๐ง Contact: nawazhaider60@example.com
๐ 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ayatulkursi-1.0.3.tar.gz.
File metadata
- Download URL: ayatulkursi-1.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88d1b6b973b2215940a6a9e57e9753bb26816bb9b99b0484fcedc2ce3ab1d8f4
|
|
| MD5 |
fc08c4510ec6dd489113e0e1283ea576
|
|
| BLAKE2b-256 |
0ae51cd0400c01538e7b0d44a54cbcc7debf0064be30bb10d30882ef08f3d25b
|
File details
Details for the file ayatulkursi-1.0.3-py3-none-any.whl.
File metadata
- Download URL: ayatulkursi-1.0.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da40b860d1a79172550cfa9dbd6397877e16c5ebeee641cb3c2367b3c784d419
|
|
| MD5 |
68fcbb963172aaca7920a11ff26916e3
|
|
| BLAKE2b-256 |
5e89a056546e6a52872d880d3d18ea119593bbc729b8add31836c698733645c9
|