Skip to content

Noan-abidostricot/workout-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏋️ Workout Tracker — Nutritionix + Google Sheets

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.


What it does

  1. You describe your workout in plain English
  2. The Nutritionix API parses it and calculates calories burned + duration
  3. The data is automatically sent to a Google Sheet via Sheety

Features

  • 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

Tech Stack

  • 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

Installation

1. Clone the repository

git clone https://github.com/your-username/google-sheets-workout-tracker.git
cd google-sheets-workout-tracker

2. Install dependencies

pip install -r requirements.txt

3. Set up your .env file

cp .env.example .env

Then fill in your credentials (see Environment Variables).


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)

Usage

python main.py

You 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

Project Structure

google-sheets-workout-tracker/
├── main.py              # Main script
├── .env.example         # Environment variables template
├── requirements.txt     # Dependencies
├── .gitignore
└── README.md

Author

Noan — Python developer specializing in automation and web scraping.

GitHub · Malt

About

Logs workout sessions using natural language input — queries the Nutritionix API to extract exercise data and saves results to Google Sheets via Sheety.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages