Skip to main content

Menu Interface Builder for Python

Reason this release was yanked:

Issue with import in this version. Please use version 1.1 instead.

Project description

:: Author Information and Program Details ::

Module Name: Menataur (Menataur/menataur.py) | Author: Gratonic (https://github.com/Gratonic) | Contributing Author: FailurePoint (https://github.com/FailurePoint) | Written In: Python 3.10.12 | Dependencie(s): colorama | Last Modified: February 9th, 2025

:: Description ::

This Module is used to build a menu interface with an ASCII Art Title. The add_header() function is used to build the header portion of a menu (ASCII Art Title, OS Support Information, etc.). The add_body() function is used to add a menu option to the menu. The add_paragraph() function is used to add a description to the menu. The add_footer() function is used to add a sentence/description at a desired location on the menu (likely the bottom) with padding. The color validation function are used to validate the colors passed to the function by checking the given color or colors against a dictionary of the colors supported by the program and then set the color to the chosen colors actual value. When add_header(), add_body(), add_paragraph(), and_footer() are called, the parameters are used to format place holder strings which are then added to the _placeholder format string (the actual menu) with the _include() function, which is responsible for tacking the pieces of the menu onto the menu. Think of this program like a lego project, each piece of the menu is like a lego structure and the pieces of that lego structure are the configuration settings for that lego structure, and think of the _include() function as the function that attaches that lego structure to the lego project. Alternatively, you can think of it sort of like a webpage written in just HTML and CSS.

:: Example Usage ::

import menataur
menu = menataur.Menataur()
menu.add_header(
    ascii_art_title=ascii_art_title,
    small_title=small_title,
    title_colors=title_colors,
    title_bar=title_bar,
    program_version_color=program_version_color,
    program_version_num=program_version_num,
    os_support_message_color=os_support_message_color,
    os_support_highlight_color=os_support_highlight_color,
    os_support_color=os_support_color,
    os_support_info=os_support_info
)
menu.add_paragraph(text_color="grey", text="Have some fun at a party")
menu.add_body(accent_color="magenta", menu_option_number=1, menu_option_color="light_cyan", menu_option="Party")
menu.add_paragraph(text_color="grey", text="Drink way too much")
menu.add_body(accent_color="magenta", menu_option_number=2, menu_option_color="light_cyan", menu_option="Get Drunk")
menu.add_paragraph(text_color="grey", text="Go to bed and sleep")
menu.add_body(accent_color="magenta", menu_option_number=3, menu_option_color="light_cyan", menu_option="Sleep")
menu.add_paragraph(text_color="grey", text="All three")
menu.add_body(accent_color="magenta", menu_option_number=4, menu_option_color="light_cyan", menu_option="The Works")
menu.add_footer(text_color="light_yellow", text="Thank you for using Minotaur!")
menu.execute()

NOTE: multipule menu obects can be created and used at once, ie: main_menu = menataur.Menataur(), pageone = menataur.Menataur() , pagetwo = menataur.Menataur()

Breakdown

Imports the module

import menataur

Creates an instance of Menataur (the menu class)

menu = menataur.Menataur()

Add the header to the menu

menu.add_header( ascii_art_title=ascii_art_title, small_title=small_title, title_colors=title_colors, title_bar=title_bar, program_version_color=program_version_color, program_version_num=program_version_num, os_support_message_color=os_support_message_color, os_support_highlight_color=os_support_highlight_color, os_support_color=os_support_color, os_support_info=os_support_info )

Add body elements (menu options)

menu.add_paragraph(text_color="grey", text="Have some fun at a party") menu.add_body(accent_color="magenta", menu_option_number=1, menu_option_color="light_cyan", menu_option="Party") menu.add_paragraph(text_color="grey", text="Drink way too much") menu.add_body(accent_color="magenta", menu_option_number=2, menu_option_color="light_cyan", menu_option="Get Drunk") menu.add_paragraph(text_color="grey", text="Go to bed and sleep") menu.add_body(accent_color="magenta", menu_option_number=3, menu_option_color="light_cyan", menu_option="Sleep") menu.add_paragraph(text_color="grey", text="All three") menu.add_body(accent_color="magenta", menu_option_number=4, menu_option_color="light_cyan", menu_option="The Works")

Add a footer (thank you message)

menu.add_footer(text_color="light_yellow", text="Thank you for using Menataur!")

Completes and calls the menu

menu.execute()

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

menataur-1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

menataur-1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file menataur-1.0.tar.gz.

File metadata

  • Download URL: menataur-1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for menataur-1.0.tar.gz
Algorithm Hash digest
SHA256 b084ea8cc781509d8b57baa03e2e493f86add3608aae450baddc680e17649cb9
MD5 62d243f2946d1e2a2cece0804b6edfdf
BLAKE2b-256 7159b1d49c0a0062f57d7caf6d28417aa736461452ad8cc775f5d583b9c22a0b

See more details on using hashes here.

File details

Details for the file menataur-1.0-py3-none-any.whl.

File metadata

  • Download URL: menataur-1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for menataur-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0c16b3e6364af75fbdb0bcd77cd6f89f8d2b66c3ec71376c0217e7761445d5d
MD5 4d86e368dec87b50b9451e8a1feae664
BLAKE2b-256 70641692a34f560c391eaecc1b757d13c5f2c20ccd775daca6e345b63dc3eb47

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