A simple automation tool that downloads PDFs from Google Drive, extracts the text, optionally cleans it with AI, converts it into audio, and emails the audio files to you on a schedule.
Run the following commands:
pip install google-api-python-client google-auth
pip install pypdf
pip install gtts
pip install python-dotenv
# Optional AI features
pip install openaiCreate a .env file in the root directory of the project.
Add the following:
# Google Drive service account credentials
SERVICE_ACCOUNT_FILE=credentials.json
# Google Drive folder ID containing PDFs
FOLDER_ID=your_folder_id
# Local folders
DOWNLOAD_DIR=downloads
TEXT_DIR=text
AUDIO_DIR=audio
# How many days back to search for PDFs
DAYS_BACK=0
# Email settings
EMAIL_FROM=your_email@gmail.com
EMAIL_TO=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
# Optional features
CLEAN_TEXT=true
PREMIUM_TTS=true
# Only needed if using AI features
OPENAI_API_KEY=your_openai_api_keypython main.pyPDF files in Google Drive must be named using the due date of the reading.
Use this format:
2026-05-21_filename.pdf
Example:
2026-05-21_chapter5.pdf
The date should be the actual due date from the syllabus, not the date you want the file delivered. This avoids needing to manually calculate dates later.