Skip to main content

A parser for the canteen / Mensa plans at Ulm University

Project description

Uni Ulm Mensa Parser

This project contains a parser for the canteen / Mensa plans at Ulm University that are provided on the Studierendenwerk Ulm website. You can see the data in action on the UUlm Mensaplan website.

For an example of parsed data, see the following REST API endpoint: https://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.

Prerequisites

This project is tested and deployed with Python 3.9+. The dependencies require Python 3.8+.

Integration into your own project

You can install the module from PyPI:

pip install uniulm-mensaparser

After installing, you can use the parser like this:

from uniulm_mensaparser import get_plan, Canteen, SimpleAdapter2

# use get_plan() to get plans of all supported canteens
plan = get_plan()
print(plan)

# specify which canteen plans you want to be parsed in a set
my_canteens = {Canteen.UL_UNI_Sued}
# pass an adapter class for a different output format
plan = get_plan(my_canteens, adapter_class=SimpleAdapter2)
print(plan)

Development

Installation

If you want to extend the functionality of this library (e.g. implementing a new Adapter or PDF parser), you can clone this repository and install the required Python modules:

git clone https://github.com/Tanikai/uniulm_mensaparser.git
cd uniulm_mensaparser
uv sync

Tooling

This project uses uv for dependency management, ruff for linting and formatting, and ty for type checking.

To format and lint the code, run:

uvx ruff format .
uvx ruff check . --fix

To run the type checks:

uv run ty check

To run the tests:

uv run pytest

MaxManager API endpoint

The following curl command sends a request to the new endpoint. Remember to replace the date with the current date.

curl -X POST 'https://sw-ulm-spl51.maxmanager.xyz/inc/ajax-php_konnektor.inc.php?func=make_spl&locId=1&date=2023-07-20&lang=de&startThisWeek=2023-07-17&startNextWeek=2023-07-24'

Built With

  • BeautifulSoup to parse the canteen plan from the Studierendenwerk Ulm website
  • aiohttp for asynchronous HTTP requests

Authors

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uniulm_mensaparser-1.0.1.tar.gz (156.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uniulm_mensaparser-1.0.1-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file uniulm_mensaparser-1.0.1.tar.gz.

File metadata

  • Download URL: uniulm_mensaparser-1.0.1.tar.gz
  • Upload date:
  • Size: 156.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uniulm_mensaparser-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f290cc617428f59a4597f9e14ce20f6f4802cebc1a5dbba32f30bbe6aa978e79
MD5 ffdbb66e055eb7e22b3ed06d399f425f
BLAKE2b-256 e0dbdd17af8604ad8b50f1337d716b577cc451bdfbf296a385d07e15ab790352

See more details on using hashes here.

File details

Details for the file uniulm_mensaparser-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: uniulm_mensaparser-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uniulm_mensaparser-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61f0bd3d04ae67c5fad415dab63b49b3a6ef86a4213a8eb864148ed4ec94823b
MD5 b2e05fe2b44d5b1287b08926c2c891a6
BLAKE2b-256 5e348b04b12f03c40d6820acfedc5874f45e3b0bbc923c65290dd08f729bd4ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page