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
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
Related Projects
COVID Vaccination Card Digitization (Python)
Python-based automation tool converting government-issued COVID-19 vaccination PDF certificates into portable, double-sided ID cards — with auto-cropping, batch processing, image conversion, and cloud-backed deployment for mass-scale verification.
LESCO Bill Scraper
Python-based automation tool for businesses and property management firms — extracting consumer numbers from bulk PDFs and verifying LESCO electricity bill payment statuses via web scraping, reducing hours of manual work to minutes.
GenderRecognition.com: Empowering AI-Driven Gender Detection Solutions
State-of-the-art AI-powered gender detection platform processing images, videos, text, and voice data in real-time — built with privacy compliance, bias mitigation, and enterprise-level scalability. Includes comprehensive admin panel for platform management.
Related Blog Posts
Top Technologies I Use and Why
A practical look at the core technologies I use most often and how each one contributes to building scalable, production-grade systems.
Future Trends in Software Development
A forward look at the technologies and engineering shifts that are likely to shape the next phase of software development.