A Python CLI tool to collect information about Bangladesh Power Development Board (BPDB) prepaid electricity accounts. Get real-time consumer details, recharge history, and manage your smart meter directly from your terminal.
- 📱 OTP Authentication: Secure login with phone number verification
- 👤 Consumer Info: Retrieve detailed customer and meter information
- 🔄 Recharge History: Track your payment and token generation records
- ⚡ Smart Meter Integration: Direct API integration with BPDB's official endpoints
- 🚀 Fast & Lightweight: Built with Python and designed for speed
- 🔒 Secure: Phone number-based authentication with OTP
pip install bpdbgit clone https://github.com/mdminhazulhaque/python-bpdb.git
cd python-bpdb
pip install -e .After installation, use the bpdb-cli command:
# Get help
bpdb-cli --help
# Send OTP to your phone
bpdb-cli send-otp 01710123456
# Login with OTP
bpdb-cli login 01710123456 123456
# Get consumer information
bpdb-cli consumer-infoUsage: bpdb-cli [OPTIONS] COMMAND [ARGS]...
A CLI tool for BPDB Smart Meter management.
Options:
--help Show this message and exit.
Commands:
send-otp Send OTP to phone number for authentication
login Login with phone number and OTP
consumer-info Get detailed consumer and meter information
recharge-info Get recharge and token generation history
Send an OTP to your registered phone number:
$ bpdb-cli send-otp 01710123456Sample Output:
OTP sent to 01710123456
Login using your phone number and the OTP received:
$ bpdb-cli login 01710123456 123456Sample Output:
Logged in with phone number 01710123456
Retrieve comprehensive customer and meter details:
$ bpdb-cli consumer-infoSample Output:
+------------------+--------------------+
| Division | Mymensingh |
| Meter Type | 1P |
| Account Type | Active (Prepaid) |
| S&D Division | S&D Kishoreganj |
| Sanction Load | 4 |
| Customer Name | MD. ABDUL HANNAN |
| Customer Address | BOTTIRISH |
| Tariff Category | Tariff : LT-A |
+------------------+--------------------+
View your recent payment and token generation records:
$ bpdb-cli recharge-info 01710123456 0120100112233Sample Output:
+---------------------+--------------+-------------+--------------------------+
| Date | Gross Amount | Energy Cost | Tokens |
+---------------------+--------------+-------------+--------------------------+
| 2024-05-01 16:15:04 | 5000 | 4662.19 | 1111-2222-3333-4444-5555 |
| 2024-10-01 17:47:27 | 5000 | 4281.47 | 1111-2222-3333-4444-5555 |
| 2025-01-01 23:41:46 | 5000 | 4785.47 | 1111-2222-3333-4444-5555 |
+---------------------+--------------+-------------+--------------------------+
- Python 3.6 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/mdminhazulhaque/python-bpdb.git
cd python-bpdb- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install in development mode:
pip install -e .requests- HTTP library for API callsclick- Command line interface frameworktabulate- Pretty-print tabular data
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This is an unofficial tool. Use at your own discretion. The authors are not responsible for any issues that may arise from using this tool.