healthsciencecalculator.get_bmi =============================== .. py:module:: healthsciencecalculator.get_bmi Classes ------- .. autoapisummary:: healthsciencecalculator.get_bmi.BMIResult Functions --------- .. autoapisummary:: healthsciencecalculator.get_bmi.get_bmi Module Contents --------------- .. py:class:: BMIResult .. py:attribute:: bmi :type: float .. py:attribute:: category :type: str .. py:function:: get_bmi(weight: float, height: float) -> BMIResult Calculate Body Mass Index (BMI) and return detailed classification information. BMI is calculated as weight (kg) divided by height (m) squared. :param weight: Weight in kilograms :type weight: float :param height: Height in meters :type height: float :returns: A dataclass containing: - bmi (float): The calculated BMI value - category (str): BMI category, one of: - 'underweight' (BMI < 18.5) - 'healthy' (BMI 18.5-24.9) - 'overweight' (BMI 25-29.9) - 'class 1 obesity' (BMI 30-34.9) - 'class 2 obesity' (BMI 35-39.9) - 'class 3 obesity' (BMI >= 40) :rtype: BMIResult .. rubric:: Example >>> get_bmi(weight=70.0, height=1.75) BMIResult(bmi=22.9, category='healthy') :raises ValueError: If weight or height is not positive :raises TypeError: If weight or height is not a number