High-Level Abstraction Web-GUI Using Just Python
Project description
NiceGUI
We like Streamlit but find it does to much magic when it comes to state handling. In search for an alernative nice library to write simple graphical user interfaces in Python we discovered justpy. While too "low-level-html" for our daily usage it provides a great basis for our shot at a "NiceGUI".
Features
- browser-based GUI
- implicit reload on code change
- clean set of GUI elements (label, button, checkbox, switch, slider, input, ...)
- simple grouping with rows, columns and cards
- built-in timer to refresh data in intervals (even every 10 ms)
Usage
Write your nice GUI in a file main.py
:
from nicegui import ui
ui.label('Hello NiceGUI!')
ui.button('BUTTON', on_click=lambda: print('button was pressed'))
Launch it with:
python3 main.py
Note: The script will automatically reload the GUI if you modify your code.
API
See main.py for an example of all API calls you can make with NiceGUI.
Plots
lines = ui.line_plot(n=2, limit=20).with_legend(['sin', 'cos'], loc='upper center', ncol=2)
ui.timer(0.1, lambda: lines.push([datetime.now()], [
[np.sin(datetime.now().timestamp()) + 0.02 * np.random.randn()],
[np.cos(datetime.now().timestamp()) + 0.02 * np.random.randn()],
]))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nicegui-0.1.6.tar.gz
(13.4 kB
view hashes)
Built Distribution
nicegui-0.1.6-py3-none-any.whl
(18.2 kB
view hashes)