python-interpreter
executes Python code via Pyodide and the JupyterLite kernel.
This library is a proof of concept and is not intended for production use.
For production environments, consider using robust solutions like Riza or E2B.
Install the library using npm:
npm install python-interpreter pyodide
Here's a basic example of how to use python-interpreter
:
import { Sandbox } from "python-interpreter";
(async () => {
const sandbox = await Sandbox.create();
const execution = await sandbox.execute(`print("hello world")`);
console.log("Output:", execution);
})();