Difference between revisions of "Nicegui widgets"

From BITPlan Wiki
Jump to navigation Jump to search
 
(33 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
|title=nicegui_widgets
 
|title=nicegui_widgets
 
|url=https://github.com/WolfgangFahl/nicegui_widgets
 
|url=https://github.com/WolfgangFahl/nicegui_widgets
|version=0.0.8
+
|version=0.16.1
 
|description=nicegui widgets, tools and base classes
 
|description=nicegui widgets, tools and base classes
|date=2023-09-11
+
|date=2024-07-27
 
|since=2023-09-12
 
|since=2023-09-12
 
}}
 
}}
 +
 +
= Motivation =
 +
Standarize [https://nicegui.io/ nicegui] App appearance and add utilities and widgets
 +
= Demo =
 +
http://ngdemo.bitplan.com
 +
= Tutorial =
 +
{{Link|target=Nicegui widgets/Tutorial}}
  
 
{{pip|ngwidgets}}
 
{{pip|ngwidgets}}
= Motivation =
+
 
Standarize nicgui App appearance and add utilities and widgets
+
= Features =
 +
* standard project layout with README, License, pyproject.toml, github actions and scripts for installation and testing
 +
* layout and menu handling with setup_header, setup_footer and setup_content_div
 +
* background:  BackgroundTaskHandler class to allow running long running tasks in a different thread with async/await
 +
* cmd: WebserverCmd class - makes a command line for single input webservers simpler
 +
* color_schema: ColorSchema class - allows to define color schemas by name e.g. "indigo()"
 +
* file_selector: FileSelector class - for selecting files from a tree structure such as a directory - in local mode with unrestricted access to the file system
 +
* input_webserver: InputWebserver skeleton class for a single input webserver that has a single file to work on
 +
* leaflet: leaflete class that wraps https://leafletjs.com/ as a component
 +
* profiler: Profiler class measures time - especially when running tests
 +
* progress: Progressbar subclasses NiceguiProgressbar and TqdmProgressbar allow to use a tdqm or nicegui ui_linear_progress in an exchangeable/compatible way
 +
* webserver: NiceGuiWebserver class for a default webserver with header/menu/footer and some utility functions WebserverConfig to configure copyright/version links and default_port
 +
* version info handling
 +
* about dialog
 +
* [https://github.com/WolfgangFahl/nicegui_widgets/issues/18 users]: Users class for user authentication/credential handling
 +
* remote debugging support
 +
* aggrid ListOfDictGrid
 +
* dictedit
 +
* [https://github.com/zauberzeug/nicegui/discussions/2148 tristate module]
 +
* [https://github.com/zauberzeug/nicegui/discussions/1618 nicegui solutions bazaar]
 +
* [https://github.com/WolfgangFahl/nicegui_widgets/issues/62 automatic apache server config generation]
 +
 
 +
== remote debugging support ==
 +
[https://pypi.org/project/pydevd/pydevd] remote debugging is supported
 +
=== relevant command line arguments ===
 +
<source lang='bash'>
 +
--debugServer DEBUGSERVER
 +
                        remote debug Server
 +
  --debugPort DEBUGPORT
 +
                        remote debug Port
 +
  --debugRemotePath DEBUGREMOTEPATH
 +
                        remote debug Server path mapping - remotePath - path
 +
                        on debug server
 +
  --debugLocalPath DEBUGLOCALPATH
 +
                        remote debug Server path mapping - localPath - path on
 +
                        machine where python runs
 +
 
 +
</source>
 +
=== example remote debug session start ===
 +
using https://github.com/BITPlan/diagrams project as an example
 +
 
 +
The remote IDE environment is an Eclipse workspace on a Mac in this example so /Users/wf/Documents/pyworkspace is the root of the source code tree remotely
 +
The local environment is an Ubuntu server machine where the code resides in /home/wf/source/python
 +
 
 +
<source lang='bash'>
 +
# tunnel port 5678
 +
ssh -R 5678:localhost:5678 server
 +
cd source/python/diagrams
 +
git pull
 +
pip install .
 +
# check that the remote debugging command line arguments are available
 +
diagrams -h
 +
# start your remote debugging in the IDE first
 +
# e.g. with the Eclipse menu entry pydev/Start debug server
 +
diagrams -s --debugServer localhost --debugRemotePath=/Users/wf/Documents/pyworkspace/ --debugLocalPath=/home/wf/source/python/ --debug
 +
</source>
 +
 
 +
In you IDE there should now be a break in the webserver.py class at:
 +
<source lang='python'>
 +
          print(f"command line args are: {str(sys.argv)}")
 +
</source>
 +
 
 
= Links =
 
= Links =
 
https://nicegui.io/
 
https://nicegui.io/

Latest revision as of 15:09, 27 July 2024

OsProject

OsProject
id  nicegui_widgets
state  active
owner  WolfgangFahl
title  nicegui_widgets
url  https://github.com/WolfgangFahl/nicegui_widgets
version  0.16.1
description  nicegui widgets, tools and base classes
date  2024-07-27
since  2023-09-12
until  

Motivation

Standarize nicegui App appearance and add utilities and widgets

Demo

http://ngdemo.bitplan.com

Tutorial

Nicegui widgets/Tutorial


Installation

pip install ngwidgets
# alternatively if your pip is not a python3 pip
pip3 install ngwidgets 
# local install from source directory of ngwidgets 
pip install .

upgrade

pip install ngwidgets  -U
# alternatively if your pip is not a python3 pip
pip3 install ngwidgets -U


Features

  • standard project layout with README, License, pyproject.toml, github actions and scripts for installation and testing
  • layout and menu handling with setup_header, setup_footer and setup_content_div
  • background: BackgroundTaskHandler class to allow running long running tasks in a different thread with async/await
  • cmd: WebserverCmd class - makes a command line for single input webservers simpler
  • color_schema: ColorSchema class - allows to define color schemas by name e.g. "indigo()"
  • file_selector: FileSelector class - for selecting files from a tree structure such as a directory - in local mode with unrestricted access to the file system
  • input_webserver: InputWebserver skeleton class for a single input webserver that has a single file to work on
  • leaflet: leaflete class that wraps https://leafletjs.com/ as a component
  • profiler: Profiler class measures time - especially when running tests
  • progress: Progressbar subclasses NiceguiProgressbar and TqdmProgressbar allow to use a tdqm or nicegui ui_linear_progress in an exchangeable/compatible way
  • webserver: NiceGuiWebserver class for a default webserver with header/menu/footer and some utility functions WebserverConfig to configure copyright/version links and default_port
  • version info handling
  • about dialog
  • users: Users class for user authentication/credential handling
  • remote debugging support
  • aggrid ListOfDictGrid
  • dictedit
  • tristate module
  • nicegui solutions bazaar
  • automatic apache server config generation

remote debugging support

[1] remote debugging is supported

relevant command line arguments

 --debugServer DEBUGSERVER
                        remote debug Server
  --debugPort DEBUGPORT
                        remote debug Port
  --debugRemotePath DEBUGREMOTEPATH
                        remote debug Server path mapping - remotePath - path
                        on debug server
  --debugLocalPath DEBUGLOCALPATH
                        remote debug Server path mapping - localPath - path on
                        machine where python runs

example remote debug session start

using https://github.com/BITPlan/diagrams project as an example

The remote IDE environment is an Eclipse workspace on a Mac in this example so /Users/wf/Documents/pyworkspace is the root of the source code tree remotely The local environment is an Ubuntu server machine where the code resides in /home/wf/source/python

# tunnel port 5678
ssh -R 5678:localhost:5678 server
cd source/python/diagrams
git pull
pip install .
# check that the remote debugging command line arguments are available
diagrams -h
# start your remote debugging in the IDE first 
# e.g. with the Eclipse menu entry pydev/Start debug server
diagrams -s --debugServer localhost --debugRemotePath=/Users/wf/Documents/pyworkspace/ --debugLocalPath=/home/wf/source/python/ --debug

In you IDE there should now be a break in the webserver.py class at:

           print(f"command line args are: {str(sys.argv)}")

Links

https://nicegui.io/