{"id":32520653,"url":"https://github.com/luka-loehr/receipt-ai","last_synced_at":"2026-04-17T04:32:50.148Z","repository":{"id":316270023,"uuid":"1048003195","full_name":"luka-loehr/receipt-ai","owner":"luka-loehr","description":"Personalized German morning briefings for thermal printers with real-time Google Calendar, Gmail, and AI insights. Perfect for your morning coffee ritual!","archived":false,"fork":false,"pushed_at":"2025-09-24T12:37:22.000Z","size":1985,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-28T05:30:55.636Z","etag":null,"topics":["ai","automation","calendar","daily-briefing","esc-pos","gmail","openai","python","thermal-printer","weather"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luka-loehr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-31T17:48:55.000Z","updated_at":"2025-09-24T12:37:26.000Z","dependencies_parsed_at":"2025-09-25T21:03:41.251Z","dependency_job_id":null,"html_url":"https://github.com/luka-loehr/receipt-ai","commit_stats":null,"previous_names":["luka-loehr/receipt-ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luka-loehr/receipt-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luka-loehr%2Freceipt-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luka-loehr%2Freceipt-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luka-loehr%2Freceipt-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luka-loehr%2Freceipt-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luka-loehr","download_url":"https://codeload.github.com/luka-loehr/receipt-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luka-loehr%2Freceipt-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31915171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","automation","calendar","daily-briefing","esc-pos","gmail","openai","python","thermal-printer","weather"],"created_at":"2025-10-28T05:27:10.312Z","updated_at":"2026-04-17T04:32:50.142Z","avatar_url":"https://github.com/luka-loehr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧾 Receipt Printer\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)\n[![OpenAI](https://img.shields.io/badge/OpenAI-API-green.svg)](https://platform.openai.com/)\n[![Thermal Printer](https://img.shields.io/badge/ESC--POS-compatible-lightgrey.svg)](#)\n\n**AI-powered daily briefings — printed to your thermal receipt printer.**\n\nGenerate multilingual summaries from your Gmail, Calendar, Tasks, and weather data. Everything is personalized, culturally adapted, and printed using ESC/POS printers.\n\n---\n\n## ✨ Features\n\n- 🌐 **Multilingual AI** — Any language, culture-aware formatting\n- 📬 **Google Integration** — Gmail, Calendar, Tasks\n- ☀️ **Weather Data** — OpenWeatherMap integration\n- 🖨️ **ESC/POS Support** — USB, network, or file-based printing\n- 🖼️ **Multiple Outputs** — PNG preview, plain text, ESC/POS commands\n- ⚙️ **Fully Configurable** — Easy .env setup\n\n---\n\n## 🚀 Quick Start\n\n```bash\ngit clone https://github.com/luka-loehr/receipt-printer.git\ncd receipt-printer\npython3 -m venv venv\nsource venv/bin/activate  # Windows: venv\\Scripts\\activate\npip install -r requirements.txt\ncp env.example .env\n```\n\n1. Fill in `.env` with your API keys \u0026 preferences\n2. Setup Google Cloud: enable Gmail, Calendar, Tasks API + OAuth creds  \n3. Place OAuth JSON file into `cloud_credentials/`\n4. Run initial auth:  \n   ```bash\n   python3 oauth_setup.py\n   ```\n5. (Optional) Setup USB printer:  \n   ```bash\n   python3 printer_setup.py\n   ```\n6. Generate your daily briefing:  \n   ```bash\n   python3 daily_brief.py\n   ```\n\n---\n\n## ⚙️ Configuration\n\n| Variable              | Description                             | Default           |\n|----------------------|-----------------------------------------|-------------------|\n| `USER_NAME`          | Personalization                         | `Luka`            |\n| `RECEIPT_LANGUAGE`   | AI response language                    | `german`          |\n| `USER_TIMEZONE`      | Your timezone                          | `Europe/Berlin`   |\n| `WEATHER_LOCATION`   | Weather city \u0026 country                 | `Karlsruhe,DE`    |\n| `THERMAL_PRINTER_TYPE`| `usb`, `network`, or `file_test`       | `file_test`       |\n| `PREVIEW_PNG`        | Auto-open preview                      | `true`            |\n| `PRINTER_CONSOLE_HOST`| Printer Console bind host               | `127.0.0.1`       |\n| `PRINTER_CONSOLE_PORT`| Printer Console port (uncommon)         | `8765`            |\n| `PRINTER_CONSOLE_DEBUG`| Enable Flask debug mode                | `false`           |\n\n---\n\n## 🗂️ Project Structure\n\n```txt\nreceipt-printer/\n├── daily_brief.py         # Main script\n├── oauth_setup.py         # Google OAuth flow\n├── printer_setup.py       # USB printer config\n├── src/\n│   ├── daily_brief.py     # Summary generation\n│   ├── data_services.py   # Gmail, Calendar, Weather\n│   ├── thermal_printer.py # ESC/POS logic\n│   └── ...\n├── outputs/               # PNG, TXT, ESC/POS files\n├── cloud_credentials/     # OAuth JSON file\n```\n\n---\n\n## 🧪 Requirements\n\n- ✅ Python 3.8+\n- ✅ OpenAI API key  \n- 🔄 Google Cloud Project (OAuth2 + APIs enabled)  \n- 🌦️ OpenWeatherMap API (optional)  \n- 🖨️ Any ESC/POS-compatible thermal printer (USB, network)\n\n---\n\n## 🛠 Troubleshooting\n\n- **No printer found**: Try `printer_setup.py` and check USB power\n- **OAuth fails**: Recheck `.json` in `cloud_credentials/` and enabled APIs\n- **Empty output**: Validate your OpenAI key and internet connection\n\n---\n\n## 🖨️ Print Custom Text\n\nUse the helper script to print arbitrary text.\n\nInteractive (paste a single line, then press Enter):\n\n```bash\npython3 scripts/print_text.py\n```\n\nPass text as CLI arguments:\n\n```bash\npython3 scripts/print_text.py \"Hello world\"\n```\n\nPipe multi-line input:\n\n```bash\nprintf \"Line 1\\nLine 2\\n\" | python3 scripts/print_text.py\n```\n\nNote (file transport → CUPS): If your `.env` uses a file-based printer (`THERMAL_PRINTER_TYPE=file` or `file_test`), the script writes ESC/POS to `PRINTER_FILE_PATH` and, when `CUPS_PRINTER` is set, auto-forwards it to CUPS using `lp -o raw` (same behavior as the daily brief).\n\n---\n\n## 🤝 Contributing\n\n```bash\n# 1. Fork \u0026 clone the repo\n# 2. Create a new feature branch\n# 3. Make and test your changes\n# 4. Submit a PR 🙌\n```\n\n---\n\n## 📄 License\n\nMIT License — see [`LICENSE`](LICENSE) file.\n\n---\n\n## 💬 Support \u0026 Feedback\n\n- [GitHub Issues](https://github.com/luka-loehr/receipt-printer/issues)\n- [Discussions](https://github.com/luka-loehr/receipt-printer/discussions)\n\n---\n\n## 🖥️ Printer Console (Always-On UI)\n\nRun a local UI to trigger the daily brief and quick text prints.\n\nStart the console:\n\n```bash\npython3 -m src.server_app\n```\n\nEnvironment variables:\n\n- `PRINTER_CONSOLE_HOST`: default `127.0.0.1`\n- `PRINTER_CONSOLE_PORT`: default `8765` (uncommon to avoid conflicts)\n- `PRINTER_CONSOLE_DEBUG`: `true/false`\n\nThen open `http://127.0.0.1:8765/` (or your configured host/port).\n\n### Autostart on boot (systemd user service)\n\nYou can create a systemd user service to start the console on login/boot. Example unit:\n\n```ini\n[Unit]\nDescription=Receipt Printer Console\nAfter=network-online.target\n\n[Service]\nType=simple\nEnvironment=PYTHONUNBUFFERED=1\nEnvironment=PRINTER_CONSOLE_HOST=127.0.0.1\nEnvironment=PRINTER_CONSOLE_PORT=8765\nWorkingDirectory=%h/Documents/receipt-printer\nExecStart=%h/Documents/receipt-printer/venv/bin/python -m src.server_app\nRestart=on-failure\n\n[Install]\nWantedBy=default.target\n```\n\nSave to `~/.config/systemd/user/receipt-printer-console.service`, then run:\n\n```bash\nsystemctl --user daemon-reload\nsystemctl --user enable receipt-printer-console.service\nsystemctl --user start receipt-printer-console.service\nsystemctl --user status receipt-printer-console.service\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluka-loehr%2Freceipt-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluka-loehr%2Freceipt-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluka-loehr%2Freceipt-ai/lists"}