{"_id":"@cadbuildr/cad-pyodide-runtime","_rev":"2-06fdf771d8e5e40f6445faa621825df4","name":"@cadbuildr/cad-pyodide-runtime","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@cadbuildr/cad-pyodide-runtime","version":"0.1.0","keywords":["cad","pyodide","foundation","python","browser"],"license":"MIT","_id":"@cadbuildr/cad-pyodide-runtime@0.1.0","maintainers":[{"name":"clemcadbuildr","email":"clement@cadbuildr.com"}],"homepage":"https://github.com/cadbuildr/cad-pyodide-runtime#readme","bugs":{"url":"https://github.com/cadbuildr/cad-pyodide-runtime/issues"},"dist":{"shasum":"08ca7bf9421296275956d7382e1dc3ea4a1d2074","tarball":"https://registry.npmjs.org/@cadbuildr/cad-pyodide-runtime/-/cad-pyodide-runtime-0.1.0.tgz","fileCount":2,"integrity":"sha512-muxL8n924jxv9+yUXXYXEndgKnUrLG8OAbCvJ0P8/+FfABVbKjupvlsIbaTSkBO7V1gWkYYvnt+/0c2DPZCPoA==","signatures":[{"sig":"MEUCIQCmcgjZMcQ9DOlPGn0l1So0dT9oMJ3oUxWuq2oTggnqwwIgA35gDPqRPip62b7QXRb6SKhTmRML2PS77yTV/B1FegE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2655},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"test":"jest","build":"tsc","type-check":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"clemcadbuildr","email":"clement@cadbuildr.com"},"repository":{"url":"git+https://github.com/cadbuildr/cad-pyodide-runtime.git","type":"git"},"_npmVersion":"11.3.0","description":"Pyodide runtime for running foundation CAD code in browser apps","directories":{},"sideEffects":false,"_nodeVersion":"24.1.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","typescript":"^5.7.2","@types/jest":"^29.5.14","@types/node":"^22.10.0"},"peerDependencies":{"pyodide":">=0.29.3"},"_npmOperationalInternal":{"tmp":"tmp/cad-pyodide-runtime_0.1.0_1775950475989_0.7523870051434924","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cadbuildr/cad-pyodide-runtime","version":"0.1.1","description":"Pyodide runtime for running foundation CAD code in browser apps","main":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"scripts":{"build":"rm -f tsconfig.tsbuildinfo && tsc","type-check":"tsc --noEmit","test":"jest","prepack":"npm run build","prepublishOnly":"npm run build"},"keywords":["cad","pyodide","foundation","python","browser"],"repository":{"type":"git","url":"git+https://github.com/cadbuildr/cad-pyodide-runtime.git"},"license":"MIT","publishConfig":{"access":"public"},"peerDependencies":{"pyodide":">=0.29.3"},"devDependencies":{"@types/jest":"^29.5.14","@types/node":"^22.10.0","jest":"^29.7.0","ts-jest":"^29.2.5","typescript":"^5.7.2"},"_id":"@cadbuildr/cad-pyodide-runtime@0.1.1","bugs":{"url":"https://github.com/cadbuildr/cad-pyodide-runtime/issues"},"homepage":"https://github.com/cadbuildr/cad-pyodide-runtime#readme","_nodeVersion":"24.1.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-6s94CTdFhZpMvsu6rHFllPf4DyT7hvdHbSRFlOOlrDD2zbX1vj3H7wBWd8C2C2znw5BfkeU8I39UTijXTjQAPQ==","shasum":"d86def8045c86645d512efab794c3e9110fcd503","tarball":"https://registry.npmjs.org/@cadbuildr/cad-pyodide-runtime/-/cad-pyodide-runtime-0.1.1.tgz","fileCount":18,"unpackedSize":19034,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDY/mFfsT7jU/2W+WlrFqiz6miyP79QMKJmtfpJoSDr3AiBo1bzX09e0V01UozRGlK7y7nuZQ5ICHgvaqpBwv3S+SA=="}]},"_npmUser":{"name":"clemcadbuildr","email":"clement@cadbuildr.com"},"directories":{},"maintainers":[{"name":"clemcadbuildr","email":"clement@cadbuildr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cad-pyodide-runtime_0.1.1_1779427477042_0.2743884132550871"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-11T23:34:35.910Z","modified":"2026-05-22T05:24:37.320Z","0.1.0":"2026-04-11T23:34:36.138Z","0.1.1":"2026-05-22T05:24:37.174Z"},"bugs":{"url":"https://github.com/cadbuildr/cad-pyodide-runtime/issues"},"license":"MIT","homepage":"https://github.com/cadbuildr/cad-pyodide-runtime#readme","keywords":["cad","pyodide","foundation","python","browser"],"repository":{"type":"git","url":"git+https://github.com/cadbuildr/cad-pyodide-runtime.git"},"description":"Pyodide runtime for running foundation CAD code in browser apps","maintainers":[{"name":"clemcadbuildr","email":"clement@cadbuildr.com"}],"readme":"# cad-pyodide-runtime\n\nStandalone browser runtime for Pyodide with a CAD foundation package preinstalled.\n\n## Summary\n\nThis package provides an ergonomic way to run CAD foundation Python code in the browser:\n\n1. Load Pyodide.\n2. Install `micropip`, `numpy`, and a configurable foundation package.\n3. Run Python code and optionally extract a DAG via `show(...)`.\n\n## Install\n\n```bash\nnpm install @cadbuildr/cad-pyodide-runtime pyodide\n```\n\n## Quick start\n\n```ts\nimport { initializeCadPyodideRuntime, runCadPythonCode } from \"@cadbuildr/cad-pyodide-runtime\";\n\nconst pyodide = await initializeCadPyodideRuntime({\n  packages: {\n    foundation: \"^0.2.6\",\n    foundationPackageName: \"foundation-core\",\n  },\n  foundationImportPath: \"foundation_core\",\n  foundationDagUtilsPath: \"foundation_core.dag_utils\",\n});\n\nconst result = await runCadPythonCode(\n  pyodide,\n  `\nfrom foundation_core import show\nfrom foundation_core.models import Part\n\npart = Part()\nshow(part)\n`\n);\n\nconsole.log(result.dag);\n```\n\n## API\n\n- `initializeCadPyodideRuntime(options)` -> initializes Pyodide + foundation package.\n- `runCadPythonCode(pyodide, pythonCode, options?)` -> runs code and returns `{ dag }`.\n- `buildFoundationRequirement(version, packageName?)` -> converts versions/caret constraints to micropip requirements.\n\n## Development\n\n```bash\nnpm install\nnpm test\nnpm run type-check\n```\n\n## Publishing\n\nEnsure you are logged into npm with access to the `@cadbuildr` scope, then:\n\n```bash\nnpm publish --access public\n```\n\n## Pairing with cad-kernel-r3f\n\nAfter `runCadPythonCode` returns a DAG, pass it to `@cadbuildr/cad-kernel-r3f` (for example `KernelStlMesh` and `createKernelApiClient` pointed at your `kernel-api` base URL). The Pyodide and kernel layers are separate concerns; compose them in your app.\n","readmeFilename":"README.md"}