Run your existing Python functions from TypeScript, with generated signatures and autocomplete. Bring NumPy, pandas, and SciPy into your app without writing each wrapper by hand.

Working with a coding agent? Give it the tywrap guide.
Connect existing calculations and data tools to your TypeScript app.
Generate callable functions from Python annotations, with parameter and return types in your editor.
Return NumPy arrays and pandas tables to your app. Node and Bun can use Arrow for binary transfer.
Use a local Python process with Node or Bun, or run Python in the browser with Pyodide.
Install the TypeScript package and Python generator. Then create a config and generate wrappers for the Python modules you want to call.
npm install tywrap
pip install tywrap-ir # Python component for code generation
npx tywrap init
npx tywrap generatetywrap and tywrap-ir are versioned independently. Install the latest published release of each package unless you need to pin them explicitly.
import { NodeBridge } from 'tywrap/node';
import { setRuntimeBridge } from 'tywrap/runtime';
import * as math from './generated/math.generated.js';
setRuntimeBridge(new NodeBridge({ pythonPath: 'python3' }));
const result = await math.sqrt(16); // 4See the getting started guide to configure your own Python module and choose a runtime bridge.
Experimental: APIs may change before v1.0.0. See Releases for breaking changes.