1

I have a fairly simple python program that takes in some csv style text files containing genomic data (these files are fairly lightweight: <10 megabytes) processes / compares them and then produces some output text files. Currently this program has a command line interface suitable for my own use. However, I want this app to become usable by wider community of biologists who may not be comfortable with command line. Moreover, the current CLI is cumbersome due to the large number of parameters required to perform the task.

What I want to do is develop a functional GUI. However, there are some major caveats.

1) I want to develop web/browser based UI. Why? i) Overwhelming majority of bioinformatics tools are web based. Biologists are comfortable with such interfaces. ii) Many (Python) GUI frameworks create somewhat inelegant interfaces (ex: Tkinter), while others have restrictive licenses (PyQt). iii) In the future when we are ready to address the security concerns we will want to host our application on a server. Security is important because the app will often deal with HIPAA protected data. 2) I would prefer a python based framework because that is the language that I most comfortable with and I need to develop this interface within 3 weeks.

So far the only Python based solution I have found is Flask + Pywebview (confirm?). I am also aware of Electron and NW.js. However, since I am not an experienced web/javascript developer I would prefer to stick with Python.

Are there any frameworks suitable for this problem that I have not mentioned above? Is Flask + Pywebview a viable framework for developing a desktop application GUI using web based technologies?

Thank you!

2

Flask + Pywebview should certainly do what you want. Electron is less than ideal and agree with you - learning Javascript and the Electron UI model is not a trivial exercise.

Django is a python web framework which is very good and running as a desktop GUI could be done with:

* https://github.com/scaphilo/dbuilder (a bit old)
* https://github.com/itsjohncs/superzippy#super-zippy

This is from https://stackoverflow.com/questions/1317899/django-projects-as-desktop-applications-how-to

I have not done this exact thing, but have experience with python, web dev and desktop development, so hope this helps!

2

The project argparseweb might be a good starting point.

It aims to automatically convert argparse-like command line interfaces to simple web interfaces. This package was made for getting your personal command line scripts to the next stage - internal shared utilities.

I haven't personally tried this out!

  • 1
    Thanks for that, Steve. Sounds great; I will look into that too. I doing some micro-python work on embedded boards and have them acting as servers. This could be a great benefit. – Mawg Sep 20 at 6:38
1

I know that you want something browser based, rather than desktop based, but, just in case you can't get it done in three weeks ...

since you say that you have a very complicated command line, I assume that you are using argparse (if not, why not?)

If you use Gooey, a single line in your code will generate a GUI from your argparse parameters. It might be useful as a stop-gap, buying you time to develop a browser-based interface.

Gooey is international ready and easily ported to your host language. Languages are controlled via an argument to the Gooey decorator.

There is also (experimental) input validation.

All in all, Gooey is a very impressive piece of code - take 5 minutes to give it a try, and you may decide to forget a browser-based GUI.

Sample generated GUIs:

enter image description here

0

I would use django for a simple web gui which servers via http://localhost:8000

Maybe you don't need all the features that django offers (ORM, database migrations, ...).

But django is a solid framework, which helps you if new features will be needed in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.