I need a library capable of compiling TypeScript to JS for Python.

  • Platform: Python 2.7.x.
  • If the library depends on an external executable, the SO is Ubuntu 14.04 or upper. Otherwise, SO doesn't matter.
  • Expected features (at least one of them):
    • Given a TypeScript filename, generate compiled JS.
    • Given a TypeScript chunk (string), generate compiled JS chunk (string).
  • Package/repository actively maintained.
  • Your question and title do not match: are you looking for a compiler or a parser? I think you would be best for compiling to use a regular typescript compiler and call this from Python – Philippe Ombredanne Jun 22 '16 at 16:17
  • For the sake of typescript usage as of today, the distinction is irrelevant. But yes, i will update the question now – Luis Masuelli Jun 22 '16 at 16:18

You can try this https://github.com/amol-/dukpy which is a combo of Python and C and offers limited TypeScript compilation capabilities.

In general you might be better off using a native TypeScript compiler and call it from Python instead

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.