Search code examples
pythonlightweight-chartspywebview

Python and Bridge for JS


Im starting a new project for personal porpuse! Im working personally in finance, I decided to create personal chart viewing software to suit my needs. I thought I'd create a good part of the backend in Python as it is a language I know quite well. Use Javascript for the graphic side, and use a webview in a windows form to make everything available as if it were software.

  • As for the graphics I thought of using: Lightweight Library for JS, I find that today it is the most avant-garde library compared to the classic plotly, matplotlib.

  • Use pywebview as a bridge between Python and JS and to redirect everything in a windows form.

However I find it a bit difficult to use this library (pywebview), there is a poor documentation around and not very clear to me (my level of JS is really basic). However, I believe it is one of the most convenient solutions.

I would have thought of using pyscript, but it still seems early to use this library in production.

Questions:

  • Do you think such a job is feasible?
  • Do you know other libraries/better solutions to do such jobs?
  • What kind of approach would you use if you were to do such work?

What I am trying to achieve is to write most of the functions in python and use only JS to make calls through buttons or to get data from various inputs.

Wandering around the web I found a work already partially created by this guy (if you are reading, Thanks Filipe you have been very helpful! here you can see his project hosted on Github) but unfortunately it is difficult for me to get my hands on a code not produced by me.


Solution

  • lightweight-charts-python seems like what you are looking for!