Taipy Graphical User Interface generator
The Taipy GUI package provides User Interface generation based on page templates. It can run a web server that a web browser can connect to.
The pages are generated by a web server that allows web clients to connect, display and interact with the page content through visual elements.
Each page can contain regular text and images, as well as Taipy controls that are typically linked to some value that is managed by the whole Taipy application.
Here is how you can create your first Taipy User Interface:
- Create a Python source file.
Copy these two lines into a file called taipy_app.py.
taipy_app.py
from taipy import Gui if __name__ == "__main__": Gui("# Hello Taipy!").run()
- Install Taipy:
pip install taipy
- Run your application:
python taipy_app.py
Your browser opens a new page, showing the content of your graphical application.
Optional packages
There are Python packages that you can install in your environment to add functionality to Taipy GUI:
python-magic
: identifies image format from byte buffers so theimage
control can display them, and so thatfile_download
can request the browser to display the image content when relevant.
You can install that package with the regularpip install python-magic
command (then potentiallypip install python-magic
on Windows), or install Taipy GUI using:pip install taipy-gui[image]
.pyarrow
: can improve the performance of your application by reducing the volume of data transferred between the web server and the clients. This is relevant if your application uses large tabular data.
You can install that package with the regularpip install pyarrow
command, or install Taipy GUI using:pip install taipy-gui[arrow]
.simple-websocket
: enables the debugging of the WebSocket part of the server execution.
You can install that package with the regularpip install simple-websocket
command, or install Taipy GUI using:pip install taipy-gui[simple-websocket]
.pyngrok
: enables use of Ngrok to access Taipy GUI application from the internet.
You can install that package with the regularpip install pyngrok
command, or install Taipy GUI using:pip install taipy-gui[pyngrok]
.
Functions¶
broadcast_callback()
: Invoke a callback for every client.download()
: Download content to the client.get_module_context()
: Get the name of the module currently in used when using page scopesget_module_name_from_state()
: Get the module name that triggered a callback.get_state_id()
: Get the identifier of a state.get_user_content_url()
: Get a user content URL.hold_control()
: Hold the User Interface actions.invoke_callback()
: Invoke a user callback for a given state.invoke_long_callback()
: Invoke a long-running user callback.navigate()
: Navigate to a page.notify()
: Send a notification to the user interface.resume_control()
: Resume the User Interface actions.