Restabot is a Python application that automates the process of fetching and summarizing restaurant menus.
cd {restabot_repo_dir}
uv sync
uv run playwright installpip install {restabot_repo_dir}
playwright installFor the pipeline to run, you will need to set the following environment variables:
GEMINI_API_KEY- Google Gemini API key - Gemini is used for OCR and summarizationSLACK_BOT_TOKEN- Token for posting to / downloading from SlackSLACK_CHANNEL_ID- Optional Slack channel to post to
If you store them in .env file, they will be automatically loaded.
Restaurant data is stored in a YAML file.
restaurants:
- id: "restaurant1"
name: "Restaurant 1"
url: "https://restaurant1.com/daily-menu"
- id: "restaurant2"
name: "Restaurant 2"
url: "slack://channel_id"Example of running the bot's pipeline - it makes screenshots, performs OCR on them, and generates a summary:
[uv run] python -m restabot.pipeline \
--sites data/restaurants.yaml \
--screenshots-dir data/screenshots \
--ocr-output data/parsed_menus.json \
--summary-output data/summary.mdFor development, install additional dependencies:
uv sync --extra devor
pip install -e ".[dev]"This includes:
- pytest for testing
- flake8 for code style checking
pipeline: Runs the entire menu fetching and processing pipelinemodel: Contains data models and configuration schemas using Pydantic
The restabot.task package contains specialized modules for different stages of menu processing:
screenshot: Captures screenshots of restaurant menu pages using Playwrightocr: Performs optical character recognition on menu imagessummary: Generates menu summaries using Google's Gemini AIslack_upload: Handles posting the processed menus to Slackslack_download: Limited support for dowloading menus from Slack - downloads the latest image posted to given channel
Key dependencies include:
- Playwright for web automation and screenshot capture
- Google Gemini AI for menu text analysis and summarization
- Slack SDK for posting results
- Pydantic for data validation and settings management
- PyYAML for configuration file parsing