A Python billing system for managing utility customers, meter readings, billing, payments, and reports.
The project supports:
- a CLI app
- a Tkinter desktop GUI
- SQLite storage in
data/billing.db
- User login with
adminandstaffroles - Optional MFA support
- Customer management
- Meter assignment and meter reading updates
- Monthly bill generation
- Payment tracking
- Reports and customer statements
- Bill export to text and PDF
- Electricity:
750Riel per kWh - Water:
500Riel per m3
These values are defined in bill.py.
- Python 3.10 or newer
- Windows, macOS, or Linux
reportlabonly if you want PDF export
Install the optional PDF package with:
pip install reportlabelectricity_water_billing/
|-- auth/
|-- controllers/
|-- data/
|-- models/
|-- reports/
|-- TkinterGUI/
|-- utils/
|-- main.py
|-- run_gui.py
- Clone the repository:
git clone <your-repo-url>
cd electricity_water_billing- Make sure Python is installed:
python --version- Optional: create and activate a virtual environment:
python -m venv .venv
.venv\Scripts\activate- Optional: install PDF export support:
pip install reportlab- Run either the CLI version or the GUI version.
CLI:
python main.pyTkinter GUI:
python run_gui.pyOn first run, the app will:
- create the
data/folder if it does not exist - create the SQLite database at billing.db
- create a default admin account if the database is empty
- migrate old JSON files from
data/into SQLite if they exist
Default admin login:
- Username:
admin - Password:
admin123
The app now uses SQLite.
Main database file:
- billing.db
Legacy JSON files such as users.json, customers.json, meters.json, bills.json, and payments.json are only used for one-time migration when present.
The Tkinter desktop app starts from run_gui.py and uses pages inside TkinterGUI.
The console version starts from main.py.
- Log in as admin or staff.
- Add customers.
- Assign electricity and water meters.
- Enter meter readings.
- Generate bills.
- Record payments.
- View reports or export invoices.
- PDF export requires
reportlab - Generated print files go into
prints/ - Real database files should usually not be pushed to a public repository
- Review
data/billing.dbbefore sharing the project