A smart PDF processing tool designed to extract text, generate intelligent summaries using a local AI model (Ollama), and deliver them instantly via WhatsApp and a formatted Word document.
- PDF Text Extraction: Uses
pdfplumberto extract content page-by-page. - Local AI Processing: Integrates with Ollama (
llama3.2by default) for high-quality, privacy-focused summaries. - Docx Export: Automatically formats the AI-generated summaries into a clean Word document.
- WhatsApp Alerts: Sends live page-by-page summaries to your WhatsApp number using
pywhatkit. - Customizable: Control the model, prompt, and layout settings with a few tweaks in
main.py.
- Python 3.8+
- Ollama: Install and run Ollama locally from ollama.com.
- Pull the model:
ollama pull llama3.2
- Pull the model:
- WhatsApp Web: Ensure your default browser is logged into WhatsApp Web for the automated messaging feature.
-
Create and Activate a Virtual Environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install Core Dependencies:
pip install pdfplumber python-docx requests ollama pywhatkit
-
Install Google API Client (Optional): If you plan to sync with Google Docs:
pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
- Prepare your PDF: Place your document in the project root and name it
input.pdf(or updatePDF_PATHinmain.py). - Set WhatsApp Number: Update
WHATSAPP_NUMBERandSEND_TO_WHATSAPPinmain.py. - Run the Script:
python main.py
The script will process each page, send a message to WhatsApp (if enabled), and save the final compilation to output.docx.
MODEL_NAME: Change the LLM (defaultllama3.2).PROMPT: Define what information you want extracted (Summary, Key Points, etc.).DOC_TITLE: Change the title of the generated Word document.FONT_NAME/FONT_SIZE: Change docx formatting.