Skip to main content

Dish menus for CTU cafeterias - nice CLI interface

Project description

Menza CLI

PyPI version

Menza CLI is a command line tool written in Python (what a mistake) allowing not only CTU students to view CTU Canteens menus. Today menu, week menu, canteens info and dish rating using own rating BE interconnected with my Android app is supported.

Because the Gui of the project is written using the ncurses library, non-unix systems are not supported.

Make sure your terminal supports emojis.

Install

Python 3.10+ required! Check by running python3 --version.

You can install the app from pypi.

# install the package
python3 -m pip install menza_cli

# If you don't have python in your PATH
# Bash
printf '\nexport PATH="$PATH:$HOME/.local/bin"\n\n' >> ~/.bashrc
source ~/.bashrc
# zsh
printf '\nexport PATH="$PATH:$HOME/.local/bin"\n\n' >> ~/.zshrc
source ~/.zshrc

# Run the app
menza

Setup locally

To set the project you will need Python 3.10 or greater. You can just run the ./scripts/setup.sh script or create a virtual environment yourself from the requirements.txt file included.

Running

To run the app, source the created env using source .venv/bin/activate and run ./menza --help

To use mocked data (eg. it is weekend and no dish is served), pass the --mocked option.

Gui

To run the app in Gui mode, omit any command while executing from CLI. You can navigate like a chad using basic Vim binding or like a VŠE student using arrows.

Controls

  • right/left - switch between menu and main view
  • up/down - move in menus/lists
  • Enter/o - in menu load selected canteen menu, in the menu view open dish photo in browser if available
  • w - switch to week view and back
  • r - rate selected dish
  • q/Esc - quit

To be warned against allergens view the config section below.

If the images are being opend twice in a brower it is not my fault, Python the stupid one here.

Cli

To just get basic overview of one specific system, you can use a command in the CLI - list, dish, week or info.

The first 3 output data in Tab separated format, so they can be used by CLI filters.

Last 3 expect a cafeteria id (run the list command) or name, at least partially - the first system that matches gets used.

So to view a menu in the Strahov cafeteria, you can run any of these:

  • ./menza.py dish 1
  • ./menza.py dish Strahov
  • ./menza.py dish str

Config file

You can config some basic app behavior using menza.conf file in the ~/.config directory. The file is not required to exist. File format is as follow:

# Required
[DEFAULT]

# if something changes in the future and project is no longer maintained
agata_url_base=
agata_url_api=
agata_api_key=
lasta_url=
lasta_api_key=

# Dishes with the following allergens will be grayed out
allergens=1,3

License

Menza CLI is licensed under the GNU GPL v3.0 license.

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

menza_cli-0.2.0.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

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

menza_cli-0.2.0-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file menza_cli-0.2.0.tar.gz.

File metadata

  • Download URL: menza_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for menza_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 362def2be7eae6f9e209780d1b3ed20aa3e85bf48b0906e2593e011b0097c719
MD5 08a6fce1534ec3dd62e4a7337e79d783
BLAKE2b-256 3570ef659a2e0ecff82083443e819a3327879d1f5804663ba8e20e361f677970

See more details on using hashes here.

File details

Details for the file menza_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: menza_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 65.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for menza_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 329d6d372c4b1a0014e0738c6e9cdc89bb48e7c7698536e7ff4cb2dccbe65c17
MD5 ade24bfc43f23ed79c61ad3e89d18af3
BLAKE2b-256 1a965db82b3a3a2decf8a158dc4aa8aa5fb765bb6fdd1f9b6f0bdcfb47651dd7

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