Static serving of all pyscripts (and dependencies)

Is there a way to package all pyscript sources and their dependencies (pyodide, wasm) to operate an application cut from internet.
As an example of sub-question: is the external reference to pyodide harcoded to a url?

You just need to load the pyscript.js

I tested that too. Already planning an webapp to be used in my work.

Just serving pyscript.js is not enough. That module loads almost a dozen other files.

Correct. PyScript injects a script tag which loads Pyodide…which is around 10 MB compressed.

This new web component (it landed in the last week) should let you point to a different (e.g. local) URL for your Pyodide.

1 Like

Paul, specifying the origin for the Pyscript and Pyodide dependencies will be very nice.

I am building apps that are extensions so I want to bundle (or download to persistent virtual storage) everything required.

Please ping me when that is available. I can also help test for my use case. I am a Google GDE.

Hi @john.hanley I lost most of Sunday in a crap-fest of package.json/tsconfig.json/jest.config.js wire-wiggling. I’m a test-first person and want to drive from tests. ts-node and ts-jest don’t combine well with ESM.

I gave up, switched to Vite and Vitest, and damn if it didn’t work the first time. I just had to put the pyodide sources in a top-level pyodide dir.

Want to review/collborate on a tutorial/video I might do?

1 Like

Hi Paul,

Yes, I would love to review and/or collaborate with you.

On my personal blog site, my PyScript articles are breaking traffic records and I already had significant traffic for my Google Cloud articles. There is a lot of interest right now.