Code Monkey home page Code Monkey logo

quran-wake-up's Introduction

fajrGPT


This Python Command-Line application assists in helping you wake up for Fajr prayer by providing automatically selected verses + explanations from the Quran after a set alarm time along with a soothing Islamic prayer fade-in and fade-out from Mishari bin Rashid Alafasy. The program uses the Quran Module to obtain Quran verses in English as well as OpenAI's API GPT models to produce corresponding Tafsir (explanation).

Features

  • Plays Alafsay's Quran recitation audio for user-selected Surah (default is Surah Al-Fathiha) from Tahfeem
  • Includes option to play Alafsay's Quranic recitation with its corresponding English translation obtained from The Chosen One
  • Plays the downloaded audio after a user-specified countdown time (i.e. 10s, 15m, 7h), with volume gradually fading in.
  • Option to select and display a Name of Allah and provide corresponding explanation of its meaning with the GPT API
  • Displays automatically selected verses from the Quran and provides corresponding explanations.
  • Depending on the length of the countdown, one, two, or three verses will be selected for display
  • After each explanation, the program waits for the user to press Enter before proceeding.
  • Once all explanations are provided, the audio volume gradually fades out over a 5-second period.

Usage

Installing FFmpeg

FFmpeg is a necessary dependency for this package in order to play audio mp3 files. Follow the instructions below based on your operating system:

Windows

Option 1: Using Conda (recommended for Conda users)

If you have Anaconda or Miniconda installed, you can install FFmpeg using the following command:

conda install -c conda-forge ffmpeg
Option 2: Manual Installation
  1. Go to the FFmpeg official download page and download the Windows version.
  2. Extract the ZIP archive.
  3. Add the path to the bin directory (where ffmpeg.exe is located) to your system's PATH variable.

macOS

Using Homebrew (recommended):

brew install ffmpeg

Or follow the manual installation process similar to Windows by downloading from the FFmpeg official site.

Linux (e.g., Ubuntu)

Using the package manager:

sudo apt install ffmpeg

For other Linux distributions, adjust the command according to your package manager.

CLI Installation with PyPI Distribution

  1. Clone repo and install packages (for developers):
    git clone https://github.com/malekinho8/quran-wake-up.git
    pip install -r requirements.txt
    pip install .
  2. Alternatively, install one dependency manually and fajrGPT through PyPI:
    pip install git+https://github.com/malekinho8/quran-module.git fajrGPT
  3. Run the main.py script, passing the required parameters:
    fajrGPT --countdown-time <Seconds, Minutes, or Hours until Alarm> --surah <Which Surah (number) to play for the alarm, default is 1>

Required Parameters

  • --countdown-time: The amount of time

Dependencies

  • Python 3.x
  • click
  • pygame
  • pydub
  • moviepy
  • openai
  • scipy
  • mutagen
  • TheQuranModule

Notes

  • The OpenAI API key must be set in an environment variable named OPENAI_API_KEY. See instructions here for more details.

License

MIT

quran-wake-up's People

Contributors

malekinho8 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

quran-wake-up's Issues

Needs LangChain Integration for Future Experimental Features

Hi, @malekinho8! I'm really appreciative of the work your doing, and I think that this Project has good potential if you explore LangChain. Especially with chromadb that allows you to query large documents without running out of context. I believe that using this you can implement Open Source LLM's into the system very easily like GPT4ALL. Allowing you to run this Offline without changing your code base.

Some Future Features I'd Expect

  • Querying about a Topic from a Specific Book of Hadith using ChromaDB and LangChain with a Large Language Model like GPT-4 or MPT-7B.

  • Creating our Own Islamic Research ChromaDB Database, by scraping researchgate.net and SSRN, allowing users / researchers to use the contextual power of GPT-4 to quickly get references and viewpoints of scholars.

As you see I think this could be a potential avenue for exploration. I'm quite familiar with the above since I've used the stated technologies for some corporate clients in Production Environments, so you can keep me in the loop and ask any question you have.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.