Skip to main content
All Projects
PythonPyAutoGUITesseract OCRBarcode ScanningImage ProcessingAutomationDesktop ApplicationMachine LearningFull-Stack DevelopmentBack-End Web DevelopmentAPI Development

Bill Payment Automation System Using Python

Desktop automation tool that slashed daily utility bill processing from 4–6 hours to under 2 hours — using Python, barcode scanning, Tesseract OCR, and GUI automation to process 500–700 bills daily through NADRA e-Sahulat with near-zero errors.

Screenshots

Bill Payment Automation System Using Python - Screenshot 1

Overview

Bill Payment Automation System (Dec 2018 – Jan 2019) — Role: Product Lead & Developer. A desktop application developed to automate the tedious process of paying multiple utility bills (LESCO, PTCL, SNGPL, LWASA, etc.) through NADRA e-Sahulat.

Problem: • High Manual Effort: Each bill required manual data entry of consumer number, CNIC, and mobile number, followed by an amount check against the physical bill. • Time-Consuming: Processing 500–700 bills a day required 4–6 hours, causing fatigue and eye strain. • Human Error: Mistakes in entering consumer numbers or amounts led to irrecoverable losses, as payment reversals were not supported by the government e-Sahulat system. • Encrypted Barcodes: LESCO bill barcodes were encrypted, requiring a special decryption technique obtained directly from LESCO headquarters.

Solution: • Barcode Scanning: Leveraged barcodes on physical bills — including a custom LESCO decryption method — to automatically fetch consumer numbers, due dates, and amounts. • Python Automation Script: Wrote a Python script using Mouse and Keyboard SDK to simulate user clicks and keystrokes in the NADRA e-Sahulat portal. • OCR Integration (Tesseract): Automated screenshots of portal screens to verify displayed amounts via OCR, ensuring scanned data matched on-screen data before payment. • Desktop Application: Created a user-friendly interface that captures CNIC and mobile number only once, then processes each bill in a single scan-and-pay flow.

Technologies Used: • Python: Main programming language for automation logic • PyAutoGUI/Mouse & Keyboard SDK: To simulate clicks and keystrokes • Tesseract OCR: For reading text (amount due, confirmation messages) from screenshots • Barcode Libraries: To decode and parse bill information • Decryption Algorithm (LESCO): Custom method to decrypt encrypted LESCO barcodes

Impact: • Significantly Reduced Time: Lowered daily processing time from 4–6 hours to under 2 hours on average. • Minimized Human Error: Automated data entry and verification drastically decreased incorrect bill payments. • Increased Efficiency & Scalability: Freed up staff for other tasks, enabling processing of more bills with fewer mistakes. • Enhanced Accuracy: By matching physical bill amounts with scanned data before paying, the likelihood of incorrect payment was almost eliminated.

Key Highlights

  • Reduced 500–700 daily bill processing from 4–6 hours to under 2 hours on average
  • Custom LESCO barcode decryption algorithm obtained from LESCO headquarters
  • Tesseract OCR verification matching on-screen amounts to scanned bill data before payment
  • PyAutoGUI/Mouse & Keyboard SDK for fully automated NADRA e-Sahulat portal navigation
  • Single scan-and-pay desktop flow — CNIC and mobile number entered only once per session
  • Near-eliminated irrecoverable payment errors in a non-reversible government payment system

Tech Stack

PythonPyAutoGUITesseract OCRBarcode ScanningImage ProcessingAutomationDesktop ApplicationMachine LearningFull-Stack DevelopmentBack-End Web DevelopmentAPI Development

Related Projects

Related Blog Posts