How pathway-platform/menu-parser works
menu-parser is a FastAPI service that turns restaurant menu URLs into persisted menu items, generated recipes and canonical ingredient rollups, then USDA-backed price and trend snapshots. Its main user workflow is three API operations: parse a menu, generate recipes from stored menu items, and retrieve ingredient pricing. A separate discovery command builds the ingredient-to-USDA report mapping used by pricing. The graph reflects the sampled route orchestration and service behavior; discovery-to-pricing mapping use is documented in the README.
Main entry points: routes.py API routes · usda_discovery.py USDA report discovery · pricing.py Pricing and trend computation · recipe.py Recipe and ingredient generation
Components 18
HTTP API
- FastAPI application
app/main.py - API routes
app/api/routes.py - Request and response schemas
app/schemas.py
Menu extraction
- Browser scraper
app/services/scraper.py - Rendered menu HTML
app/services/scraper.py - Menu item extractor
app/services/extractor.py
Recipes and ingredients
- Recipe and ingredient generation
app/services/recipe.py
Pricing and discovery
- Pricing and trend computation
app/services/pricing.py - USDA ingredient mapping
app/services/pricing.py - USDA report discovery
scripts/usda_discovery.py - Ingredient keywords
ingredient_keywords.yaml
Persistence
- Menu item storage
app/services/storage.py - Ingredients and recipes
- Postgres database
Other components
- Restaurant menu site
- API client
- OpenAI API
- USDA AMS Market News
Connections 21
- API client → FastAPI application: sends requests
README.md - FastAPI application → API routes: registers routes
app/main.py - API routes → Request and response schemas: uses schemas
app/api/routes.py - API routes → Browser scraper: renders URL
app/api/routes.py - Restaurant menu site → Browser scraper: serves page
app/services/scraper.py - Browser scraper → Rendered menu HTML: saves HTML
app/services/scraper.py - API routes → Menu item extractor: extracts items
app/api/routes.py - Menu item extractor → OpenAI API: queries model
app/services/extractor.py - API routes → Menu item storage: saves items
app/api/routes.py - Menu item storage → Postgres database: writes menu items
app/services/storage.py - API routes → Recipe and ingredient generation: generates recipes
app/api/routes.py - Recipe and ingredient generation → OpenAI API: generates and normalizes
app/services/recipe.py - Recipe and ingredient generation → Postgres database: reads menu, writes rollups
app/services/recipe.py - API routes → Pricing and trend computation: computes pricing
app/api/routes.py - Pricing and trend computation → Postgres database: reads ingredients, saves snapshot
app/services/pricing.py - Pricing and trend computation → USDA ingredient mapping: loads mapping
README.md - Pricing and trend computation → USDA AMS Market News: fetches price series
app/services/pricing.py - USDA report discovery → Postgres database: reads ingredients
README.md - USDA report discovery → Ingredient keywords: loads keywords
scripts/usda_discovery.py - USDA report discovery → USDA AMS Market News: samples reports
scripts/usda_discovery.py - USDA report discovery → USDA ingredient mapping: writes mapping
README.md