micropip
micropip copied to clipboard
Download `pyodide-lock.json` with results of micropip.freeze()
micropip.freeze()
returns the pyodide-lock.json
contents, and it would be nice if there was some convenience function that would trigger the download of such pyodide-lock.json
.
Maybe something like,
def download_pyodide_lock():
from js import document, Blob, URL
blob = Blob.new([micropip.freeze()], {"type": "application/json;charset=utf-8"})
a = document.createElement("a")
a.href = URL.createObjectURL(blob)
a.download = "pyodide-lock.json"
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
Though it wouldn't work in a web-worker (and JupyterLite)