Skip to main content

A Python module for Northern Electric Supply Company Limited (NESCO) Smart Meters

Project description

🔌 NESCO Prepaid CLI

PyPI version Python Versions License: MIT Downloads

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

  1. Clone the repository:
git clone https://github.com/mdminhazulhaque/python-nesco.git
cd python-nesco
  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.

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

nesco-1.6.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nesco-1.6.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for nesco-1.6.0.tar.gz
Algorithm Hash digest
SHA256 5cb699a916d2cb2d5a9e630432eb10750292b273c3835e74c155fb06aa6f8505
MD5 4e98c1c1e1c72b3abbd5b47d25bd9b0f
BLAKE2b-256 ea56c41f5679ffccce395296f4518f44c6e13dda29781ba427e62c1dd8ea9286

See more details on using hashes here.

Provenance

The following attestation bundles were made for nesco-1.6.0.tar.gz:

Publisher: pypi.yml on mdminhazulhaque/python-nesco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for nesco-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e5623c5d4a7b1d0270eabf2d8e461706166ef41318f07f2060e6913c205d59b
MD5 8d12b0ddcdea38e3b58cde47f1812a08
BLAKE2b-256 ae9478535f07c41520f43d76d71b096c1ca5dd9c3d788ef269e1f2c6d4e5e82e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nesco-1.6.0-py3-none-any.whl:

Publisher: pypi.yml on mdminhazulhaque/python-nesco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page