Skip to main content

An example of a package developed with pyenv, built with build using setuptools, uploaded to PyPI using twine, and distributed via pip.

Project description

Python Package Exercise

A little exercise to create a Python package, build it, test it, distribute it, and use it. See instructions for details.

Build & test

Description

This is a lightweight, health-focused package that offers the following functionality:

  1. Calculates a user’s Body Mass Index determines where the user falls within the BMI scale, ranging from underweight to obese
  2. Identifies diseases associated with a certain, abnormal BMI level (underweight or overweight)
  3. Describes a balanced diet consisting of the amount, in grams, of proteins, carbohydrates, fat, sugar, saturated fats, as well as food energy in calories
  4. Calculates a user’s Active Metabolic Rate, with an option for the user to get his/her Basal Metabolic Rate.

Features

Calculate a user's BMI and render obesity scale:
howfat(age, height, weight, scale):
//Returns bmi score, scale

/More details about parameters:

* age- integer value representing age
* height- integer value representing height
    * metric - integer value in (cm)
    * imperial - integer value in (in)
* weight- integer value representing weight
    * metric - integer value in (kg)
    * imperial - integer value in (lb)
* scale
    "i" for imperial
    "m" for metric

/Disclosure:
BMI and its respective obesity scale may not reflect a precise overview of one's health conditions, especially for ages under 18 and above 65.
Return list of related diseases by BMI:
fat_problems(bmi):
//Returns related diseases
Calculate a user's recommended daily calorie intake:
calories(age, gender, height, weight, activityLevel, scale):
//Returns recommended daily calorie intake

/More details about parameters

* age- numeric value (integer) representing age
* gender
    "f" for female
    "m" for male
* height- numeric value representing height
* weight- numeric value representing weight
* activityLevel- numeric value (integer) representing a user's activity level
    Use scale below:
    0-Basal Metabolic Rate
    1-Sedentary: little or no exercise
    2-Lightly active: exercise 1-3 times a week
    3-Moderately active: exercise 3-5 times a week
    4-Active: exercise 6-7 times a week
    5-Very active: hard exercise 6-7 times a week
* scale
    "i" for imperial
    "m" for metric
Calculate a user's resting energy expenditure
calculateREE(age, gender, height, weight, scale):

More details about parameters:

* age - numeric value (integer) representing age
* gender
    "f" for female
    "m" for male
* height - numeric value representing height
* weight - numeric value representing weight
* scale
    "i" for imperial
    "m" for metric
Calculate a user's total daily energy expenditure
calculateTDEE(REE, userActivityLevel)

More details about parameters

* REE - Resting Energy Expenditure in calories (how many calories burned at rest)

* userActivityLevel- numeric value (integer) representing a user's activity level
    Use scale below:
    1 - Sedentary: Just everyday activities like a bit of walking, a couple of flights of stairs, eating, talking, etc. (REE X 1.2)

    2 - Lightly active: Any activity that burns an additional 200-400 calories for females or 250-500 calories for males. (REE x 1.375)

    3 - Moderately active: Any activity that burns an additional 400-650 calories for females or 500-800 calories for males. (REE x 1.55)
    
    4 - Very Active: Any activity that burns an additional 650+ calories for females or 800+ calories for males. (REE x 1.725)
Calculate a user's target TDEE for weight loss or gain
weightLossOrGainCalculator(TDEE, lossOrGain)

More details about parameters

* weight - numeric value representing weight

* lossOrGain
    'l' for loss - aiming to lose weight
    'g' for gain - aiming to gain weight
* scale
Calculate ideal macronutrient ratios for a given weight and TDEE
macros(weight, targetTDEE, scale)

More details about parameters

* TDEE - total daily energy expenditure in calories (amount of energy your body burns in a day)

* lossOrGain
    'l' for loss - aiming to lose weight
    'g' for gain - aiming to gain weight

How to Install and Use this Package

  1. Navigate to your desired root directory and execute
pipenv install -i https://test.pypi.org/simple/ amIFat==1.0.5

(Prof B's note: if you've previously created a pipenv virtual environment in the same directory, you may have to delete the old one first. Find out where it is located with the pipenv --venv command.)

  1. Activate virtual environment with
pipenv shell
  1. Create a python program in the directory and import all the functions in the amIFat package with
from amIFat import macros, howfat, calories, fat_problems
  1. Implement the functions in your program and run it with
python3 yourProgram.py
  1. Exit the virtual environment with exit

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

amIFat-1.0.6.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

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

amIFat-1.0.6-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file amIFat-1.0.6.tar.gz.

File metadata

  • Download URL: amIFat-1.0.6.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for amIFat-1.0.6.tar.gz
Algorithm Hash digest
SHA256 32e29ee8dca06bdb496433beba0ad43f306c8258762502e3f2593c68ac666047
MD5 76dcfc0345258e8914b2e5f6b7d2cd32
BLAKE2b-256 b44f3c3ac980fb68533c1daaee1510bd849c1748d247f296722c16f3b5404e51

See more details on using hashes here.

File details

Details for the file amIFat-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: amIFat-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for amIFat-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0a130ceff99e8450b98e4a76965b0c7eb207952a181686a409b4dcfd5c2a265d
MD5 2c6d1baa8b2bc9c03d6f067a516a4ee3
BLAKE2b-256 6213d198c0a5cb52cbfa20dcf95010519315c8b2e02b3341c3b5d92a9bd53fe5

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