A Python automation script that converts natural language workout descriptions into structured fitness data and logs them automatically to Google Sheets.
"I ran 5km and did 30 push-ups" → logged to your spreadsheet in seconds.
- You describe your workout in plain English
- The Nutritionix API parses it and calculates calories burned + duration
- The data is automatically sent to a Google Sheet via Sheety
- Natural language input — no need to fill forms
- Automatic calorie and duration calculation
- Logs date, time, exercise name, duration and calories
- Structured logging with timestamps
- Graceful error handling on all API calls
- Environment variable validation on startup
- Python 3.10+
- Nutritionix API — natural language exercise parsing
- Sheety API — Google Sheets as a REST backend
- python-dotenv — environment variable management
- requests — HTTP calls
1. Clone the repository
git clone https://github.com/your-username/google-sheets-workout-tracker.git
cd google-sheets-workout-tracker2. Install dependencies
pip install -r requirements.txt3. Set up your .env file
cp .env.example .envThen fill in your credentials (see Environment Variables).
Create a .env file at the root of the project:
x-app-id=your_nutritionix_app_id
x-app-key=your_nutritionix_app_key
token=your_sheety_bearer_token
url_sheety=https://api.sheety.co/your_endpoint/workouts| Variable | Description |
|---|---|
x-app-id |
Nutritionix App ID — get it here |
x-app-key |
Nutritionix App Key |
token |
Sheety Bearer Token — get it here |
url_sheety |
Your Sheety API endpoint (linked to your Google Sheet) |
python main.pyYou will be prompted to enter:
- Your workout description (natural language)
- Your weight, height, age and gender (used for accurate calorie calculation)
Example session:
Tell me which exercises you did: I ran 5km and did 20 minutes of cycling
Give me your weight in kg: 72
Give me your height in cm: 180
Give me your age: 17
Give me your gender (male / female): male
2025-01-15 14:32:01 [INFO] ✅ Running added successfully
2025-01-15 14:32:02 [INFO] ✅ Cycling added successfully
Result in Google Sheets:
| Date | Time | Exercise | Duration (min) | Calories |
|---|---|---|---|---|
| 15/01/2025 | 14:32:01 | Running | 28 | 320 |
| 15/01/2025 | 14:32:02 | Cycling | 20 | 180 |
google-sheets-workout-tracker/
├── main.py # Main script
├── .env.example # Environment variables template
├── requirements.txt # Dependencies
├── .gitignore
└── README.md
Noan — Python developer specializing in automation and web scraping.