Skip to content

apps / winecellar / backend / app / api / routers / label.py

Path: apps/winecellar/backend/app/api/routers/label.py
Lane: apps
Executable: no/unknown

Purpose

Component: label

Lane: apps

Path: apps/winecellar/backend/app/api/routers/label.py

Role: FastAPI Router

Purpose: - Defines 1 class(es) and 8 function(s) that implement this module's responsibilities. - Exposes API endpoints and request handlers through a FastAPI router.

Inputs: - HTTP request payloads/params handled through FastAPI routing.

Outputs: - Returns HTTP responses and status codes to API clients.

Execution: - Request-driven execution when mounted into the backend FastAPI app.

Failure modes: - Request validation errors or missing required request fields. - Type/shape mismatches passed into exported functions/classes. - Unexpected runtime state propagated from upstream callers.

Entry points

  • No __main__ guard detected

Key symbols

Classes

  • LabelParseOut

Functions

  • _extract_winery_from_text(text)
  • _guess_color(text, region)
  • _norm(v)
  • _titleish(s)
  • build_prefill_from_ai(ai_data, text, fallback)
  • build_prefill_from_basic(basic, text)
  • parse_basic(text)
  • parse_label(file, ai) [async]

Configuration & environment

  • (no env vars detected by regex)

Dependencies (imports)

  • __future__
  • core.config
  • fastapi
  • pydantic
  • re
  • services.ai_label_parser
  • services.vision_ocr
  • typing

Operational notes (fill in)

  • Headless/interactive:
  • Systemd unit (if any):
  • Schedules/triggers:
  • Debug artifacts:
  • Failure modes: