Connecting to databases using sqlalchemy

You may get a better answer from one of the PyScript team but if you mean connecting to a remote database server then it’s unlikely it can be done in the traditional way, due to the fundamental limitations of the browser and Pyodide (which underpins PyScript).
You could potentially access a local database, but for anything remote, it would not be able to make the usual sorts of network connections that are normally required to communicate in whatever database protocol your database uses

If some kind of web accessible front end is set up to act as an interface to a backend database, then something might be possible but I’m guessing that then wouldn’t be able to operate via sqlalchemy or other traditional tools.

You can get an idea of a few of the general limitations with Pyodide (and thus PyScript) by looking at the FAQ here: Frequently Asked Questions — Version 0.20.0
And also checking out their roadmap (which indicates things that aren’t yet working but that they hope they may resolve with work)

2 Likes