Being pure Python and cross platform, it should work (almost) anywhere where there’s Python and a browser. Flexx is written for Python 3.5+ and also works on Pypy. Flexx actively supports Firefox, Chrome and (with minor limitations) MS Edge.
Flexx further depends on:
All are pure Python packages, and the latter three are projects under the flexxui umbrella. Further, Flexx needs a browser. To run apps that look like desktop apps, we recommend having Firefox installed.
Developers that want to run the tests need:
- pytest and pytest-cov (get them via conda or pip)
- flake8 (get it via conda or pip)
Flexx is in development and is in alpha status. Any part of the public API may change without notice.
conda install flexx -c conda-forge
pip install flexx
- Old school:
python setup.py install
- Clone the repo and add the root dir to your PYTHONPATH (developer mode)
The primary motivation for Flexx is the undeniable fact that the web (i.e. browser technology) has become an increasingly popular method for delivering applications to users, also for (interactive) scientific content.
The purpose of Flexx is to provide a single application framework to create desktop applications and web apps. By making use of browser technology, the library itself can be relatively small and pure Python, making it widely and easily available.
Libraries written for Python, but not in Python have a much harder time to survive, because users don’t easily become contributors. This is one of the reasons of the success of e.g. scikit-image, and the demise of e.g. Mayavi. Since Flexx is written in a combination of Python and PScript, its user community is more likely to take an active role in its development.
The image above outlines the structure of Flexx.
The event module provides a powerful property and event system that
makes it easy to connect different parts of your application. Central to
the event system is the
The app module runs the server to which the web runtime connects (via a
websocket). Further, it extends the
event.Component class into the
JsComponent classes. Objects of these classes
on the other side, from which properties can be accessed, and actione be invoked.
The ui module defines all widgets (based on