A sleek desktop application to calculate and track Body Mass Index (BMI) using Python, PyQt5, and MySQL.
- 🧮 Calculate BMI with instant feedback
- 💾 Save BMI records to a MySQL database
- 📊 View BMI history in a sortable table
- 🎨 Stylish and responsive PyQt5 interface
- Python 3
- PyQt5
- MySQL
- SQL
-
Clone the repository
git clone https://github.com/codewithvikas96-ui/BMI-Calculator-PyQt5-MySQL.git
-
Navigate inside the project folder
cd BMI-Calculator-PyQt5-MySQL -
Install dependencies
pip install -r requirements.txt
-
set up the MySQL Database
- Open MySQL and create a database:
CREATE DATABASE BodyMassIndex;
- Use the database:
or just right click on the database (BodyMassIndex) and click on Set as default Schema
USE BodyMassIndex;
- Create the users table:
CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), weight DECIMAL(5,2), height DECIMAL(5,2), bmi DECIMAL(5,2), category VARCHAR(50), date_time DATETIME DEFAULT CURRENT_TIMESTAMP );
- Open MySQL and create a database:
-
Run the application
python src/main.py
| BMI Range | Category |
|---|---|
| < 18.5 | Underweight |
| 18.5 – 24.9 | Normal weight |
| 25 – 29.9 | Overweight |
| ≥ 30 | Obese |
| File/Folder | Description |
|---|---|
| src/main.py | Main python Script |
| database/schema.sql | SQL Script to create the users table |
| requirements.txt | Python dependencies |
| .gitignore | Git ignore rules |
Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.
This project is licensed under the MIT License.
Made with 💛 by Vikas Ajay Vishwakarma