Models¶
pyhellofresh.TokenResponse
dataclass
¶
TokenResponse(
access_token: str,
token_type: str = "Bearer",
expires_in: int = 1800,
refresh_token: str | None = None,
refresh_expires_in: int | None = None,
issued_at: int | None = None,
public_id: str | None = None,
user_data: dict[str, Any] = dict(),
)
OAuth / Passwordless Token Response object.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> TokenResponse
Parse TokenResponse from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.Profile
dataclass
¶
Profile(
total_people: int = 0,
adults: int = 0,
children: int = 0,
exclusions: list[str] = list(),
dietary_preferences: list[str] = list(),
cuisines: dict[str, int] = dict(),
meal_types: list[str] = list(),
)
Customer profile details including dietary preferences and household size.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> Profile
Parse Profile from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.AccountBalance
dataclass
¶
AccountBalance(
amount: int = 0,
cash: int = 0,
bonus: int = 0,
currency_code: str = "GBP",
restricted_amount: int = 0,
cancellable_credits: int = 0,
)
Customer credit balance details.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> AccountBalance
Parse AccountBalance from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.PastDeliveryItem
dataclass
¶
PastDeliveryItem(
week: str,
menu_id: str | None = None,
meals: list[dict[str, Any]] = list(),
addons: list[dict[str, Any]] = list(),
cutoff_date: str | None = None,
delivery_date: str | None = None,
status: str | None = None,
)
One week from the customer delivery schedule.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> PastDeliveryItem
Parse PastDeliveryItem from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.PastDeliveries
dataclass
¶
PastDeliveries(
weeks: list[PastDeliveryItem] = list(),
next_week: str | None = None,
)
Collection of past box deliveries.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> PastDeliveries
Parse PastDeliveries from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.RecipeAllergen
dataclass
¶
RecipeAllergen(
id: str,
name: str,
type: str | None = None,
slug: str | None = None,
icon_link: str | None = None,
)
Recipe allergen information.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> RecipeAllergen
Parse RecipeAllergen from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.RecipeIngredient
dataclass
¶
RecipeIngredient(
id: str,
name: str,
uuid: str | None = None,
type: str | None = None,
slug: str | None = None,
image_link: str | None = None,
shipped: bool = True,
)
Recipe ingredient details.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> RecipeIngredient
Parse RecipeIngredient from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.RecipeNutrition
dataclass
¶
Recipe nutrition component.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> RecipeNutrition
Parse RecipeNutrition from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.RecipeStep
dataclass
¶
RecipeStep(
index: int,
instructions: str,
utensils: list[str] = list(),
timers: list[dict[str, Any]] = list(),
)
Step-by-step preparation instruction.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> RecipeStep
Parse RecipeStep from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.Recipe
dataclass
¶
Recipe(
id: str,
name: str,
headline: str = "",
description: str = "",
difficulty: int = 1,
prep_time: str | None = None,
total_time: str | None = None,
image_link: str | None = None,
website_url: str | None = None,
allergens: list[RecipeAllergen] = list(),
ingredients: list[RecipeIngredient] = list(),
steps: list[RecipeStep] = list(),
nutrition: list[RecipeNutrition] = list(),
yields: list[dict[str, Any]] = list(),
)
Full HelloFresh Recipe definition.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> Recipe
Parse Recipe from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.Meal
dataclass
¶
Meal(
recipe_family: str | None = None,
index: int = 0,
charge: float = 0.0,
quantity: int = 0,
recipe: Recipe | None = None,
related_category: str | None = None,
)
Meal entry inside a weekly menu.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> Meal
Parse Meal from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.WeeklyMenu
dataclass
¶
WeeklyMenu(
id: str,
week: str,
meals_ready: bool = True,
meals: list[Meal] = list(),
add_ons: dict[str, Any] = dict(),
categories: dict[str, Any] = dict(),
)
Weekly menu containing available meals and add-ons.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> WeeklyMenu
Parse WeeklyMenu from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.CartProduct
dataclass
¶
CartProduct(
handle: str,
unit_price: float = 0.0,
paid_price: float = 0.0,
quantity: int = 1,
shipping_amount: float = 0.0,
tax_amount: float = 0.0,
)
Cart product item.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> CartProduct
Parse CartProduct from raw API dictionary.
Source code in src/pyhellofresh/models.py
pyhellofresh.CartPrice
dataclass
¶
CartPrice(
coupon_code: str = "",
grand_total: float = 0.0,
sub_total: float = 0.0,
shipping_amount: float = 0.0,
tax_amount: float = 0.0,
discount_amount: float = 0.0,
products: list[CartProduct] = list(),
)
Cart pricing calculation result.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> CartPrice
Parse CartPrice from raw API dictionary.