# Flask Electricity Billing API
## Introduction
This Flask application provides an API for electricity billing. Users can log in and calculate their electricity bills based on meter readings.
## Installation
1. Install Flask and Flask-Session:
```bash
pip install Flask Flask-Session
- Clone the repository.
- Navigate to the project directory.
python app.py
- Method: POST
- Input:
- JSON:
{ "name": {{user}} "pass": {{pass}} }
- JSON:
- Output:
- Success:
{ "message": "Success", "user": "John" }
- Error:
{ "message": "User Not Found :(" }
- Success:
- Method: POST
- Input:
- JSON:
{ "Previous": 50, "Present": 100 }
- JSON:
- Output:
- Success:
{ "message": "Success", "user": "John", "total_units_consumed": 50, "total_amount_rupees": 500 }
- Error:
{ "message": "Error" }
- Success:
- Open Postman.
- Create a new request for each endpoint.
- Set the request method to POST.
- Enter the appropriate endpoint URL (e.g.,
http://localhost:5000/
). - Add the required JSON parameters in the request body.
- Click on the "Send" button to test the API