py2tsd

0.0.2 • Public • Published

py2tsd

NPM version Build Status Gitpod ready-to-code

Python to TypeScript definition generator. Intended for use with JsPyBridge.

Uses the Python astexporter lib written by fpoli to run Python AST to JSON.

Install

npm install -g py2tsd
or
npx py2tsd

Usage

py2tsd v0.0.1
        Each time you run this CLI tool, we'll append to the last exported TSD. To avoid this, you can use the --clear flag.
usage: py2tsd 
        <[--input | -i] python directory OR installed package name>
        <[--ts-out | -t] output tsd location> 
        [[--exclude | -x] optional regex to use to skip python files]
        [[--match | -m] require match of regex string]
        [--clear | -c] -- clear the workspace cache
npx py2tsd -i ./myPythonDir/ -o types.d.ts
npx py2tsd -i tensorflow -o tf.d.ts
npx py2tsd -i torch -o tf.d.ts -c

Package Sidebar

Install

npm i py2tsd

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

23.9 kB

Total Files

13

Last publish

Collaborators

  • extremeheat