A Python module for Bangladesh Power Development Board (BPDB) Smart Meters
Project description
🔌 BPDB Smart Meter CLI
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.
✨ Features
- 📱 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
📦 Installation
From PyPI (Recommended)
pip install bpdb
From Source
git clone https://github.com/mdminhazulhaque/python-bpdb.git
cd python-bpdb
pip install -e .
🚀 Quick Start
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-info
📖 Usage
Usage: 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
💡 Examples
📱 Send OTP
Send an OTP to your registered phone number:
$ bpdb-cli send-otp 01710123456
Sample Output:
OTP sent to 01710123456
🔐 Login
Login using your phone number and the OTP received:
$ bpdb-cli login 01710123456 123456
Sample Output:
Logged in with phone number 01710123456
👤 Get Consumer Information
Retrieve comprehensive customer and meter details:
$ bpdb-cli consumer-info
Sample 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 |
+------------------+--------------------+
🔄 Get Recharge History
View your recent payment and token generation records:
$ bpdb-cli recharge-info 01710123456 0120100112233
Sample 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 |
+---------------------+--------------+-------------+--------------------------+
🛠️ Development
Prerequisites
- Python 3.6 or higher
- pip package manager
Setting up for Development
- 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 .
Dependencies
requests- HTTP library for API callsclick- Command line interface frameworktabulate- Pretty-print tabular data
🤝 Contributing
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
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bpdb-1.7.0.tar.gz.
File metadata
- Download URL: bpdb-1.7.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beabbdfa2654e309acd095f22ac6186cd254aabb31c16abe0ff69bb228f3c7df
|
|
| MD5 |
9483ef3ad1c4c1e898d8419430fb7913
|
|
| BLAKE2b-256 |
08547bdb432b5e689fe2b3ea55fa78dd1349655187757cb757d6989297de1f4b
|
Provenance
The following attestation bundles were made for bpdb-1.7.0.tar.gz:
Publisher:
pypi.yml on mdminhazulhaque/python-bpdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bpdb-1.7.0.tar.gz -
Subject digest:
beabbdfa2654e309acd095f22ac6186cd254aabb31c16abe0ff69bb228f3c7df - Sigstore transparency entry: 789638164
- Sigstore integration time:
-
Permalink:
mdminhazulhaque/python-bpdb@a1964c6901d05b774068c9c73eddda1eab2b25a7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mdminhazulhaque
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a1964c6901d05b774068c9c73eddda1eab2b25a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bpdb-1.7.0-py3-none-any.whl.
File metadata
- Download URL: bpdb-1.7.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
141fd2715b54e964f45f6371935626daf860868221320024b62addb923ff67a9
|
|
| MD5 |
38c356628142de497a8ee7499661a2dd
|
|
| BLAKE2b-256 |
6afbe2e3623b35bdb95d3d3fcbef4243c6460e056fb3a3658ac06c18a092ec57
|
Provenance
The following attestation bundles were made for bpdb-1.7.0-py3-none-any.whl:
Publisher:
pypi.yml on mdminhazulhaque/python-bpdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bpdb-1.7.0-py3-none-any.whl -
Subject digest:
141fd2715b54e964f45f6371935626daf860868221320024b62addb923ff67a9 - Sigstore transparency entry: 789638171
- Sigstore integration time:
-
Permalink:
mdminhazulhaque/python-bpdb@a1964c6901d05b774068c9c73eddda1eab2b25a7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mdminhazulhaque
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a1964c6901d05b774068c9c73eddda1eab2b25a7 -
Trigger Event:
push
-
Statement type: