Skip to main content

Enhanced Menu and CLI generator

Project description

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

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.

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.8.tar.gz (5.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: hypercli-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 0ef0cc415294a22848b1582aca43887f91c34007fe7ad30947cb2774477908f3
MD5 0a5cc7b5718836fce4ab87417d5b5699
BLAKE2b-256 8ca571dfce972357917cb807cf54ce9032dc56e7abe3ee68117c8d425f447781

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