Skip to main content

🔌 BPDB Smart Meter CLI

PyPI version Python Versions License: MIT Downloads

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

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

  1. Clone the repository:
git clone https://github.com/mdminhazulhaque/python-bpdb.git
cd python-bpdb
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install in development mode:
pip install -e .

Dependencies

  • requests - HTTP library for API calls
  • click - Command line interface framework
  • tabulate - 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.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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.

Metadata

Release files for bpdb 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bpdb 1.8.0
File Size Uploaded
bpdb-1.8.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bpdb 1.8.0
File Interpreter ABI Platform
bpdb-1.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / bpdb-1.8.0.tar.gz

Download URL bpdb-1.8.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2895145b3338469729bfc02cf949c36c9f195712a51e4084d3d4e09c33d60bfa
BLAKE2b-256 checksum
How to use checksums
46e2aa0ee316fe4dbf624a23ea3082e93d0fcaae224bc00020a28d2f8765fe82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / bpdb-1.8.0-py3-none-any.whl

Download URL bpdb-1.8.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df79403d09148d23ef3a2ffd0ab17f3f0dbcdea3375aefae569ce437f05b2fe5
BLAKE2b-256 checksum
How to use checksums
2bca6adf110d9e048ac50eb61ba5dd139c6d57d6d3605feebea496ca4a5a2a40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

1.9.0

2 release files

This release

1.8.0 This release

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page