Skip to content

Eway Bill AutoExtend is a Python script that automates the extension of eway bills using Selenium. It reads eway bill data from a CSV, logs into the portal, extends bills about to expire, and logs the process. The script is time-bound and includes vehicle data extraction for accurate extension.

Notifications You must be signed in to change notification settings

shubhammalik19/EwayBill-AutoExtend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

extendEwayBill Automation ๐Ÿš›

Automated E-Way Bill Extension Tool for Indian GST Portal

A Python-based Selenium automation script that streamlines the process of extending E-Way Bills that are expiring today on the official ewaybillgst.gov.in portal. Perfect for businesses and logistics professionals who need to manage multiple E-Way Bill extensions efficiently.

Python Selenium License Browser


๐ŸŽฏ What This Tool Does

This automation script handles the tedious process of extending E-Way Bills by:

  • ๐Ÿ” Automatic Login: Uses your saved credentials to log into the GST portal
  • ๐Ÿ“Š Smart Filtering: Identifies E-Way Bills expiring today from your CSV data
  • ๐Ÿš› Vehicle Detection: Automatically scrapes current vehicle details from print pages
  • ๐Ÿ”„ Bulk Extension: Processes multiple E-Way Bills in sequence
  • ๐Ÿ“ Detailed Logging: Tracks success/failure with comprehensive logs
  • โš ๏ธ Manual CAPTCHA: Pauses for user to complete CAPTCHA verification

โœจ Key Features

๐Ÿค– Intelligent Automation

  • Filters E-Way Bills by expiration date (today's date)
  • Extracts vehicle numbers and kilometers from existing records
  • Handles form filling with validation and error recovery

๐Ÿ“Š Smart Time Management

  • Early morning detection (00:00-08:00) uses previous day's date
  • Recommended execution window: 08:00-16:00 for optimal performance

๐Ÿ›ก๏ธ Robust Error Handling

  • Multiple retry mechanisms for network issues
  • Comprehensive logging system with 4 different log levels
  • Graceful handling of missing data and timeouts

๐Ÿ“‹ Professional Logging

  • Debug logs: Complete execution trace
  • Error logs: Issues and exceptions only
  • Operations logs: High-level progress tracking
  • Results log: Simple success/failure summary

๐Ÿš€ Quick Start Guide

1. Install Dependencies

# Clone or download the script
git clone <your-repository-url>
cd extendEwayBill-automation

# Install required packages
pip install pandas selenium beautifulsoup4

2. Setup Firefox Browser

# Download and install Firefox browser
# Download geckodriver from: https://github.com/mozilla/geckodriver/releases
# Add geckodriver to your system PATH

3. Prepare Configuration Files

Create two essential files in the script directory:

user.json - Your Login Credentials

{
    "user_name": "your_username",
    "password": "your_password"
}

eway.csv - Your E-Way Bill Data

EWB.No,Valid Untill,From Place,To Place,Document No
12345678901,28/05/2025,Mumbai,Delhi,DOC001
12345678902,28/05/2025,Chennai,Bangalore,DOC002

4. Run the Script

python extendEwayBill.py

๐Ÿ“ File Structure & Requirements

Required Files (You Create These)

File Purpose Format
user.json Login credentials JSON with user_name and password
eway.csv E-Way Bill data CSV with columns: EWB.No, Valid Untill, etc.

Generated Files (Script Creates These)

File Purpose When to Share
logs/debug_TIMESTAMP.log Complete execution trace ๐Ÿ“ง Send to support for debugging
logs/errors_TIMESTAMP.log Errors and exceptions only ๐Ÿ“ง Send to support if issues occur
logs/operations_TIMESTAMP.log High-level progress ๐Ÿ“Š For your review
log.txt Simple success/failure results ๐Ÿ“‹ Quick reference
eway.txt E-Way Bill and vehicle mapping ๐Ÿš› Vehicle tracking

๐Ÿ”ง Detailed Setup Instructions

Python Dependencies

pip install pandas>=1.3.0
pip install selenium>=4.0.0
pip install beautifulsoup4>=4.9.0

Firefox & WebDriver Setup

  1. Install Firefox Browser (latest version recommended)

  2. Download GeckoDriver:

  3. Verify Installation:

    geckodriver --version

CSV Data Format

Your eway.csv must include these columns:

Column Example Required
EWB.No 12345678901 โœ… Yes
Valid Untill 28/05/2025 โœ… Yes
From Place Mumbai โŒ Optional
To Place Delhi โŒ Optional
Document No DOC001 โŒ Optional

Date Format: DD/MM/YYYY (e.g., 28/05/2025)


๐Ÿ–ฅ๏ธ Browser & CAPTCHA Instructions

Browser Behavior

  • Browser Type: Firefox (non-headless by default)
  • Window: Maximized for better visibility
  • Session: Maintains login across multiple operations

CAPTCHA Handling โš ๏ธ

The script DOES NOT solve CAPTCHAs automatically. Here's what happens:

  1. Script pauses at login screen when CAPTCHA appears
  2. You manually complete the CAPTCHA
  3. Script automatically continues once login is successful
  4. No manual intervention needed after successful login

๐Ÿ’ก Tip: Keep the browser window visible during execution to handle any unexpected CAPTCHAs.


๐Ÿ“‹ Usage Workflow

Step-by-Step Process

  1. ๐Ÿ” Login Phase

    • Script navigates to ewaybillgst.gov.in
    • Enters your credentials from user.json
    • PAUSES for CAPTCHA (you complete manually)
    • Continues automatically after successful login
  2. ๐Ÿ” Data Collection Phase

    • Reads E-Way Bills from eway.csv
    • Filters bills expiring today
    • Visits print pages to extract vehicle details
    • Saves vehicle information for extensions
  3. ๐Ÿ”„ Extension Phase

    • Processes each E-Way Bill individually
    • Fills extension forms with collected data
    • Submits requests and monitors results
    • Logs success/failure for each bill
  4. ๐Ÿ“Š Completion

    • Generates comprehensive logs
    • Creates summary report
    • Provides troubleshooting information

Recommended Execution Schedule

  • โฐ Best Time: 08:00 AM - 4:00 PM
  • ๐ŸŒ… Early Morning: Uses previous day's date (00:00-08:00)
  • ๐Ÿ“… Daily Run: Execute once per day for expiring bills

๐Ÿ› ๏ธ Developer Guide

Code Structure

extendEwayBill.py
โ”œโ”€โ”€ ๐Ÿ“Š Logging Configuration (Lines 1-100)
โ”œโ”€โ”€ ๐Ÿ”ง Utility Functions (Lines 101-200)
โ”œโ”€โ”€ ๐Ÿ” Login Management (Lines 201-350)
โ”œโ”€โ”€ ๐Ÿš› Vehicle Data Extraction (Lines 351-450)
โ”œโ”€โ”€ ๐Ÿ”„ Extension Processing (Lines 451-600)
โ””โ”€โ”€ ๐Ÿš€ Main Execution (Lines 601-700)

Key Classes & Methods

Component Purpose Entry Point
extendEwayBill Main automation class __init__()
fresh_login() Handles login with CSRF protection Called before major operations
getPrintEwayAndFindCurrentVehicle() Extracts vehicle details Called in Step 1
extendEwayBills() Processes extensions Called in Step 2

Adding New Features

  1. ๐Ÿ” Data Extraction: Modify getPrintEwayAndFindCurrentVehicle()
  2. ๐Ÿ“ Form Handling: Update extend_single_eway()
  3. ๐Ÿ“Š Logging: Use existing decorators @log_function_call or @log_selenium_action
  4. ๐Ÿ›ก๏ธ Error Handling: Follow existing try-catch patterns

Debugging Tips

  • ๐Ÿ› Debug Logs: Check logs/debug_TIMESTAMP.log for detailed execution
  • ๐ŸŒ URL Tracking: Script logs all page navigation
  • ๐Ÿ“„ Element Detection: Uses explicit waits for reliable element interaction
  • ๐Ÿ”„ Retry Logic: Most operations have 5-attempt retry mechanisms

๐Ÿค Contributing

Getting Started

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Follow coding standards: Use existing logging patterns
  4. Test thoroughly: Verify with sample data
  5. Submit pull request: Include detailed description

Code Standards

  • ๐Ÿ“Š Logging: Use decorators for function entry/exit tracking
  • ๐Ÿ›ก๏ธ Error Handling: Implement retry logic for network operations
  • ๐Ÿ“ Documentation: Add docstrings for new functions
  • ๐Ÿงช Testing: Test with various CSV formats and scenarios

Areas for Contribution

  • ๐Ÿ”ง Enhanced Error Recovery: Improve handling of network failures
  • ๐ŸŽจ UI Improvements: Better progress indication
  • ๐Ÿ“Š Reporting: Enhanced success/failure analytics
  • ๐ŸŒ Browser Support: Add Chrome/Edge compatibility
  • ๐Ÿ“ฑ Notifications: Email/SMS alerts for completion

โš ๏ธ Important Disclaimers

๐Ÿ”’ Security

  • Never commit user.json with real credentials to version control
  • Use environment variables for production deployments
  • Regularly update passwords and review access logs

๐Ÿ›๏ธ Legal & Compliance

  • Authorized Use Only: Use only with your own GST credentials
  • Rate Limiting: Script includes delays to avoid overwhelming servers
  • Terms of Service: Ensure compliance with GST portal's terms of use
  • Data Protection: Handle E-Way Bill data according to your privacy policies

๐Ÿ›ก๏ธ Technical Limitations

  • CAPTCHA Manual: Cannot solve CAPTCHAs automatically
  • Network Dependent: Requires stable internet connection
  • Portal Changes: May need updates if GST portal changes structure
  • Browser Specific: Currently supports Firefox only

๐Ÿ“ž Support

  • ๐Ÿ› Bug Reports: Include debug logs and detailed steps to reproduce
  • ๐Ÿ’ก Feature Requests: Describe use case and expected behavior
  • โ“ Questions: Check logs first, then contact with specific error messages

๐Ÿ“Š Performance & Monitoring

Typical Execution Times

  • ๐Ÿ” Login: 30-60 seconds (including CAPTCHA)
  • ๐Ÿš› Vehicle Data: 15-30 seconds per E-Way Bill
  • ๐Ÿ”„ Extension: 20-40 seconds per E-Way Bill
  • ๐Ÿ“Š Total: ~1-2 minutes per E-Way Bill

Resource Usage

  • ๐Ÿ’พ Memory: ~100-200 MB during execution
  • ๐ŸŒ Network: Moderate (respects server rate limits)
  • ๐Ÿ’พ Disk: Minimal (logs and result files)

๐Ÿท๏ธ Tags & Keywords

python selenium automation gst eway-bill indian-government logistics firefox web-scraping business-automation tax-compliance bulk-processing data-extraction form-automation transportation



๐Ÿ‘จโ€๐Ÿ’ป About the Creator

Created by Shubham Malik | Version 1.0 | Last Updated: May 2025

๐Ÿš› Mission Statement

"Always committed to the development of Transport and Logistics Infrastructure to speed up the supply chain and help the country grow."

Shubham Malik is dedicated to building automation solutions that streamline India's logistics ecosystem, reduce bureaucratic delays, and empower businesses to focus on growth rather than paperwork. This tool represents a commitment to:

  • ๐Ÿ‡ฎ๐Ÿ‡ณ National Growth: Supporting India's economic development through efficient logistics
  • โšก Supply Chain Acceleration: Reducing manual processing time from hours to minutes
  • ๐Ÿข Business Empowerment: Enabling small and large enterprises to manage compliance effortlessly
  • ๐Ÿ”ฌ Continuous Innovation: Developing tools that adapt to India's evolving digital infrastructure

๐ŸŒŸ Vision for Indian Logistics

By automating repetitive government portal interactions, we aim to:

  • ๐Ÿ“ˆ Boost Productivity: Free up valuable human resources for strategic work
  • ๐Ÿ”„ Improve Accuracy: Eliminate manual errors in compliance processes
  • ๐Ÿ’ฐ Reduce Costs: Lower operational overhead for transportation businesses
  • ๐Ÿš€ Scale Operations: Enable businesses to handle larger volumes efficiently

โš–๏ธ Legal Disclaimer & Terms of Use

๐Ÿ›ก๏ธ Creator's Liability Limitation

IMPORTANT NOTICE: This software is provided "AS IS" without warranty of any kind. The creator, Shubham Malik, shall NOT be held liable for:

  • โŒ Misuse of Software: Any unauthorized, illegal, or non-compliant use of this tool
  • ๐Ÿšซ Portal Violations: Breach of GST portal terms of service by end users
  • ๐Ÿ’ธ Financial Losses: Any direct or indirect financial damages resulting from software use
  • ๐Ÿ“Š Data Issues: Loss, corruption, or mishandling of user data
  • ๐Ÿ›๏ธ Legal Consequences: Any legal action arising from improper usage
  • โšก System Failures: Server downtime, network issues, or technical malfunctions

๐Ÿ“‹ User Responsibilities

By using this software, you agree to:

  1. ๐Ÿ” Authorized Access Only: Use only your own legitimate GST credentials
  2. ๐Ÿ“œ Compliance: Ensure all activities comply with Indian GST laws and regulations
  3. ๐Ÿ›ก๏ธ Security: Protect your credentials and use secure systems
  4. ๐Ÿ“Š Data Accuracy: Verify all automated submissions for correctness
  5. โš–๏ธ Legal Accountability: Accept full responsibility for all consequences of usage
  6. ๐Ÿšซ No Misuse: Refrain from any activities that violate portal terms or applicable laws

๐ŸŽฏ Intended Use Only

This tool is designed exclusively to assist legitimate business operations in:

  • โœ… Extending valid E-Way Bills before expiration
  • โœ… Streamlining compliance processes for authorized users
  • โœ… Reducing manual effort in routine logistics operations

๐Ÿšจ Prohibited Activities

Users must NOT use this tool for:

  • โŒ Fraudulent transactions or false documentation
  • โŒ Accessing accounts without proper authorization
  • โŒ Circumventing government security measures
  • โŒ Any activity that violates GST portal terms of service
  • โŒ Commercial misuse or unauthorized redistribution

๐Ÿ“ž Support & Contact

For legitimate technical support or business inquiries:

  • ๐Ÿ“ง Email: [Include your contact information]
  • ๐Ÿ› Issues: Report bugs with detailed logs and reproduction steps
  • ๐Ÿ’ก Suggestions: Feature requests for logistics automation improvements

Note: Support is provided for legitimate use cases only. Requests related to circumventing security measures or unauthorized access will not be entertained.


๐Ÿ‡ฎ๐Ÿ‡ณ Contributing to India's Digital Growth

This tool represents our commitment to India's digital transformation in logistics. By using it responsibly, you contribute to building a more efficient, transparent, and growth-oriented supply chain ecosystem for our nation.

Always ensure compliance with applicable laws and regulations when using automation tools with government portals.


Developed with ๐Ÿงก for Indian Transport & Logistics Industry

About

Eway Bill AutoExtend is a Python script that automates the extension of eway bills using Selenium. It reads eway bill data from a CSV, logs into the portal, extends bills about to expire, and logs the process. The script is time-bound and includes vehicle data extraction for accurate extension.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages