Skip to main content

fasterfoodsstack (Python)

SDK for writing FasterFoods recommendation algorithms in Python.

Install

pip install fasterfoodsstack

Or from source:

cd python/
pip install -e .

Quickstart

import fasterfoodsstack as ffs
from fasterfoodsstack import run_local

# Set your dev API key once (or use the FASTERFOODS_API_KEY env var)
ffs.configure(api_key="ffs-dev-...")

# Write your recommendation algorithm
def get_meal_recommendation(user):
    remaining = user.goals.calories - (user.meals.last.calories if user.meals.last else 0)

    if user.goals.goal_type == "gain_muscle":
        return ffs.recommend.meal(
            name="Grilled Chicken Bowl",
            reason=f"{remaining} kcal remaining — prioritising protein for muscle gain",
            calories=720,
            protein_g=60.0,
            tags=["high-protein", "meal-prep"],
        )

    return ffs.recommend.meal(
        name="Tuna & Quinoa Salad",
        reason=f"{remaining} kcal remaining today",
        calories=480,
        protein_g=42.0,
        tags=["high-protein", "low-carb"],
    )

# Fetch a pre-seeded test profile from the dev environment and run locally
ctx = ffs.dummy.athlete()
result = run_local(get_meal_recommendation, ctx)
# -> prints timing, validates return type, prints result fields

# Available profiles: athlete(), weight_loss(), starter(), family()
ctx = ffs.dummy.weight_loss()
result = run_local(get_meal_recommendation, ctx)

API reference

ffs.user (runtime, injected by platform)

Attribute Type Description
ffs.user.profile.dietary_flags list[str] e.g. ["vegetarian", "gluten-free"]
ffs.user.meals.last Meal | None Most recently logged meal
ffs.user.meals.history(days=7) list[Meal] Meals in the last N days
ffs.user.meals.favorites list[Meal] User's favourite meals
ffs.user.goals.calories int Daily calorie target
ffs.user.goals.protein_g float Daily protein target (grams)
ffs.user.goals.carbs_g float Daily carbs target (grams)
ffs.user.goals.fat_g float Daily fat target (grams)
ffs.user.goals.goal_type str "lose_weight" | "maintain" | "gain_muscle"

ffs.recommend

ffs.recommend.meal(
    name: str,
    reason: str,
    calories: int,
    protein_g: float,
    tags: list[str] = [],
) -> MealRecommendation

ffs.recommend.workout(
    type: str,          # "strength" | "cardio" | "flexibility" | "rest"
    duration_minutes: int,
    reason: str,
) -> WorkoutRecommendation

ffs.dummy

Fetches pre-seeded test user contexts from the FasterFoods dev environment. Each call makes an authenticated API request and returns a user context with the same shape as the runtime user namespace.

ctx = ffs.dummy.athlete()      # high-calorie, gain_muscle
ctx = ffs.dummy.weight_loss()  # caloric deficit, gluten-free
ctx = ffs.dummy.starter()      # balanced beginner, maintain
ctx = ffs.dummy.family()       # vegetarian, maintain

ffs.configure(api_key, base_url=None)

Sets the API key for all SDK calls. Call once at startup, or set FASTERFOODS_API_KEY in your environment instead.

run_local(fn, context)

Runs your function with a fetched user context, prints timing and the result, validates the return type.

Metadata

Release files for fasterfoodsstack 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fasterfoodsstack 0.1.0
File Size Uploaded
fasterfoodsstack-0.1.0.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fasterfoodsstack 0.1.0
File Interpreter ABI Platform
fasterfoodsstack-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.6 kB

Release files / fasterfoodsstack-0.1.0.tar.gz

Download URL fasterfoodsstack-0.1.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f893180830491ce0a98e504a01033d7b9229333975089e3a102f20efcc52718e
BLAKE2b-256 checksum
How to use checksums
8a8132b9e0d1f483d1c3b52a04bd8ea873bc37df102aa0fde002cd0d2601fadc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

Release files / fasterfoodsstack-0.1.0-py3-none-any.whl

Download URL fasterfoodsstack-0.1.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c87df21d7849de082ba8d552cd21e31a3638bd10887b852d1d97cf3df3c52677
BLAKE2b-256 checksum
How to use checksums
d2f2e27606ab286243c5305b340c6c993b711836eafea412c31e19b48331b811
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page