Skip to content

Tanikai/uniulm_mensa_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

REST API for Canteen / Mensa plans at Ulm University

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published