A Flask web application that uses Google Gemini AI to analyze various document types (PDF, Images, Word, PowerPoint, Text) and extract information with copy-to-clipboard functionality.
✅ Multi-format Support: Analyze PDFs, JPG, PNG, GIF, BMP, WebP, DOC, DOCX, PPT, PPTX, and TXT files ✅ AI-Powered Analysis: Uses Google Gemini API for intelligent document analysis ✅ Copy Functionality: Easily copy analysis results to clipboard ✅ Drag & Drop Upload: Simple and intuitive file upload interface ✅ Beautiful UI: Modern, responsive web interface ✅ Large File Support: Handles up to 50MB files
- Python 3.8 or higher
- Google Gemini API Key
-
Clone or download the project
cd "New folder" -
Create a virtual environment (recommended)
python -m venv venv .\venv\Scripts\Activate.ps1 -
Install dependencies
pip install -r requirements.txt -
Get your Gemini API Key
- Visit: https://makersuite.google.com/app/apikey
- Create a new API key
- Copy the key
-
Set the API Key environment variable
PowerShell:
$env:GEMINI_API_KEY='your-api-key-here'
Command Prompt:
set GEMINI_API_KEY=your-api-key-here
Or create a
.envfile (optional):GEMINI_API_KEY=your-api-key-hereThen load it before running:
Get-Content .env | ForEach-Object { $key, $value = $_ -split '=', 2 [Environment]::SetEnvironmentVariable($key, $value) }
-
Activate virtual environment (if using one)
.\venv\Scripts\Activate.ps1
-
Set the API key (if not already set)
$env:GEMINI_API_KEY='your-api-key-here'
-
Run the application
python app.py
-
Open in browser
- Navigate to:
http://localhost:5000
- Navigate to:
- Open the application in your web browser
- Click on the upload area or drag & drop a document
- Select a file (PDF, Image, Word, PowerPoint, or Text file)
- Click "Analyze Document" button
- Wait for the AI to analyze your document
- View the results and click "📋 Copy All" to copy the analysis to clipboard
- Analyzes image content, text within images, and visual elements
- Best for screenshots, diagrams, and photo documents
- Converts first page to image and analyzes content
- Extracts text and information from the document
- Extracts all text content
- Analyzes structure, paragraphs, and formatting
- Extracts text from all slides
- Provides slide-by-slide analysis
- Reads plain text content
- Provides summary and key information
- File Size: Maximum 50MB per upload
- Free Tier: Check Gemini API documentation for rate limits
- Processing Time: Depends on file size and complexity
- Make sure you've set the API key environment variable correctly
- Restart the application after setting the variable
- Check that your file has the correct extension
- Supported formats: PDF, JPG, JPEG, PNG, GIF, BMP, WebP, DOC, DOCX, PPT, PPTX, TXT
- Install pdf2image:
pip install pdf2image - On Windows, you may need:
pip install pdf2image pillow
- Make sure the Flask server is running
- Check that you're accessing
http://localhost:5000 - Check firewall settings
- Wait a few minutes before making another request
- Check your Gemini API quota at https://makersuite.google.com
New folder/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── README.md # This file
├── templates/
│ └── index.html # Main HTML template
├── static/
│ ├── style.css # Styling
│ └── script.js # Frontend JavaScript
└── uploads/ # Temporary upload folder (auto-created)
- Files are processed and immediately deleted after analysis
- No files are permanently stored on the server
- All communication with Gemini API is encrypted
- Uploaded files are not logged or tracked
- Flask 2.3.2
- google-generativeai 0.3.0
- Pillow 10.0.0
- python-docx 0.8.11
- python-pptx 0.6.21
- pdf2image 1.16.3
- PDF analysis shows first page as image
- For better OCR on PDFs, use image-based documents
- Large documents may take longer to process
- Some complex formatting may not be fully captured
This project is open source and available for personal and educational use.
For issues with the Gemini API, visit: https://support.google.com/makersuite
- Multi-page PDF analysis
- Document comparison
- Extract specific data types (tables, images)
- Support for more file formats
- Export results as PDF/Word
- Batch processing
Made with ❤️ using Flask and Google Gemini AI