Skip to main content

Project for SOF2 LAB

Project description

Calorie count

The aim of the project is to build a web application, where users can type in their body parameters and get an estimation of their recommended daily calories intake. In the second step users can provide information about the type of their sport activity and time they were doing it and get a calculation of spent calories during this activity.

Documentation is available at https://hexann666.github.io/calorie_count/

Install

pip install calorie_count

Releases (defined according to the Lab's formal requirements)

Release 1:

  • git repository available on GitLab/Hub
  • git structure with readme, docs, tests
  • documentation
  • unit tests
  • docker container
  • pip package

Release 2 (to define)

  • Web-Application with Streamlit (Web-UI) (alternatively Flask or FastAPI)*

Release 3 (to define)

  • Webscraper - (get data)
  • Data bank ("Datawarehouse")
  • (Optional) Kubernetes (eg. Okteto)
  • (Optional) Worfklow in MLops-Stil

Technical requirements

  • System shall provide input fields for the input parameters (height, weight, age, gender, activity level).
  • User should input the body parameters in the order, in which system will request them and confirm that the input is complete.
  • System should store the variables provided by user until the end of transaction.
  • If all input variables are valid, system should calculate calorie intake recommendation and show it on the screen.
  • System shall provide input fields for the activity name and time.
  • User should enter her activity name in the field and confirm that the input is complete.
  • After the input was confirmed by user, system shall look up the input string in the data base in the column activity_name.
  • It there is no search result, system shall show a message 'Please type again', wait for the new input and repeat the serach as soon as the new input is confirmed.
  • If there is only one match result, system shall keep the value from the column "METs".
  • If there is more than one result, system shall show all results.
  • If system provides to user multiple results, she should choose her activity from the provided list and type in the respective number. System should keep the value from the column "METs" for the row number, that was typed in by the user.
  • If MET value is saved and body parameters are available from the previous step, system shall calculate the spent calories and total calories for the day.
  • If calculation step succeeded, system shall print the result on the screen.
  • the input variables and results shall not be stored after the last result is displayed.

How to use

First you will provide your height, weight and age and calculate your Basal Metabolic Rate, the number of calories required to keep your body functioning at rest.

After choosing your usual level of activity the Active Metabolic Rate, the number of calories that we consume on a daily basis depending on our height, gender, age, weight and entered activity level whilst maintaining current weight, will be calculated. Output of the function should be stored in a variable to pass it to the next function.

Than you will be asked to type in the activity you were doing today. If there are more than one activities matching your input, you will select one from the lst that matches your search pattern. Additionally you will enter the time you were doing this activity.

import calorie_count.core as cc

body_parameters = cc.input_body_parameters()

cc.calculate_bmr_amr(body_parameters)

cc.calculate_burned_calories(body_parameters)

Note 1

Pip is doing canonicalization while processing Setup.py to a package and automatically changes dots and underscore to dashes. That's why during installation the name of the package is shown as calorie-count and calorie-count-version-nr, although in all the documentation the name of the package is specified as calorie_count.

Note 2

Currently there is a bug in nbdev, when it generates links to the GitHub sourc files from documentation on the GitPages, so it leads to an non-existent link to core.py instead of https://github.com/hexann666/calorie_count/blob/master/calorie_count/core.py. The link specified in settings.ini in git_url is not converted properly.

Sources:

for the formulas: https://www.verywellfit.com/how-many-calories-do-i-need-each-day-2506873

for the MET values: https://golf.procon.org/met-values-for-800-activities/

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

calorie_count-0.0.3.tar.gz (13.1 kB view hashes)

Uploaded Source

Supported by

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