TRIAL 2026-11-18
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Travis Johnson 0d3caa8fac Seed restaurant menus (6 chains, city-level locations)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X3rSFQDJYjX6bGw3aeA4iy
2026-10-28 00:48:43 -05:00
data/restaurants Seed restaurant menus (6 chains, city-level locations) 2026-10-28 00:48:43 -05:00
src/noms noms: POS-style menu schema, dairy/calorie roulette CLI + FastAPI, tests 2026-10-28 00:48:43 -05:00
tests noms: POS-style menu schema, dairy/calorie roulette CLI + FastAPI, tests 2026-10-28 00:48:43 -05:00
.gitignore noms: POS-style menu schema, dairy/calorie roulette CLI + FastAPI, tests 2026-10-28 00:48:43 -05:00
LICENSE noms: POS-style menu schema, dairy/calorie roulette CLI + FastAPI, tests 2026-10-28 00:48:43 -05:00
pyproject.toml noms: POS-style menu schema, dairy/calorie roulette CLI + FastAPI, tests 2026-10-28 00:48:43 -05:00
README.md noms: POS-style menu schema, dairy/calorie roulette CLI + FastAPI, tests 2026-10-28 00:48:43 -05:00
uv.lock noms: POS-style menu schema, dairy/calorie roulette CLI + FastAPI, tests 2026-10-28 00:48:43 -05:00

noms

CLI menu roulette + dairy/calorie tracker over cached, refreshable restaurant data.

Pick a place, pick a dish, or let it roll for you — filtered to what you can actually eat (dairy-aware, with provenance), and log where you went even when you don't remember what you ate.

Why the schema looks like a POS system

"Regular vs Small with different calories" and "safe if you ask for no cheese" are the same problem every restaurant point-of-sale solves. An item has:

  • variants — sizes/portions, each with its own nutrition (Regular / Small)
  • modifier groups — choices that shift calories and dietary flags (protein swap, "no cheese", "add guac")

So the dairy verdict can be computed ("safe IF you skip the cheese modifier") and carries provenance: OFFICIAL_ALLERGEN > OFFICIAL_MENU > STAFF_CONFIRMED > ASSUMED > UNCONFIRMED. refresh re-pulls calories/prices from the source URL but never clobbers a human-verified dairy verdict.

DairyStatus:  SAFE_AS_IS  ·  SAFE_WITH_MOD  ·  CONTAINS  ·  UNKNOWN

Install / run

cd noms
uv sync                      # core CLI
uv sync --extra api          # + FastAPI service

uv run noms list             # what's cached, freshness, % dairy-edible
uv run noms show noodles_and_co --dairy safe
uv run noms roll                              # roll restaurant + dish (dairy-safe default)
uv run noms roll chipotle --max-cal 700       # roll within one place, calorie cap
uv run noms roll --tag vegetarian --n 3 --log # 3 picks, log them
uv run noms roll cava                         # → "👉 hold the tzatziki, feta"
uv run noms guess "rice, beans, chicken, cheese, sour cream — 600 cal"  # classify pasted text
uv run noms log "McAlister's" -n "team lunch, didn't track item"   # item-less visit
uv run noms log mcalisters --item "Sweet Tea"  # auto-fills cal/dairy from cache
uv run noms history
uv run noms stats
uv run noms refresh noodles_and_co            # re-fetch + merge (preserves dairy work)
uv run noms serve                             # FastAPI on :8723

Data

data/restaurants/<slug>.yaml — one file per restaurant, editable by hand. Override the location with NOMS_DATA_DIR. The eat log is append-only JSONL at <data_dir>/log.jsonl.

Seeded with Noodles & Company, LoLo's Bowls, McAlister's Deli, Chipotle, CAVA, and sweetgreen — chosen to exercise every schema corner (multi-size variants, protein modifier groups, all four dairy states, default-on dairy modifiers that drive the "hold the ___" advice, and mixed confidence). Calories are chain-published-approximate; dairy verdicts cross-checked against allergen guides where available.

noms guess — heuristic classifier

Paste an ingredient list / description and get a dairy verdict + any calories it can scrape from the text. Same engine refresh uses; always ASSUMED confidence, so verify before trusting:

noms guess "spiralized zucchini, tamarind sauce, peanuts, 410 calories" --name "zoodle thai"
# zoodle thai  ✓ safe (assumed) — no dairy keywords found · calories detected: regular 410

"hold the ___" advice

When a SAFE_WITH_MOD item carries modifier options flagged sets_dairy: CONTAINS, default: true, roll/show compute the removal list instead of relying on a hand-typed note — e.g. CAVA's Greek Bowl → 👉 hold the tzatziki, feta. SAFE_AS_IS items with optional (default-off) dairy add-ons get the inverse: safe as-is — just skip optional ___.

API

GET /restaurants · GET /restaurants/{slug} · GET /roll?dairy=safe&max_cal=700 · POST /log · GET /log · GET /stats

Stack

uv · Typer (Click under the hood, by the FastAPI author) · Rich (dense tables) · Pydantic v2 (the schema) · httpx + selectolax (scrape) · FastAPI (optional service).