rete
rete copied to clipboard
python api?
Hello, do you have or do you know of any python apis to your project?
@andreaBelmont have you seen this: https://github.com/zebulon75018/flaskretejs?
@creadicted what that repo did is nothing but exposed an api to save/load a text file, but meanwhile did not use the api at all... so i think it is irrelevant
I want this to be a thing. How would the execution model work for this?
How about this:
- A python module factory exists to create RETE components for each python module. This is instantiated in Rete.js
- The factory communicates with a python server. A python server returns a list of ALL python objects that will work with RETE.js.
- The factory creates as many components as there are python objects reported by that server.
- A rete component is basically a composed wrapper to make calls to instantiated objects on the python server.
- The python server registers its workers by reading a target directory full of classes that all inherit the same structure.
- Execution happens on the python server and is called by rete.js wrapper commponents.
Does this sound like a good way forward?
I'm not sure I understand exactly, but please check out pyodide. You get python in the browser without a server.
https://pyodide.org/en/stable/using_pyodide_from_javascript.html
There are some limitations and nuances I have not been able to explore. But, some neat things that can be used:
In the basic example, you can open the js console. run the following
pyodide.runPythonAsync('import micropip')
pyodide.runPythonAsync('micropip.install("pandas")')
pyodide.runPythonAsync('import pandas as pd')
pyodide.globals.pd
pyodide.globals.pd.__version__
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.