"""
Module 'profile_weight_diary.py' contains the following methods:
- https://platform.fatsecret.com/docs/v1/weight.update
- https://platform.fatsecret.com/docs/v2/weights.get_month
- https://platform.fatsecret.com/docs/v1/weights.get_month
and was generated on 21.11.2025 17:10.
"""
from pyfatsecret.fatsecret_base import FatsecretBase
[docs]
class ProfileWeightDiary(FatsecretBase):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
[docs]
def weight_update(self, current_weight_kg, date=None, weight_type=None, height_type=None, goal_weight_kg=None, current_height_cm=None, comment=None) -> dict:
"""
Records a user's weight for a nominated date.
First time weigh-ins require the goal_weight_kg and current_height_cm parameters.
Please note as per the API Terms of Use that it is your responsibility to ensure that the information generated by using the API is not be interpreted as a substitute for medical physician consultation, evaluation, or treatment.
Args:
current_weight_kg (Decimal): Current weight of the user in kilograms
date (Int, optional): Number of days since January 1, 1970 (default value is the current day)
weight_type (String, optional): Weight measurement type for this user profile. Valid types are "kg" and "lb" (default value is "kg")
height_type (String, optional): Height measurement type for this user profile. Valid types are "cm" and "inch" (default value is "cm")
goal_weight_kg (Decimal, optional): User's goal weight in kilograms
current_height_cm (Decimal, optional): Current height of the user in centimetres. This is required for the first weigh-in. You can only set this for the first time
comment (String, optional): A comment for this weigh-in
Returns:
dict: See https://platform.fatsecret.com/docs/v1/weight.update
"""
params = self.get_params(current_weight_kg=current_weight_kg, date=date, weight_type=weight_type,
height_type=height_type, goal_weight_kg=goal_weight_kg, current_height_cm=current_height_cm, comment=comment)
return self.make_request(method='weight.update', params=params)
[docs]
def weights_get_month_v2(self, date=None) -> dict:
"""
Returns the recorded weights for a user for the month specified. Use this call to display a user's weight chart or log of weight changes for a nominated month. The day elements returned are those where the user entered or updated their weight for the specified month. Days with no recorded weight are not included.
Args:
date (Int, optional): Number of days since January 1, 1970 (default value is the current day)
Returns:
dict: See https://platform.fatsecret.com/docs/v2/weights.get_month
"""
params = self.get_params(date=date)
return self.make_request(method='weights.get_month.v2', params=params)
[docs]
def weights_get_month(self, date=None) -> dict:
"""
Returns the recorded weights for a user for the month specified. Use this call to display a user's weight chart or log of weight changes for a nominated month. The day elements returned are those where the user entered or updated their weight for the specified month. Days with no recorded weight are not included.
Args:
date (Int, optional): Number of days since January 1, 1970 (default value is the current day)
Returns:
dict: See https://platform.fatsecret.com/docs/v1/weights.get_month
"""
params = self.get_params(date=date)
return self.make_request(method='weights.get_month', params=params)