A comprehensive fitness tracking application built with Python. Available in two versions: a command-line interface (CLI) for developers and a modern web interface built with Streamlit.
python main.pyModern, interactive web interface with charts and analytics.
streamlit run app.py- User Profile Management: Track personal metrics including BMI, weight history, and body composition
- Workout Tracking: Log various workout types with automatic calorie calculation
- Goal Setting: Create and track fitness goals with progress monitoring and deadlines
- Progress Analytics: View detailed statistics, streaks, and performance trends
- Data Persistence: All data automatically saved to JSON format
- Data Export: Export workout history to CSV for external analysis
- π Running
- π΄ Cycling
- π Swimming
- ποΈ Gym/Strength Training
- π§ Yoga
- πΆ Walking
- π₯ HIIT
- π Dancing
- Weekly and monthly summaries
- Workout streak tracking
- Calorie burn analysis
- BMI calculation and tracking
- Personal records and achievements
- Progress visualization
An overview of your fitness activity including total workouts, duration, calories burned, average duration, and current streak. Includes a calories-over-time line chart and workout type distribution donut chart.
Log a new workout session by selecting the type, date, duration, time, and optional notes. Calories are calculated automatically based on your profile.
Browse all past workouts in a filterable, sortable table. Filter by workout type, date range, and sort by date, calories, or duration.
Create and track fitness goals by workout count, total calories, or total duration. View progress bars for active goals and a log of completed goals.
Visualise your training patterns with monthly workout comparisons, intensity distribution, and average duration by workout type.
Set up and update your personal profile including name, age, height, weight, and gender. Displays your calculated BMI, BMI category, and weight change over time.
For CLI Version (main.py):
- Python 3.7+
- No external dependencies (uses only Python standard library)
For Web App (app.py):
- Python 3.7+
- streamlit
- plotly
- pandas
- Clone the repository:
git clone https://github.com/katrinDY/fitness-tracker.git
cd fitness-tracker- Run the CLI application:
python main.py- Install dependencies:
pip install -r requirements.txt- Run the Streamlit app:
streamlit run app.pyThe app will open in your browser at http://localhost:8501
When you run the application for the first time, you'll be prompted to create your user profile:
- Enter your name, age, weight, height, and gender
- Your BMI will be automatically calculated
- Data is saved automatically
- View/Edit Profile - View your profile and BMI, update weight
- Add Workout - Log a new workout session
- View Workout History - Browse past workouts with filtering options
- View Statistics - See comprehensive analytics and insights
- Manage Goals - Create, view, and track fitness goals
- Weekly Summary - Detailed breakdown of the current week
- Export Data - Export workouts to CSV format
- Exit - Save and exit the application
# Run the fitness tracker
python main.py
# The application will guide you through:
# - Creating your profile
# - Adding workouts
# - Setting goals
# - Viewing your progressManages user profile and body metrics
- BMI calculation
- Weight tracking history
- Body composition analysis
Represents individual workout sessions
- Automatic calorie calculation based on MET values
- Intensity level detection
- Multiple workout type support
Handles fitness goal management
- Progress tracking
- Deadline monitoring
- Automatic completion detection
Main application controller
- Data persistence (JSON)
- Analytics and statistics
- Workout and goal management
- CSV export functionality
- Object-Oriented Design: Clean separation of concerns with SOLID principles
- Type Hints: Full type annotation for better code quality
- Data Validation: Input validation and error handling throughout
- Data Persistence: Automatic JSON serialization/deserialization
- Extensible Architecture: Easy to add new workout types or features
- Create Profile: Set up your user profile with personal metrics
- Log Workouts: Add workouts after each session
- Set Goals: Create goals like "20 workouts this month"
- Track Progress: Check your stats and streaks regularly
- Review Analytics: Use weekly/monthly summaries to optimize training
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
This project is licensed under the MIT License - see the LICENSE file for details.
- Built as part of a Python programming course project
- Calorie calculations based on MET (Metabolic Equivalent of Task) values
- Designed for learners and fitness enthusiasts
Stay healthy, stay fit! πͺ