A simple Python-based workout tracking application that uses an exercise/nutrition API to estimate exercise duration and calories burned from natural-language input and automatically saves the workout data to a spreadsheet using the Sheety API.
- 🏃 Enter exercises using natural language
- 🔥 Calculates estimated calories burned
- ⏱️ Calculates exercise duration
- 📅 Automatically records the current date and time
- 📊 Stores workout information in a spreadsheet
- 🔐 Uses environment variables to keep API credentials private
- 🌐 Uses REST APIs with Python
requests
- Python
- Requests
- REST API
- Exercise/Nutrition API
- Sheety API
- Google Sheets
- Environment Variables
Workout-Tracker/
│
├── main.py
├── README.md
├── requirements.txt
├── .gitignore
└── .env.example
-
The program asks the user what exercise they performed.
-
The exercise description is sent to the nutrition/exercise API.
-
The API returns information such as:
- Exercise name
- Duration
- Calories burned
-
The program adds the current date and time.
-
The workout information is sent to a Sheety spreadsheet.
Tell me what exercise you did : 30 minutes running
The API response is then processed and the workout information is saved with:
- Date
- Time
- Exercise
- Duration
- Calories
This project requires API credentials.
Create environment variables for:
MY_TOKEN
API_ID
API_KEY
Example:
MY_TOKEN=your_bearer_token
API_ID=your_api_id
API_KEY=your_api_keyNever upload your real API keys or tokens to GitHub.
git clone https://github.com/YOUR-USERNAME/Workout-Tracker.git
cd Workout-Trackerpip install -r requirements.txtSet your API credentials:
MY_TOKEN
API_ID
API_KEY
python main.pyThe project uses the Python requests library.
Install it using:
pip install requestsThis project helped me practice:
- Python classes and methods
- API requests using
requests - POST requests
- JSON data handling
- Environment variables
- Exception handling
- Working with external APIs
- Automating spreadsheet data entry
- Add a graphical user interface
- Add weekly/monthly workout summaries
- Display total calories burned
- Add user authentication
- Add charts and progress tracking
- Store data in a dedicated database
- Add more detailed workout statistics
Harit Sharma
B.Tech Computer Science Engineering Student
⭐ If you find this project useful, consider giving it a star!