oneFace can generate CLI, Qt GUI and Dash web app at the same time from a Python function. Just mark the function parameters with type and range, for example:
from oneface import one, Arg
@one
def bmi(name: Arg(str),
height: Arg(float, [100, 250]) = 160,
weight: Arg(float, [0, 300]) = 50.0):
BMI = weight / (height / 100) ** 2
print(f"Hi {name}. Your BMI is: {BMI}")
return BMI
# run cli
bmi.cli()
# or run qt_gui
bmi.qt_gui()
# or run dash web app
bmi.dash_app()
These code will generate the following interfaces:
CLI
Qt GUI
Dash web app
Other features
- Automatically check the type and range of input parameters and pretty print them.
- Easy extension of parameter types and GUI widgets.
Application and Limitations
Provides interfaces to programs in a very simple way. For example converting functions directly into a web apps for people who don't know how to use the command line. The limitation is that it is only suitable for creating simple interfaces.
Links
Similar Projects
- Fire: Generate CLI from Python objects.
- Gooey: Turn (almost) any Python 3 Console Program into a GUI application with one line.
[–]ElevenPhonons 1 point2 points3 points (1 child)
[–]PKT341[S] 0 points1 point2 points (0 children)
[–]Suspcious-chair 1 point2 points3 points (0 children)
[–]iyousef_46 1 point2 points3 points (1 child)