Skip to main content

Enhanced Menu and CLI generator

Project description

 _                               _ _
| |                             | (_)
| |__  _   _ _ __   ___ _ __ ___| |_
| '_ \| | | | '_ \ / _ \ '__/ __| | |
| | | | |_| | |_) |  __/ | | (__| | |
|_| |_|\__, | .__/ \___|_|  \___|_|_|
        __/ | |
       |___/|_|               v 0.1.9

hypercli

hypercli is a Python package that provides an elegant solution for interacting with command line tools. It offers a menu-based command line interface (CLI) that allows users to navigate through different options and execute functions based on their choices.

Features

  • Interactive menu-based CLI
  • Customizable banners and intros
  • Support for different visual styles and colors
  • Easy integration with existing Python scripts

Installation

You can install hypercli using pip. Open your terminal and run the following command:

pip install hypercli

Usage

To use hypercli, import the cli module from the hypercli package and create an instance of the cli class. You can then define your menus, options, and functions to be executed. Finally, call the show_cli() method to start the CLI interface.

Here's an example of how to use hypercli:

from hypercli import cli
import webbrowser

def author_name():
    print("HYP3R00T")

def open_website():
    webbrowser.open("https://hyperoot.dev")

def greet(name):
    print(f"Hello, {name}!")

hyper = cli()

hyper.create_banner("hypercli")
hyper.create_intro("Intro", "An elegant solution to interact\n with command line tools")

hyper.create_menu("Main Menu", "Enter your choice")
hyper.add_option("Main Menu", "Checkout the Sub Menu", "Sub Menu")
hyper.add_option("Main Menu", "Greet", greet, "John")
hyper.add_option("Main Menu", "Print Author Name", author_name)

hyper.create_menu("Sub Menu", "Enter your choice")
hyper.add_option("Sub Menu", "Go Back to Main Menu", "Main Menu")
hyper.add_option("Sub Menu", "Checkout the Website (hyperoot.dev)", open_website)

response = hyper.show_cli()

The above script demonstrates the usage of hypercli. It creates a CLI with two menus: "Main Menu" and "Sub Menu". Each menu has its own options and functions to be executed. You can customize the menus, options, and visual styles according to your requirements. To check out more complex example, refer to Example_revamped.py.

License

This project is licensed under the MIT License. See the MIT file for more information.

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

hypercli-0.1.9.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file hypercli-0.1.9.tar.gz.

File metadata

  • Download URL: hypercli-0.1.9.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for hypercli-0.1.9.tar.gz
Algorithm Hash digest
SHA256 dc05cadf1f379ebfa8c81b99cbf2edf10a2bcf951b022a1b4d4e130f3c28b60a
MD5 52fa1f9d0e54da43802e2a5f7471533f
BLAKE2b-256 5b75d83b6c7d902fd15c94651a1b0eff817b698f196056507455697d5e75dd90

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