Professional fuel receipt data extraction system for Indian businesses with AI-powered validation using Google Gemini API.
- Multiple Fuel Types: Support for Petrol, Diesel, CNG, Electric, and LPG
- Fuel-Specific Fields: Each fuel type has optimized data extraction (quantity, price per unit, vehicle registration, odometer reading)
- Multiple Input Sources: Manual entry, image upload, camera capture, or JSON import
- AI-Powered Processing: Google Gemini Vision API for intelligent data extraction
- Live Photo Capture: Take fuel receipt photos directly from the app using your device camera
- Data Validation: Cross-validation between manual entry and AI extraction
- Export Options: JSON and CSV formats
- Record Management: Store, manage, and retrieve fuel expense records
- Data Backup: Backup and restore functionality
- Petrol (Liters) - Standard petrol station receipts
- Diesel (Liters) - Diesel pump receipts
- CNG (Kilograms) - Compressed Natural Gas receipts
- Electric (kWh) - EV charging station receipts
- LPG (Kilograms) - LPG autorickshaw/vehicle receipts
pip install -r requirements.txtThe app can work without Gemini API, but for full functionality:
- Get your Gemini API key from Google AI Studio
- Run the app:
streamlit run streamlit_app.py - Go to Settings tab
- Enter your API key in the "Gemini API Key" field
- Click "Save API Key"
Alternatively, create a .env file:
cp .env.example .env
# Edit .env and add your actual API keystreamlit run streamlit_app.pyThe app will open at http://localhost:8501
- Open the app
- Look at the sidebar on the left
- Choose your fuel type: Petrol, Diesel, CNG, Electric, or LPG
- The app will adapt all fields for your selected fuel type
- Go to "Extract & Edit" tab
- Select "Manual Entry"
- Fill in receipt details including:
- Fuel pump/station name
- Total amount and tax
- Quantity of fuel purchased
- Price per unit
- Vehicle registration (optional)
- Odometer reading (optional)
- Click "Save & Submit"
- Go to "Extract & Edit" tab
- Select "Upload Image"
- Upload a fuel receipt image (JPG/PNG)
- Gemini will automatically extract fuel-specific data
- Review and confirm the extracted data
- Go to "Extract & Edit" tab
- Select "Capture Photo"
- Click the camera input to capture photo using your device camera
- Gemini will automatically extract data from the photo
- Review and confirm the extracted data
- Go to "Extract & Edit" tab
- Select "Upload JSON"
- Upload JSON file with fuel receipt data
- Optionally validate with Gemini
- Review and submit
- Go to "View Records" tab
- See all submitted fuel receipts organized by type
- Export as JSON or CSV
- Delete specific records
- Configure Gemini API key
- Manage data backups
- Import existing records
All fuel receipt data uses this JSON schema:
{
"fuel_type": "string (Petrol|Diesel|CNG|Electric|LPG)",
"merchant_name": "string (Fuel pump/station name)",
"total_amount": "float (numeric only, no currency)",
"tax_amount": "float (numeric only, no currency)",
"quantity": "float (in liters, kg, or kWh depending on fuel type)",
"price_per_unit": "float (price per liter, kg, or kWh)",
"date": "string (YYYY-MM-DD format)",
"address": "string (pump/station address)",
"vehicle_registration": "string (optional: vehicle number plate)",
"odometer_reading": "integer (optional: current odometer in km)"
}- Petrol: Liters (L)
- Diesel: Liters (L)
- CNG: Kilograms (kg)
- Electric: Kilowatt-hours (kWh)
- LPG: Kilograms (kg)
Image Proc/
├── streamlit_app.py # Main Streamlit application
├── extract_receipt.py # Receipt extraction module
├── export_to_form.py # HTML form generation
├── requirements.txt # Python dependencies
├── .env.example # Example environment file
├── .streamlit/
│ └── config.toml # Streamlit configuration
└── README.md # This file
- Visit Google AI Studio
- Click "Create API Key"
- Copy the generated API key
- Paste it in the Settings page of the app
- Go to Settings and add your API key
- Ensure the key is valid and has necessary permissions
- Ensure image is clear and readable
- Supported formats: JPG, PNG
- File size should be reasonable
- Verify JSON format matches the schema
- Use sample_receipt.json as reference
- Your API key is stored only in the application session
- Receipts are processed only when you explicitly submit them
- No automatic data collection or telemetry
- All data is stored locally in your Streamlit session
For issues or questions about:
- Gemini API: Visit Google AI Documentation
- Streamlit: Visit Streamlit Documentation
- This App: Check the embedded help text in each section
Fuel Receipt Data Extractor v2.0 - Built for Indian Fuel Businesses