#!/usr/bin/env python import enum from math import ceil import click MALE = "male" FEMALE = "female" CUT = "cut" MAINTAIN = "maintain" BULK = "bulk" MACROS = { MALE : { CUT: { "protein": 1.25, "carbs": 1, "fat": 0.27 }, MAINTAIN: { "protein": 1.15, "carbs": 1.25, "fat": 0.35 }, BULK: { "protein": 1.1, "carbs": 2, "fat": 0.5 } }, FEMALE: { CUT: { "protein": 1.15, "carbs": 0.9, "fat": 0.35 }, MAINTAIN: { "protein": 1.1, "carbs": 1.2, "fat": 0.38 }, BULK: { "protein": 1, "carbs": 1.6, "fat": 0.5 } }, } @click.command() @click.option("--weight", "-w", help="Weight in pounds", type=click.INT, prompt=True) @click.option("--gender", "-g", help="Person's gender", type=click.Choice((MALE, FEMALE)), prompt=True) @click.option("--mode", "-m", help="Weight administration regime", type=click.Choice((CUT, MAINTAIN, BULK)), prompt=True) def main(weight, gender, mode): config = MACROS[gender][mode] print("Counted macros for {}ing:".format(mode)) for macro in config: print("\t{macro}: {amount:d} grams".format(macro=macro, amount=ceil(weight*config[macro]))) if __name__ == "__main__": main()