Skip to main content

Nutrition and exercise managment software

Project description

Training Management Software Build Status

Overview

This software is designed to help users track and manage their health and fitness goals. It consists of several Python modules that work together to provide insights into exercise routines, dietary habits, and overall wellness.

Main Function

start.py

This module acts as the entry point for the application. It imports necessary modules and initiates the user interface for interaction.

Subpackage 1 - Person

Person.py

Defines the Person class, which encapsulates personal data like name, birthdate, height, weight, gender, purpose, and exercise frequency. This class is central to the application, as it holds user-specific data.

Module 1: calculate.py

This module consists of functions designed to calculate various health and fitness metrics for a given person. These calculations include the Basal Metabolic Rate (BMR), Total Daily Energy Expenditure (TDEE), daily calorie needs, and macronutrient distribution.

Functions:

  • bmr(person): Calculates the Basal Metabolic Rate based on the person's gender, weight, height, and age. The function returns the BMR as a float rounded to 2 decimal places.
  • tdee(person): Determines the Total Daily Energy Expenditure, which factors in the person's level of physical activity along with the BMR. The result is returned as a float rounded to 2 decimal places.
  • calorie(person): Estimates the daily calorie intake needed for the person based on their TDEE and fitness goal (bulking or cutting). This function incorporates a random element to simulate the variability in daily calorie needs.
  • nutrition(person): Provides a breakdown of the macronutrient distribution (protein, carbohydrates, and fat) based on the person's daily calorie needs. The macronutrients are calculated in grams and rounded to 2 decimal places.

Usage:

These functions are intended to be used in conjunction with the Person class from the Training_Mgmt module. A valid Person instance is required to perform the calculations, as it provides necessary personal data like age, weight, height, fitness goals, and activity level. The module is particularly useful for individuals seeking to tailor their diet and exercise plans according to specific health and fitness objectives.

Module 2: Record.py

This module introduces the Record class, extending pandas.DataFrame (inherit from pandas.DataFrame), to manage and visualize nutrition records. It allows for tracking and analyzing dietary intake over time through various functionalities.

Attributes:

  • __record (pandas.DataFrame): A private DataFrame holding the nutrition data, including dates, calorie intake, and macronutrient breakdown.

Methods:

  • __init__(self, nutrition): Initializes the Record object with a given set of nutrition data.
  • add(self, date, protein, carbon, fat): Adds a new nutrition record to the DataFrame. It computes total calories based on the given macronutrient values and appends the record if the date does not already exist.
  • remove(self, date): Removes a record corresponding to a specified date after user confirmation. The method prompts the user for confirmation before deletion.
  • modify(self, date, protein, carbon, fat): Modifies the nutrition data for a record on a given date. It allows updating protein, carbohydrate, and fat values and recalculates total calories.
  • show(self, start_date, end_date, indicator): Displays a graphical representation of nutritional data over a specified date range. The method offers an option to show either calorie data or a detailed breakdown of macronutrients.

Usage:

The Record class is designed for individuals who want to keep a detailed log of their dietary intake. It offers functionalities to add, remove, and modify records, as well as to visualize the data for easy interpretation. The class can be particularly useful for dietitians, fitness enthusiasts, or anyone interested in tracking their nutritional habits.

Subpackage 2 - Exercise

Module 1: Exercise.py

This module defines the Exercise class, which provides exercise recommendations based on the intensity level and targeted body parts. It is designed to offer a personalized workout plan that includes a variety of strength and cardio exercises.

Attributes:

  • __intensity_level (str): Represents the exercise intensity level which can be "easy", "medium", or "hard".
  • __body_part (list): A list of body parts that the user intends to target in their strength training sessions.
  • chest_exercises (dict): A collection of chest-targeted exercises with corresponding video demonstrations.
  • shoulder_exercises (dict): A collection of shoulder-targeted exercises with corresponding video demonstrations.
  • back_exercises (dict): A collection of back-targeted exercises with corresponding video demonstrations.
  • legs_exercises (dict): A collection of leg-targeted exercises with corresponding video demonstrations.
  • biceps_exercises (dict): A collection of bicep-targeted exercises with corresponding video demonstrations.
  • triceps_exercises (dict): A collection of tricep-targeted exercises with corresponding video demonstrations.
  • cardio_list (list): A list of various cardio exercises.

Functions:

  • intensity_level(self): Property to get or set the exercise intensity level.
  • body_part(self): Property to get or set the targeted body parts for strength training.
  • strength_suggestion(self): Generates strength exercise recommendations based on the set intensity level and targeted body parts.
  • cardio_suggestion(self): Recommends a cardio exercise and duration based on the set intensity level.
  • hybrid_suggestion(self): Combines strength and cardio exercise recommendations for a holistic workout plan based on the set intensity level.
  • strength_choices_helper(self, exercise_num): A helper function that selects a random set of strength exercises based on the number of exercises needed and the targeted body parts.

This class allows users to create a customized exercise plan that aligns with their fitness goals, whether they are looking to bulk up, slim down, or simply maintain a healthy lifestyle.

Module 2: Record.py

This module provides the Record class, which is designed to handle the exercise records for individuals. It facilitates the management of exercise data by allowing operations such as adding, removing, and modifying records, as well as displaying the stored data.

Attributes:

  • person (Person): An instance of the Person class representing the individual associated with the exercise record.
  • csv_file (str): The path to the CSV file where exercise records are stored. It is named after the person's name with "_exercise.csv" as the suffix.

Methods:

  • __init__(self, person): Constructor that initializes the Record object with the associated person.
  • add(self, list_of_dicts): Adds new entries to the exercise record. Each entry is a dictionary representing exercise data for a specific date.
  • remove_by_index(self, index_to_remove): Removes an entry from the exercise record based on its index within the CSV file.
  • modify(self, index, updates): Modifies an existing entry in the exercise record at the specified index with the provided updates.
  • display(self): Displays the entire exercise record in a tabular format.

Usage:

The Record class is used in conjunction with the Person class from the Training_Mgmt module. It requires a valid Person instance upon initialization and interacts with a CSV file to persist exercise data. This class is particularly useful for tracking workouts and progress over time.

Usage

To use this application, run the start.py script. The user will be prompted to enter their personal details and health goals, which will then be used by the application to provide customized health and fitness recommendations.

Dependencies

  • Python 3
  • Pandas: For data manipulation and analysis.
  • Pygal (in record.py): For generating graphical representations of data.
  • IPython (in record.py and Record.py): For displaying outputs within Jupyter Notebooks.

Note

Please ensure that all dependencies are installed before running the application.

Credit to

Xing (Will) Xu

Bingshen (Gevin) Yang

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Training_Mgmt-0.0.1.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Training_Mgmt-0.0.1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file Training_Mgmt-0.0.1.tar.gz.

File metadata

  • Download URL: Training_Mgmt-0.0.1.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for Training_Mgmt-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c5bacf10229679272474fb09b34dadca631f87352a00ee1d733f82b534636b7e
MD5 4367f995d3ddc21ec3d6d5c2f7103bc5
BLAKE2b-256 111ad2dbb40846beaad3c5448e7f50f9914ec4f4244488d4ba24b65cf4f34ca7

See more details on using hashes here.

File details

Details for the file Training_Mgmt-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: Training_Mgmt-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for Training_Mgmt-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa0870f2efa38e882a348f65e24fdcfe38a0317439c6b251918d7604487221b1
MD5 fa90bde02d5d00c8f9dbba5b1ee6bbfc
BLAKE2b-256 faa9dfd0e4353e2c1d2b494996d14bb0136c47c6bbec80d2499df472aeb6e065

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page