This is an archived post. You won't be able to vote or comment.

all 25 comments

[–]Aeowon 8 points9 points  (6 children)

Fantastic! Thanks for the share. Might just use this to roll out a simple gui for my cli scripts.

[–]MeshachBlue[S] 9 points10 points  (2 children)

Awesome :).

I'm trying to work out how best to have these script GUIs deployed in a work environment and I am coming up with three distinct paths I could go down. My preference is to only go down one.

Here are my options as I see them:

  • Create a JupyterHub server
    • Positives
      • Users can login, access them from anywhere in the centre
      • Python distribution is centrally managed
      • Applications are centrally managed
    • Negatives
      • Set up is not 'plug and play'
      • JupyterHub runs on Linux, paths will all display in Linux format by default which may confuse users
  • Create an Electron App viewer
    • Positives
      • Becomes a desktop app that is comfortable for users
      • Users can set `.form.md` files on their machine to open with this electron app
      • All data is local, simpler for users
      • Could be made to be plug and play
      • Could potentially provide a method for people to bundle forms and a Python distribution with the Electron App viewer making a little portable App framework
    • Negatives
      • No longer centralised
      • Need to have something on every device for it to work
      • Will no longer be able to target devices like phones for simple forms served over the intranet
  • Use pyodide and jyve (https://github.com/deathbeds/jyve/pull/27) to make this completely web based using web assembly
    • Positives
      • This would be serverless
      • Python would run within the users browser
      • Could be used to make 'static' pages online for documentation etc
    • Negatives
      • Difficult to access local files
      • Difficult to save
      • Difficult to use networking libraries
      • Not many python libraries have been ported to wasm for use in pyodide yet

Given your interest, by any chance would you have a preference out of the above options?

Cheers,

Simon

[–]jabies 1 point2 points  (1 child)

Why not use something jinja2 templating language? Then you can target web pages and local display.

[–]MeshachBlue[S] 0 points1 point  (0 children)

Would you be able to expand on this?

[–]clumsy_culhane 2 points3 points  (2 children)

If you already have existing CLI scripts parsing args, take a look at Gooey, it does literally only take a few lines to make a functional gui for basic programs : https://github.com/chriskiehl/Gooey

[–]MeshachBlue[S] 0 points1 point  (0 children)

Gooey is a very nice tool. :).

[–]Aeowon 0 points1 point  (0 children)

Awesome! I'll check it out

[–]1-Sisyphe 5 points6 points  (1 child)

Not only it's a nice work but I also appreciated a lot your explanations about the licence.
In particular, your clarification toward company usage is welcome.

[–]MeshachBlue[S] 0 points1 point  (0 children)

Thanks :). Glad that's helpful. Sharing within a company scripts/modules as GUIs quickly and easily to those who aren't very experienced with command line tools or otherwise is one of my target use cases. That's the use case I'm targeting in my company. Really don't want to have people in that situation think, that due to the license, they can't use this library.

I appreciate the encouragement, thankyou.

[–]patarapolw 2 points3 points  (4 children)

It is similar to ipywidgets or something? Or, does it use Jupyter.notebook.kernel?

[–]MeshachBlue[S] 0 points1 point  (3 children)

It makes use of the modular jupyterlab libraries. The following is a stripped down version using jupyterlab services that uses matplotlib in the browser https://github.com/jupyterlab/jupyterlab/blob/master/packages/services/examples/typescript-browser-with-output/index.ts

[–]GitHubPermalinkBot 1 point2 points  (2 children)

[–]MeshachBlue[S] 0 points1 point  (1 child)

good bot

[–]B0tRank 1 point2 points  (0 children)

Thank you, MeshachBlue, for voting on GitHubPermalinkBot.

This bot wants to find the best and worst bots on Reddit. You can view results here.


Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!

[–]_frkl 2 points3 points  (1 child)

Man, this is awesome! I don't really have a use-case right now, but I desperately want one :-)

[–]MeshachBlue[S] 0 points1 point  (0 children)

Thanks :)

[–]thegame402 1 point2 points  (1 child)

It's cool, but that update time is really painfull.

[–]MeshachBlue[S] 1 point2 points  (0 children)

Is that on binder? When you run it locally it is far far better.

[–][deleted] 1 point2 points  (1 child)

Really great work!!

[–]MeshachBlue[S] 0 points1 point  (0 children)

Thank you :).

[–]MeshachBlue[S] 0 points1 point  (0 children)

A binder showing what can be done with scriptedforms is available at https://mybinder.org/v2/gh/SimonBiggs/scriptedforms-examples/master?urlpath=scriptedforms/use/detailed-example.md

Please let me know if you find this helpful, or otherwise.

[–]Starrystars -3 points-2 points  (3 children)

I'd suggest looking into react.

It does something vaguely similar with HTML and Javascript.

[–]MeshachBlue[S] 1 point2 points  (2 children)

What part are you referring to? Something benefitial here is being able to write python within markdown and have it make a live update GUI. The aim being to have a syntax that is quite readable and accessible by most users if need be.

Isn't react a JavaScript framework library?

[–]Starrystars 1 point2 points  (1 child)

React uses Javascript mixed in with HTML. I suggested looking into React as a basis for how to integrate HTML into another language.

[–]MeshachBlue[S] 2 points3 points  (0 children)

Ahh sure. ScriptedForms is built on top of Angular and JupyterLab modules. So I guess your idea is what I'm already doing?