No description
  • Python 91.9%
  • Dockerfile 8.1%
Find a file
2026-01-03 15:06:19 +01:00
app migrate from requirements to uv.lock 2026-01-03 15:03:18 +01:00
.gitignore Added: parsing for matomo config 2022-11-04 22:35:28 +01:00
Dockerfile migrate from requirements to uv.lock 2026-01-03 15:03:18 +01:00
LICENSE Initial Commit: Moved code from uniulm_mensaparser to here 2022-11-04 18:59:20 +01:00
pyproject.toml migrate from requirements to uv.lock 2026-01-03 15:03:18 +01:00
README.md docs: fixes api link 2024-06-21 23:13:23 +02:00
uv.lock upgrade lockfile 2026-01-03 15:06:19 +01:00

Uni Ulm Mensa Plan REST API

This project contains a REST API that provides data from the Tanikai/uniulm_mensaparser module.

The parsed data can be accessed here: uulm.anter.dev/api/v1/canteens/all

Getting Started

These instructions will give you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on deploying the project on a live system.

Prerequisites

This project is tested and deployed with Python 3.9+. It might work with lower versions, but without guarantee.

Installing

Firstly, clone this repository and install the required Python modules:

git clone https://github.com/Tanikai/uniulm_mensa_api.git
cd uniulm_mensa_api
pip install -r requirements.txt

After that, you can run the REST API with:

uvicorn app.main:app --reload

Deployment

When you want to deploy the application, you will need a WSGI server. For example, you can use the waitress module:

uvicorn app.main:app --reload

API Documentation

The following canteens at Ulm University are currently supported:

  • Mensa Süd (id: ul_uni_sued)
  • Mensa West (id: ul_uni_west)

Support for Mensa Nord (Bistro) is planned.

Path Description
BASE_URL/api/v1/canteens/CANTEEN_ID/ Get the next daily plan for the specified canteen (days where the canteen is closed are skipped)
BASE_URL/api/v1/canteens/CANTEEN_ID/days/YYYY-MM-DD/meals Get the canteen plan for a specific day
BASE_URL/api/v1/canteens/CANTEEN_ID/all Get all plans for the specified canteen
BASE_URL/api/v1/mensaplan.json Data in FS-ET format (work in progess)

Analytics

To track the API usage in a GDPR-friendly way, a Middleware for Matomo is integrated into the project. Alternatively, you can use Umami. Both are disabled by default.

To enable analytics, set the respective _ENABLED variable to True and pass the required configuration values:

# Matomo
MATOMO_ENABLED=True
MATOMO_URL=YOUR_MATOMO_URL
MATOMO_SITE_ID=YOUR_MATOMO_SITE_ID

# Umami
UMAMI_ENABLED=True
UMAMI_URL=YOUR_UMAMI_URL
UMAMI_SITE_ID=YOUR_UMAMI_SITE_ID

Authors

License

This project is licensed under the GNU General Public License Version 3 - see the LICENSE file for details