Skip to content

Recipe

Access recipe information from FIO.

Recipe

Bases: AbstractRecipe, AbstractEndpoint

get

get(material_ticker, timeout=None)

Gets all recipes for given material from FIO

Parameters:

Name Type Description Default
material_ticker str

Material Ticker (e.g. "FE")

required
timeout float

Request timeout in seconds. Defaults to None.

None

Returns:

Name Type Description
MaterialRecipeList MaterialRecipeList

List of Recipes as List[MaterialRecipeList]

Source code in fio_wrapper/endpoints/endpoints_v1/recipe.py
def get(
    self, material_ticker: str, timeout: Optional[float] = None
) -> MaterialRecipeList:
    """Gets all recipes for given material from FIO

    Args:
        material_ticker (str): Material Ticker (e.g. "FE")
        timeout (float, optional): Request timeout in seconds. Defaults to None.

    Returns:
        MaterialRecipeList: List of Recipes as List[MaterialRecipeList]
    """
    (_, data) = self.adapter.get(
        endpoint=self.urls.recipe_get_url(material_ticker=material_ticker),
        timeout=timeout,
    )

    return MaterialRecipeList.model_validate(data)

all

all(timeout=None)

Gets all recipes from FIO

Parameters:

Name Type Description Default
timeout float

Request timeout in seconds. Defaults to None.

None

Returns:

Name Type Description
RecipeList RecipeList

List of Recipes as List[RecipeList]

Source code in fio_wrapper/endpoints/endpoints_v1/recipe.py
def all(self, timeout: Optional[float] = None) -> RecipeList:
    """Gets all recipes from FIO

    Args:
        timeout (float, optional): Request timeout in seconds. Defaults to None.

    Returns:
        RecipeList: List of Recipes as List[RecipeList]
    """
    (_, data) = self.adapter.get(
        endpoint=self.urls.recipe_get_all_url(), timeout=timeout
    )

    return RecipeList.model_validate(data)