Automated IPO application system for MeroShare (Nepal Stock Exchange) that checks for available IPOs and automatically submits applications based on predefined criteria. For personal use only. Fork the repo on GitHub, then clone your fork to your machine; do not use it for commercial or unauthorized purposes.
-
Clone and enter the project
git clone https://github.com/YOUR_USERNAME/meroshare-ipo-automation.git cd meroshare-ipo-automation -
Python 3.8+ and virtualenv (recommended)
python3 -m venv venv source venv/bin/activate # Linux/macOS # or: venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt playwright install chromium
-
Config
cp config.yaml.example config.yaml # Linux/macOS copy config.yaml.example config.yaml # Windows
Edit
config.yaml: set MeroShare account(s) and Telegram. See Configuration and Multiple accounts below. Useheadless: truefor no browser window,falseto watch. -
Run once (manual test)
python3 src/meroshare/check.py
Windows:
run_check.batorpython src\meroshare\check.py -
Optional: daily run at 11:11 Nepal time
- Linux: From project root run
sudo ./setup_timer.sh. Uses systemd; no need to change timezone. Check:sudo systemctl list-timers ipo-check.timer. Logs:sudo journalctl -u ipo-check.service. - macOS: From project root run
./setup_timer_macos.sh(or./setup_timer_macos.sh HOUR MINUTE, e.g../setup_timer_macos.sh 1 11). Uses LaunchAgent and runs at the provided local time; set timezone to Asia/Kathmandu for Nepal time. - Windows: Run PowerShell as Administrator, then
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned(if needed), and.\setup_timer_windows.ps1. Task runs daily at 11:11 AM local time; set system timezone to Nepal (UTC+5:45) for 11:11 Nepal time. View in Task Scheduler → Task Scheduler Library → IPO-Check-MeroShare.
- Linux: From project root run
- Automated IPO Detection: Checks for available IPOs matching specific criteria (Rs. 100 per share, IPO type, Ordinary Shares)
- Multi-Account Support: Checks with one account, applies with all configured accounts if IPO is found
- Form Auto-Fill: Automatically fills application forms with account details
- Telegram Notifications: Real-time notifications via Telegram bot
- Error Handling: Robust error handling with detailed logging
- Scheduled Execution: systemd (Linux), LaunchAgent (macOS), or Task Scheduler (Windows) runs the check daily
- Python 3.8+
- Playwright
- Required packages listed in
requirements.txt
# Install dependencies
pip install -r requirements.txt
# Install Playwright browser
playwright install chromium-
Copy the example config file:
cp config.yaml.example config.yaml
-
Edit
config.yamlwith your account details and Telegram (see below).
List all MeroShare accounts under meroshare.accounts. The first account is used to log in and check for IPOs; all accounts are used to apply if a matching IPO is found.
meroshare:
accounts:
- account_name: "My account"
username: "user1"
password: "pass1"
dp_name: "BANK NAME"
bank_name: "BANK NAME"
crn: "CRN_NUMBER"
boid: "BOID_NUMBER"
transaction_pin: "PIN"
applied_kitta: "10"
- account_name: "Brother's account"
username: "user2"
password: "pass2"
dp_name: "BANK NAME"
bank_name: "BANK NAME"
crn: "CRN_NUMBER"
boid: "BOID_NUMBER"
transaction_pin: "PIN"
applied_kitta: "10"
# Add more accounts with the same fields.
telegram:
bot_token: "your_bot_token"
chat_id: "your_chat_id"
headless: true- account_name (optional): Label shown in Telegram and logs (e.g. "My account", "Brother's account"). If omitted, username is used.
- Each account must have:
username,password,dp_name,bank_name,crn,boid,transaction_pin, and optionallyapplied_kitta(default 10).
python3 src/meroshare/check.pyWindows: double-click run_check.bat or run python src\meroshare\check.py from the project folder.
- Linux: From project root run
sudo ./setup_timer.sh. Uses systemd timer. - macOS: From project root run
./setup_timer_macos.sh(or./setup_timer_macos.sh HOUR MINUTE). Uses LaunchAgent timer. - Windows: Run
.\setup_timer_windows.ps1in PowerShell as Administrator. Set timezone to Nepal for 11:11 Nepal time.
- On a Windows PC: Open Command Prompt in the project folder, run
run_check.bat. If it starts Python and runs (even if it later fails on login/config), paths and scripts work. To test the scheduler script: PowerShell as Administrator →.\setup_timer_windows.ps1→ open Task Scheduler and confirm task "IPO-Check-MeroShare" exists. - Without Windows: Push the repo to GitHub and open the Actions tab. Run the Windows workflow (it uses
config.yaml.exampleonly—your realconfig.yamlis gitignored and never uploaded). If the run has a green check, the smoke test passed and the Windows setup is valid. If it’s red, open the run and check which step failed.
meroshare-ipo-automation/
├── src/
│ ├── meroshare/
│ │ ├── browser.py # Browser automation
│ │ ├── login.py # MeroShare login
│ │ └── check.py # Main IPO checking logic
│ ├── scheduler/
│ │ └── run_once.py # One-shot run (used by systemd timer)
│ └── config.py # Configuration management
├── config.yaml # Configuration file (create from config.yaml.example)
├── requirements.txt # Python dependencies
├── run_check.bat # Windows: run check once (double-click or Task Scheduler)
├── setup_timer.sh # Linux: systemd timer setup (daily 11:11 Nepal time)
├── setup_timer_macos.sh # macOS: LaunchAgent setup (daily 11:11 local time)
├── setup_timer_windows.ps1 # Windows: Task Scheduler setup (daily 11:11 local time)
└── systemd/ # ipo-check.service, ipo-check.timer (Linux)
- Logs into MeroShare using the first account
- Navigates to ASBA section
- Checks for available IPOs
- Validates IPO criteria (Price: Rs. 100, Type: IPO, Share: Ordinary)
- If matching IPO found:
- Applies with first account
- Logs into each additional account
- Applies for the same IPO with all accounts
- Sends Telegram notifications for each application
- Python 3: Core language
- Playwright: Browser automation
- YAML: Configuration management
- Telegram Bot API: Notifications
- Systemd (Linux) / LaunchAgent (macOS) / Task Scheduler (Windows): Scheduled runs
Private project