Skip to content

Give me your highlighted book before you go to bed, and you'll have fresh, finely processed flashcards by the morning

License

Notifications You must be signed in to change notification settings

gianluccacolangelo/AutoFlashcards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 AutoFlashcards

Give me your highlighted book before you go to bed, and you'll have fresh, finely processed flashcards by the morning!

✨ Features

  • 🔍 Extracts highlights from PDF files
  • 📝 Generates context around highlights
  • 🤖 Creates flashcards using LLMs (Gemini, OpenaI, Anthropic)
  • 📥 Exports flashcards to Anki
  • 🔄 Automatically updates flashcards when PDFs are moved or renamed
  • 💾 Stores highlights in a SQLite database to avoid duplicates

🔑 Safely storing API_KEY

  1. Create a .env file in the project root directory
  2. Set your API key and preferred LLM provider in the .env file:
    API_KEY=yourSuperSecretKey
    LLM_PROVIDER=gemini  # Options: gemini, openai, anthropic
  3. Include .env in your .gitignore file

🛠️ Working on a virtual environment

Using venv

Run in the main directory of the project:

python3 -m venv venv
source venv/bin/activate

To install all dependencies:

pip install -r requirements.txt

If you change the dependencies, update requirements.txt:

pip freeze > requirements.txt

To exit the virtual environment:

deactivate

Using conda

Run in the main directory of the project:

conda env create -f environment.yml
conda activate myenv

To install all dependencies:

conda install --file requirements.txt

If you change the dependencies, update environment.yml:

conda env export --name myenv --file environment.yml

To exit the conda environment:

conda deactivate

🚀 Usage

  1. Ensure your virtual environment is activated and dependencies are installed.
  2. Run the main script with your PDF file:
    python main.py your_highlighted_book.pdf

📝 Notes

  • Ensure that the directory you want to monitor has the necessary read/write permissions.
  • You can modify the DATABASE_PATH and TABLE_NAME variables in the scripts to customize the database location and table name.

About

Give me your highlighted book before you go to bed, and you'll have fresh, finely processed flashcards by the morning

Resources

License

Stars

Watchers

Forks

Packages

No packages published