A Python module for Northern Electric Supply Company Limited (NESCO) Smart Meters
Project description
🔌 NESCO Prepaid CLI
A Python CLI tool to collect information about Northern Electric Supply Company Limited (NESCO) prepaid electricity accounts. Get real-time balance, consumption data, customer information, and recharge history directly from your terminal.
✨ Features
- 💰 Balance Check: Get current account balance instantly
- 👤 Customer Info: Retrieve detailed customer and meter information
- 📊 Monthly Consumption: View historical monthly usage data
- 🔄 Recharge History: Track your payment and recharge records with token details
- 🚀 Fast & Lightweight: Built with Python and designed for speed
- 🔒 Secure: Direct API integration with NESCO's official endpoints
📦 Installation
From PyPI (Recommended)
pip install nesco
From Source
git clone https://github.com/mdminhazulhaque/python-nesco.git
cd python-nesco
pip install -e .
🚀 Quick Start
After installation, use the nesco-cli command:
# Get help
nesco-cli --help
# Check balance
nesco-cli get-balance -c YOUR_CUSTOMER_NUMBER
# Get customer information
nesco-cli get-customer-info -c YOUR_CUSTOMER_NUMBER
📖 Usage
Usage: nesco-cli [OPTIONS] COMMAND [ARGS]...
A CLI tool for NESCO Prepaid electricity account management.
Options:
--help Show this message and exit.
Commands:
get-balance Get current account balance
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:
$ nesco-cli get-balance -c 12345678
Sample Output:
987.43
👤 Get Customer Information
Retrieve comprehensive customer and meter details:
$ nesco-cli get-customer-info -c 12345678
Sample Output:
Name Address Electricity Office Feeder Name Meter Number Approved Load (kW)
------------------ -------- ------------------ ------------- -------------- --------------------
MD. MINHAZUL HAQUE RAJSHAHI Rajshahi S&D4 GREATER ROAD 12345678901 2
🔄 Get Recharge History
View your recent payment and recharge transactions with token details:
$ nesco-cli get-recharge-history -c 12345678
Sample Output:
ID Token Power Amount Via Date Status
---- ------------------------ ------- -------- ------ -------------------- --------
1 0183-4597-1724-6908-6354 957.12 1000 ROCKET 01-JAN-2025 11:00 AM Success
2 4815-9365-5179-7943-3266 258.65 400 BKASH 01-FEB-2025 11:00 PM Success
3 2265-9417-3127-5691-9994 134.45 400 BKASH 01-MAR-2025 11:00 PM Success
📊 Get Monthly Consumption
Analyze your monthly electricity usage patterns:
$ nesco-cli get-monthly-consumption -c 12345678
Sample Output:
Year Month Recharge Discount Usage
------ --------- ---------- ---------- -------
2025 March 2000 -20 1875.22
2025 February 500 -5 433.15
2025 January 1000 -10 812.08
🛠️ Development
Prerequisites
- Python 3.6 or higher
- pip package manager
Setting up for Development
- Clone the repository:
git clone https://github.com/mdminhazulhaque/python-nesco.git
cd python-nesco
- 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 nesco-1.6.0.tar.gz.
File metadata
- Download URL: nesco-1.6.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cb699a916d2cb2d5a9e630432eb10750292b273c3835e74c155fb06aa6f8505
|
|
| MD5 |
4e98c1c1e1c72b3abbd5b47d25bd9b0f
|
|
| BLAKE2b-256 |
ea56c41f5679ffccce395296f4518f44c6e13dda29781ba427e62c1dd8ea9286
|
Provenance
The following attestation bundles were made for nesco-1.6.0.tar.gz:
Publisher:
pypi.yml on mdminhazulhaque/python-nesco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nesco-1.6.0.tar.gz -
Subject digest:
5cb699a916d2cb2d5a9e630432eb10750292b273c3835e74c155fb06aa6f8505 - Sigstore transparency entry: 789627516
- Sigstore integration time:
-
Permalink:
mdminhazulhaque/python-nesco@b2040b3ee5d44ba76759b2d88552eecff8c9fc1c -
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@b2040b3ee5d44ba76759b2d88552eecff8c9fc1c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nesco-1.6.0-py3-none-any.whl.
File metadata
- Download URL: nesco-1.6.0-py3-none-any.whl
- Upload date:
- Size: 6.7 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 |
3e5623c5d4a7b1d0270eabf2d8e461706166ef41318f07f2060e6913c205d59b
|
|
| MD5 |
8d12b0ddcdea38e3b58cde47f1812a08
|
|
| BLAKE2b-256 |
ae9478535f07c41520f43d76d71b096c1ca5dd9c3d788ef269e1f2c6d4e5e82e
|
Provenance
The following attestation bundles were made for nesco-1.6.0-py3-none-any.whl:
Publisher:
pypi.yml on mdminhazulhaque/python-nesco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nesco-1.6.0-py3-none-any.whl -
Subject digest:
3e5623c5d4a7b1d0270eabf2d8e461706166ef41318f07f2060e6913c205d59b - Sigstore transparency entry: 789627517
- Sigstore integration time:
-
Permalink:
mdminhazulhaque/python-nesco@b2040b3ee5d44ba76759b2d88552eecff8c9fc1c -
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@b2040b3ee5d44ba76759b2d88552eecff8c9fc1c -
Trigger Event:
push
-
Statement type: