Get audio of a single verse or multiples verses from a Chapter of The Holy Quran
Project description
AyahSender
AyahSender is a Python package that allows you to fetch and merge audio of Quranic verses (ayahs) from various reciters. You can save these audio clips to your local directory for easy access and listening.
Features
- Fetch a single ayah audio.
- Merge multiple ayahs into a single audio file.
- Supports various reciters.
- Saves audio files in MP3 format.
Installation
Install the package via pip:
pip install ayah-sender
Requirements
requests
pydub
ffmpeg
- PyDub requiresffmpeg
to perform its operations.
Follow the articles to install ffmpeg on your system if you don't have it installed.
Usage
Basic Usage
Here is an example of how to use AyahSender:
from ayah_sender import AyahSender
ayahSender = AyahSender()
# Show available reciters
reciters_dict = ayahSender.reciter.show_reciters()
print(reciters_dict)
# Fetch a single ayah's audio
audio_data = ayahSender.get_single_ayah(reciter_id=1, chapter_num=1, verse_num=1)
# Save the single ayah audio
ayahSender.save_audio(audio_data, output_dir='.')
# Merge multiple ayahs' audio
merged_audio_data = ayahSender.merge_ayahs(reciter_id=5, chapter_num=1, start_verse=1, end_verse=5)
# Save the merged audio file
ayahSender.save_audio(merged_audio_data, output_dir='.')
Functions
get_total_verses_in_chapter(chapter_number)
Fetches the total number of verses in a given chapter.
get_single_ayah(reciter_id, chapter_num, verse_num)
Fetches a single ayah from a specified reciter, chapter, and verse.
merge_ayahs(reciter_id, chapter_num, start_verse, end_verse)
Fetches and merges a range of ayahs from a specified reciter and chapter.
save_audio(audio_data, output_dir=".")
Saves the audio data to the specified directory.
Reciters List
The reciters.csv
file contains the list of reciters. The Reciter
class reads this file to fetch reciter information.
Example
See examples folder for examples.
Contributing
Feel free to submit issues or pull requests. For major changes, please open an issue first to discuss what you would like to change.
License
Contact
For any queries, contact us at dev.asib@proton.me.
Acknowledgement
Jazahumullahu Khairan to them for the audio files.
Enjoy using AyahSender
for your Quranic audio needs!
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
Built Distribution
File details
Details for the file ayah_sender-0.1.5.tar.gz
.
File metadata
- Download URL: ayah_sender-0.1.5.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d224255fd2536be370ef028631b287fb782eba9079c5b0880a33274718912f3 |
|
MD5 | bc8f402ff61cc3057ed2c7807388a9d2 |
|
BLAKE2b-256 | 9ea3a4692123bd0abc009f6168c7499bf462a5e98f90665ceac155fe06c19198 |
File details
Details for the file ayah_sender-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: ayah_sender-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fb6a1e09ec611d3b7f74567b9298683ee1beb4bd579f64ad282be3d6e61f144 |
|
MD5 | f5ec00865f8df3a3584d877152deab9a |
|
BLAKE2b-256 | 63c51cc4a6b5de42bc80aae33ac603d3e6166bfe9a5d891943eb9ac4b2056ad6 |