Skip to content

FlacSy/GeM-BidPlus-Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ GeM BidPlus Automation

End-to-end bid participation automation for the Government e-Marketplace of India.

From login and captcha solving to document upload and OTP verification β€” fully automated.

Python Versions License Patchright

Features β€’ Installation β€’ Quick Start β€’ Configuration β€’ Architecture β€’ Contributing


πŸš€ Features

GeM BidPlus Automation handles the entire bid participation workflow on bidplus.gem.gov.in so you don't have to click through it manually.

  • πŸ” Smart Login β€” Captcha OCR via Tesseract with manual fallback, OTP auto-fetch from email (IMAP)
  • πŸ” Bid Search β€” Exact bid search and one-click participation
  • πŸ“‹ Catalogue Offering β€” Automatic catalogue selection, encrypt & save
  • πŸ’° Offer Price β€” Price entry, estimated price modal handling, encrypt & save
  • πŸ“„ Document Upload β€” Bulk upload mapped by document field keys with flexible file resolution
  • 🏦 EMD/EPBG β€” Navigate and save
  • βœ… Bid Verification β€” Consent checkbox, OTP verification (auto-fetch or manual)
  • 🧠 Smart Flow Detection β€” Reads the sidebar progress indicator to resume from the current step
  • πŸ›‘οΈ Anti-Detection β€” Patchright (Playwright fork) with human-like delays, typing, scrolling, and mouse movement

πŸ“¦ Installation

Prerequisites

Dependency Purpose
Python 3.11+ Runtime
Google Chrome Browser (stable channel)
Tesseract OCR Captcha recognition

Install Tesseract

# Ubuntu / Debian sudo apt install tesseract-ocr # macOS brew install tesseract # Windows β€” https://github.com/UB-Mannheim/tesseract/wiki

Install the project

git clone https://github.com/FlacSy/gem-automation.git cd gem-automation python -m venv .venv source .venv/bin/activate # Linux/macOS # .venv\Scripts\activate # Windows pip install -r requirements.txt patchright install chromium

⚑ Quick Start

1. Set up credentials

cp .env.example .env # Edit .env with your GeM login, password, and (optionally) email for OTP

2. Run

python main.py

The script will:

  1. Open Chrome and navigate to GeM BidPlus
  2. Log in (captcha β†’ password β†’ OTP)
  3. Search for the specified bid and click Participate
  4. Run through all bid participation steps automatically
  5. Wait for you to press Enter before closing the browser

3. Debug mode

GEM_DEBUG=1 python main.py

Enables verbose logging and saves artifacts (HAR, traces, screenshots) to debug_logs/artifacts/.


βš™οΈ Configuration

Environment Variables

Variable Required Description
GEM_LOGIN No* GeM login ID
GEM_PASSWORD No* GeM password
GEM_SEARCH_BID No* Bid number for exact search
GEM_EMAIL_IMAP_HOST No IMAP server (default: imap.gmail.com)
GEM_EMAIL_USER No Email for OTP retrieval
GEM_EMAIL_PASSWORD No IMAP app password
GEM_EMAIL_USE_SSL No Use SSL for IMAP (1 / 0)
GEM_UPLOAD_DOCUMENTS_DIR No Directory with documents to upload
GEM_UPLOAD_DOC_<KEY> No Path to a specific document by field key
GEM_DEBUG No Enable debug mode (1 / 0)
GEM_VERIFY_OTP No Pre-set OTP for bid verification

* Prompted interactively in the console if not set.

config.yaml

All CSS selectors, timeouts, delays, and flow-specific settings live in config.yaml. You rarely need to modify this file unless the GeM portal changes its markup.


πŸ“„ Document Upload

The upload flow maps document fields (defined in config.yaml β†’ upload_documents.document_fields) to files on disk. Resolution order:

  1. Environment variable β€” GEM_UPLOAD_DOC_<KEY> (e.g. GEM_UPLOAD_DOC_EXPERIENCE_CRITERIA=/path/to/file.pdf)
  2. Directory scan β€” matching filename from GEM_UPLOAD_DOCUMENTS_DIR (see document_filename_by_key in config)
  3. Fallback β€” GEM_UPLOAD_DOCUMENT_FILE

πŸ— Architecture

gem-automation/ β”œβ”€β”€ main.py # Entry point β”œβ”€β”€ config.yaml # Selectors, timeouts, delays β”œβ”€β”€ logger.py # Logging (file + console in DEBUG) β”œβ”€β”€ browser/ β”‚ β”œβ”€β”€ stealth_browser.py # Patchright Chrome launch β”‚ └── humanization.py # Human-like interactions β”œβ”€β”€ flows/ β”‚ β”œβ”€β”€ base.py # BaseFlow ABC β”‚ β”œβ”€β”€ flow_detector.py # Bid participation state detection β”‚ β”œβ”€β”€ login.py # Login flow β”‚ β”œβ”€β”€ search.py # Search & participate β”‚ β”œβ”€β”€ catalogue.py # Catalogue offering β”‚ β”œβ”€β”€ offer_price.py # Offer price β”‚ β”œβ”€β”€ upload_documents.py # Document upload β”‚ β”œβ”€β”€ emd_epbg.py # EMD/EPBG β”‚ └── verify_bid.py # Verify bid with OTP └── utils/ β”œβ”€β”€ config.py # YAML + Pydantic config loader └── email_client.py # IMAP OTP fetcher 

Flow Execution Pipeline

Login β†’ Search β†’ [ Flow Detector ] β†’ Catalogue β†’ Offer Price β†’ Upload Docs β†’ EMD/EPBG β†’ Verify Bid ↑ | └──────────────── re-detect after each step β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 

The Flow Detector reads the sidebar (ul.progress-indicator) to determine which step is current and which are already completed, so the automation always resumes from the right place.


⚠️ Disclaimer

This tool is provided for educational and research purposes. Use it responsibly and in compliance with GeM's terms of service. The authors are not responsible for any misuse or consequences arising from the use of this software.


🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Open a Pull Request

Please open an Issue for bugs or feature requests.

πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.

Developed with ❀️ by FlacSy

About

End-to-end bid participation automation for the Government e-Marketplace of India.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages