Skip to main content

Make widget management in CLI easy

Project description

Easy Widgets

Easy Widgets is a Python library designed to simplify widget management in CLI applications. It leverages the power of urwid to create dynamic and interactive command-line interfaces with ease.

Features

  • Simplifies the creation and management of CLI widgets.
  • Supports Python versions 3.7 and above.
  • Lightweight and easy to integrate into existing projects.

Installation

You can install Easy Widgets via pip:

pip install easy_widgets

Usage

Here’s a basic example of how to use Easy Widgets:

from easy_widgets import * 

Application.init()

menu = Menu("Just exit now")
menu.addOption("OK", lambda b,p: Application.exit())


name = ""
times = 0 

def setName(x):
    global name 
    name = x
def setTimes(x):
    global times 
    times = x

w = Wizzard(menu)\
    .withChoices("Select number", "times", [(1, "one"), (2, "two")])\
    .withInput("Enter your name", "name")\
    .withParam("name", setName)\
    .withParam("times", setTimes)


w.show()

Application.run()
print(name * times)

Refer to the documentation for more advanced usage.

Requirements

  • Python >= 3.7
  • urwid >= 3.0.0

Development

Setup

Clone the repository:

git clone https://github.com/fantastic001/easy_widgets.git
cd easy_widgets

Install dependencies:

pip install -r requirements.txt

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-name).
  3. Commit your changes (git commit -m "Add feature").
  4. Push to the branch (git push origin feature-name).
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

easy_widgets-0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file easy_widgets-0.3-py3-none-any.whl.

File metadata

  • Download URL: easy_widgets-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for easy_widgets-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab0ffbab5e2f569caa6279fbc33aabb06bdafe219640627a4d5fade9905b10ad
MD5 23af1fcce732712410a60373475e87d3
BLAKE2b-256 9f09798210c3a55b2d367fc102b4972db57f9caa825f29fac93d1f92fe1dbf06

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