Giter Club home page Giter Club logo

menza-cli's Introduction

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.sh --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.

menza-cli's People

Contributors

lastaapps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.