Welcome to this project aimed at facilitating the learning of the Quran using Anki flashcards. This project automatically generates Anki decks for each Surah (chapter) of the Quran, enabling a structured and efficient learning experience.
- About the Project
- Features
- Prerequisites
- Installation
- Usage
- Card Structure
- Customization
- Contributing
- License
- Acknowledgments
This project was created to offer an effective method for learning the Quran by leveraging Anki's spaced repetition system. The generated decks allow users to learn each Surah by focusing on the progressive assimilation of verses (ayahs).
- Automatic generation of Anki decks (
.apkg
) for all 114 Surahs of the Quran. - Each deck is named according to the Surah's number and name for easy organization.
- Cards are designed to help memorize verses by providing context from previous verses.
- Text is in Arabic with proper formatting for correct display in Anki.
- Provided Python scripts allow for customized deck generation.
- Python 3.6 or higher
- Python Libraries:
requests
genanki
- Anki installed on your computer to import and use the decks.
-
Clone the Repository
git clone https://github.com/your_username/quran-anki-decks.git cd quran-anki-decks
-
Install Python Dependencies
Ensure you have Python 3.6 or higher installed.
pip install -r requirements.txt
If the
requirements.txt
file does not exist, you can manually install the dependencies:pip install requests genanki
-
Download the Decks
Anki decks for all Surahs are available in the
decks
folder. Download the deck corresponding to the Surah you wish to learn. -
Import into Anki
- Open Anki.
- Go to File > Import.
- Select the downloaded
.apkg
file. - Click Import to add the deck to your collection.
If you wish to generate the decks yourself, for example, to customize the cards:
-
Run the Generation Script
python generate_all_surahs.py
This script generates Anki decks for all Surahs and saves them in the
decks
folder. -
Customization
You can modify the provided Python scripts to change the number of previous verses displayed on the front, add translations, etc.
- Front: Contains the 5 verses preceding the current verse (or fewer if the verse is among the first in the Surah).
- Back: Contains the current verse to memorize.
This structure provides context and facilitates memorization by building upon previously learned verses.
You can customize the scripts to adapt the cards to your needs:
-
Modify the Number of Previous Verses: In the
generate_flashcards
function, change the value5
to the desired number.front = ' '.join(ayahs[max(0, i-5):i])
-
Add Translations: You can extend the script to include translations by fetching data from the API and adding an extra field to the cards.
-
Change Formatting: Modify the CSS in the Anki model definition to change the appearance of the cards.
css=""" .card { font-family: 'Arial'; font-size: 24px; text-align: right; direction: rtl; } """
Contributions are welcome! If you wish to improve this project:
-
Fork the Repository
Click the Fork button at the top of the page to create a copy of the repository on your GitHub account.
-
Create a Branch for Your Feature
git checkout -b your-feature-branch
-
Commit Your Changes
git commit -am "Add a new feature"
-
Push the Branch
git push origin your-feature-branch
-
Create a Pull Request
Go to your forked repository on GitHub and click on New Pull Request.
This project is licensed under the MIT License. See the LICENSE file for more information.
- Anki: For the spaced repetition software that makes learning more efficient.
- Quran API: Thanks to fawazahmed0 for the API providing Quran data.
- Contributors: Everyone who has contributed to this project.
May Allah facilitate your learning of the Quran.