{"id":42319049,"url":"https://github.com/kmnhan/kafeteria","last_synced_at":"2026-01-27T12:35:03.390Z","repository":{"id":270779842,"uuid":"910334044","full_name":"kmnhan/kafeteria","owner":"kmnhan","description":"Asynchronously fetch today's menu for cafeterias in KAIST","archived":false,"fork":false,"pushed_at":"2026-01-07T07:27:50.000Z","size":286,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-09T04:34:19.793Z","etag":null,"topics":["cafeteria","kaist"],"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/kmnhan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-12-31T02:25:36.000Z","updated_at":"2026-01-07T07:27:54.000Z","dependencies_parsed_at":"2025-01-03T03:31:53.942Z","dependency_job_id":"4b6b7b59-bfc9-4e4d-8180-9d418800e25b","html_url":"https://github.com/kmnhan/kafeteria","commit_stats":null,"previous_names":["kmnhan/kafeteria"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kmnhan/kafeteria","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmnhan%2Fkafeteria","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmnhan%2Fkafeteria/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmnhan%2Fkafeteria/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmnhan%2Fkafeteria/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kmnhan","download_url":"https://codeload.github.com/kmnhan/kafeteria/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmnhan%2Fkafeteria/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cafeteria","kaist"],"created_at":"2026-01-27T12:35:03.311Z","updated_at":"2026-01-27T12:35:03.379Z","avatar_url":"https://github.com/kmnhan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kafeteria\n\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/kafeteria?logo=python\u0026logoColor=white)](https://pypi.org/project/kafeteria/)\n[![PyPi](https://img.shields.io/pypi/v/kafeteria?logo=pypi\u0026logoColor=white)](https://pypi.org/project/kafeteria/)\n[![CI](https://github.com/kmnhan/kafeteria/actions/workflows/ci.yml/badge.svg)](https://github.com/kmnhan/kafeteria/actions/workflows/ci.yml)\n\nKafeteria is a Python package to asynchronously access the menu of the cafeterias at KAIST.\n\nKAIST 학식 메뉴를 asyncio를 사용하여 불러올 수 있는 Python 패키지입니다.\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install kafeteria\n```\n\nIf you want optional Slack integration, install with the `slack` extra:\n\n```bash\npip install kafeteria[slack]\n```\n\n## Usage\n\nUse the `get_menu` function to get the menu for a specific cafeteria, or the `get_menus` function to get the menus for multiple cafeterias at once.\n\nValid cafeteria codes are:\n\n- `fclt` : 카이마루\n- `west` : 서측식당\n- `east1` : 동측 학생식당\n- `east2` : 동측 교직원식당\n- `emp` : 교수회관\n- `icc` : 문지캠퍼스\n- `hawam` : 화암 기숙사식당\n- `seoul` : 서울캠퍼스 구내식당\n\nHere's an example:\n\n```python\nimport asyncio\nimport datetime\nimport kafeteria\n\n\nasync def main():\n    # Get the menu for a specific cafeteria\n    menu = await kafeteria.get_menu(\"fclt\")\n    print(menu)\n\n    # Get the menu for a specific date\n    menu = await kafeteria.get_menu(\"fclt\", datetime.date(2025, 1, 3))\n    print(menu)\n\n    # Get the menus for multiple cafeterias at once\n    menus = await kafeteria.get_menus([\"fclt\", \"east1\", \"east2\"])\n    print(menus)\n\n\nasyncio.run(main())\n```\n\n## Slack Integration\n\nYou can also publish today's menu to a Slack channel using the `kafeteria.slack.publish` function.\n\nFirst, you need to [set up a Slack app](https://api.slack.com/quickstart#creating) with the `chat:write` permission. Once you have a bot set up with the necessary permissions, set the following environment variables:\n\n- `KAFETERIA_SLACK_BOT_TOKEN` (required): The bot token for the Slack app.\n\n- `KAFETERIA_SLACK_CHANNEL` (required): The channel ID to post the message to.\n\n  This can be found by right-clicking on the channel in the Slack app and selecting \"Copy link\". The channel ID is the last part of the URL.\n\n  For more information, see the [slack api documentation](https://api.slack.com/messaging/sending\u003e).\n\n- `KAFETERIA_MENU_TIME` (optional): The menu to send.\n\n  This can be one of 0, 1, 2, or 3. The behavior is as follows:\n\n  - 1: breakfast\n  - 2: lunch\n  - 3: dinner\n  - 0: default, automatically selects the menu based on the current time:\n\n    - breakfast: 19:30 - 09:00\n    - lunch: 09:00 - 14:00\n    - dinner: 14:00 - 19:30\n\n- `KAFETERIA_LIST` (optional): The list of cafeterias to send the menu for.\n\n  This should be a comma-separated list of cafeteria codes. By default, `fclt,west,east1,east2` is used.\n\n- `KAFETERIA_IGNORE_PROFONLY` (optional): Whether to ignore the \"professor only\" menu.\n\n  This flag is used to filter out the \"professor only\" (교수전용) menu from the list of menus. If enabled, all lines below a line that contains `교수전용` will be stripped from the menu. This can be set to `0` or `1`. By default, it is set to `1` (enabled).\n\nThen, you can publish the menu to a channel using `kafeteria.slack.publish()`:\n\n```python\nimport asyncio\nimport kafeteria.slack\n\nasyncio.run(kafeteria.slack.publish())\n```\n\nA shortcut function `kafeteria.slack.run_publish()` is provided for running in non-async environments.\n\n`kafeteria.slack.publish()` and `kafeteria.slack.run_publish()` takes an optional keyword-only parameter, `skip_holiday`, which, if set to `True`, skips publishing the menu when the current day is a holiday in Korea.\n\n### Automation\n\nSlack integration can be automated to publish the menu at a specific time every weekday using a scheduler. An example using [apscheduler](https://apscheduler.readthedocs.io/) is provided in the `kafeteria.scheduler` module, which can be started by running the following command:\n\n```bash\npython -m kafeteria.scheduler\n```\n\nIf you want to handle the automation in CI/CD, here is an example GitHub Actions workflow. Note that scheduled workflows may be delayed depending on the GitHub Actions server load.\n\n```yaml\nname: Publish Menu\n\non:\n  schedule:\n    # Every weekday at 11:30 AM GMT+9 (2:30 AM UTC)\n    - cron: \"30 2 * * 1-5\"\n\nenv:\n  KAFETERIA_SLACK_BOT_TOKEN: ${{ secrets.KAFETERIA_SLACK_BOT_TOKEN }} # Set in repository secrets\n  KAFETERIA_SLACK_CHANNEL: \"C0123456789\" # Replace with your channel ID\n  KAFETERIA_MENU_TIME: \"0\" # Automatically select the menu based on workflow run time\n  KAFETERIA_LIST: \"fclt,west,east1,east2\"\n\njobs:\n  publish:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Set up Python\n        uses: actions/setup-python@v5\n        with:\n          python-version: \"3.13\"\n\n      - name: Install dependencies\n        run: pip install kafeteria[slack]\n\n      - name: Publish menu\n        run: python -c 'import kafeteria.slack; kafeteria.slack.run_publish(skip_holiday=True)'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmnhan%2Fkafeteria","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkmnhan%2Fkafeteria","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmnhan%2Fkafeteria/lists"}