A Python CLI tool for Dhaka Electric Supply Company Limited (DESCO) prepaid electricity accounts
Project description
🔌 Desco Prepaid CLI
A Python CLI tool to collect information about Dhaka Electric Supply Company Limited (DESCO) prepaid electricity accounts. Get real-time balance, consumption data, customer information, and recharge history directly from your terminal.
✨ Features
- 💰 Balance Check: Get current balance and monthly consumption
- 👤 Customer Info: Retrieve detailed customer and meter information
- 📊 Monthly Consumption: View historical monthly usage data
- 🔄 Recharge History: Track your payment and recharge records
- 🚀 Fast & Lightweight: Built with Python and designed for speed
- 🔒 Secure: Direct API integration with DESCO's official endpoints
📦 Installation
From PyPI (Recommended)
pip install desco
From Source
git clone https://github.com/mdminhazulhaque/python-desco.git
cd python-desco
pip install -e .
🚀 Quick Start
After installation, use the desco-cli command:
# Get help
desco-cli --help
# Check balance
desco-cli get-balance -a YOUR_ACCOUNT_NUMBER
# Get customer information
desco-cli get-customer-info -a YOUR_ACCOUNT_NUMBER
📖 Usage
Usage: desco-cli [OPTIONS] COMMAND [ARGS]...
A CLI tool for Desco Prepaid electricity account management.
Options:
--help Show this message and exit.
Commands:
get-balance Get current balance and consumption data
get-customer-info Get detailed customer and meter information
get-monthly-consumption Get monthly consumption history
get-recharge-history Get recharge and payment history
💡 Examples
💰 Check Balance
Get your current account balance and this month's consumption:
$ desco-cli get-balance -a 987654321
Sample Output:
----------------------- -------------------
accountNo 987654321
meterNo 667788990011
balance 1384.35
currentMonthConsumption 2020.49
readingTime 2022-07-19 00:00:00
----------------------- -------------------
👤 Get Customer Information
Retrieve comprehensive customer and meter details:
$ desco-cli get-customer-info -a 987654321
Sample Output:
------------------- --------------------------
accountNo 987654321
contactNo 01833000000
customerName MR. JOHN DOE
feederName Sector 11
installationAddress H-42, R-7, SEC-13, UTTARA
installationDate 2019-06-23 00:00:00
meterNo 667788990011
phaseType Single Phase Meter
registerDate 2019-06-23 00:00:00
sanctionLoad 6
tariffSolution Category-A: Residential
meterModel None
transformer None
SDName Turag
------------------- --------------------------
🔄 Get Recharge History
View your recent payment and recharge transactions:
$ desco-cli get-recharge-history -a 987654321
Sample Output:
rechargeDate totalAmount vat energyAmount
------------------- ------------- ------ --------------
2022-07-14 06:59:49 2000 95.24 1923.81
2022-07-09 16:35:34 1000 47.62 521.1
2022-05-30 19:31:52 3000 142.86 2665.31
2022-04-21 10:57:38 1980 94.29 1904.57
2022-04-08 23:29:45 1000 47.62 741.5
2022-03-31 10:02:25 500 23.81 480.95
2022-03-01 13:33:16 2000 95.24 1703.41
2022-02-22 12:25:31 2970 141.43 432.46
📊 Get Monthly Consumption
Analyze your monthly electricity usage patterns:
$ desco-cli get-monthly-consumption -a 987654321
Sample Output:
month consumedTaka consumedUnit maximumDemand
------- -------------- -------------- ---------------
2022-01 9 2.401 0
2022-02 162.45 43.323 2.08
2022-03 2204.92 390.8 2.69
2022-04 1260.25 238.501 2.924
2022-05 1292.47 243.864 3.764
2022-06 2222.68 393.6 3.57
2022-07 3901.46 564.81 2.546
2022-08 2891.26 463.185 3.302
2022-09 2032.6 363.622 2.69
2022-10 735.81 148.695 1.8
2022-11 1223.71 232.408 3.486
🛠️ Development
Prerequisites
- Python 3.6 or higher
- pip package manager
Setting up for Development
- Clone the repository:
git clone https://github.com/mdminhazulhaque/python-desco.git
cd python-desco
- 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 desco-1.6.0.tar.gz.
File metadata
- Download URL: desco-1.6.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
644b895dd8b21c030480c16e2d5139d9185d30797674e0481755471ef948218d
|
|
| MD5 |
6f3ac5fd00d8326a3cf8364e63998331
|
|
| BLAKE2b-256 |
b69e587d5ed3ff8c5be62f9d5b49b8506da33cd42af26002cc38d7d3ef8f3816
|
Provenance
The following attestation bundles were made for desco-1.6.0.tar.gz:
Publisher:
pypi.yml on mdminhazulhaque/python-desco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
desco-1.6.0.tar.gz -
Subject digest:
644b895dd8b21c030480c16e2d5139d9185d30797674e0481755471ef948218d - Sigstore transparency entry: 789638198
- Sigstore integration time:
-
Permalink:
mdminhazulhaque/python-desco@da338e54d8a08ffa8d8ee27551b09dbec3f96279 -
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@da338e54d8a08ffa8d8ee27551b09dbec3f96279 -
Trigger Event:
push
-
Statement type:
File details
Details for the file desco-1.6.0-py3-none-any.whl.
File metadata
- Download URL: desco-1.6.0-py3-none-any.whl
- Upload date:
- Size: 7.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 |
f17ce5d8a43f8b3b061cbb229e8cf4b7ac70758e0c4e5e0e0efdf21694beda8a
|
|
| MD5 |
b13c5c7134eb42d9be6ebf2e8a8fed91
|
|
| BLAKE2b-256 |
ca5cd8d731cf61e75e1f790ee0957b60b45d6586039b5d249313c4acb0be1204
|
Provenance
The following attestation bundles were made for desco-1.6.0-py3-none-any.whl:
Publisher:
pypi.yml on mdminhazulhaque/python-desco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
desco-1.6.0-py3-none-any.whl -
Subject digest:
f17ce5d8a43f8b3b061cbb229e8cf4b7ac70758e0c4e5e0e0efdf21694beda8a - Sigstore transparency entry: 789638204
- Sigstore integration time:
-
Permalink:
mdminhazulhaque/python-desco@da338e54d8a08ffa8d8ee27551b09dbec3f96279 -
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@da338e54d8a08ffa8d8ee27551b09dbec3f96279 -
Trigger Event:
push
-
Statement type: