CLI tool
TranscryptOrg/Transcrypt avatar
TranscryptOrg/Transcrypt

Transcrypt: a Python 3.9 to JavaScript compiler that ships readable output

Python 3.9 to JavaScript compiler - Lean, fast, open!

2,916 stars218 forksPythonApache-2.0

At a glance

What is it?
Transcrypt precompiles Python 3.9 into JavaScript instead of interpreting it in the browser. It suits teams that want Python's module and class structure in a front end that still loads like plain JavaScript.
Who is it for?
Adopt Transcrypt if your front end is large enough that Python's module and class structure is worth a build step, and if you accept that eval, exec and most CPython libraries are absent by design. Do not adopt it if you need to run arbitrary Python strings at runtime, or if you depend on desktop-oriented Python packages rather than JavaScript ones.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 103 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem Transcrypt solves for browser front ends

Writing a large browser application in JavaScript means either accepting the language as it is or adding a build step that compiles something else into it. Transcrypt takes the second route and compiles Python 3.9 into JavaScript ahead of time. The README describes the output as "highly readable, efficient JavaScript" that "downloads kB's rather than MB's", and states that the generated code resembles the Python source line by line, optionally annotated with source line numbers.

The audience is narrower than "Python developers". The README is explicit that Transcrypt favors access to existing JavaScript libraries over bundling Python ones, with math, cmath, random, itertools, re, time, datetime and turtle named as exceptions. So the intended user is someone building a web application who wants Python's syntax, modules, classes and decorators, and who is willing to use the JavaScript ecosystem for everything else. If your code depends on a desktop-oriented Python package, Transcrypt is the wrong tool and the README says so directly.

Compile-ahead design and what it rules out

The mechanism is a compiler, not an interpreter. Transcrypt uses Python's own parser for 3.9 syntax, then emits JavaScript. Because compilation happens before the page loads, the README states there is no eval and no exec of Python code, and frames this as part of the concept: code is "compiled, optimized and minified in advance to warant fast page loads".

That single decision separates Transcrypt from tools that compile on the fly in the browser. The trade-off is real. Anything that depends on evaluating a Python string at runtime cannot work, so configuration formats, plugin systems or template engines that expect eval need a different approach. In exchange, the browser receives plain JavaScript that starts executing immediately.

The README also lists language features that survive the trip: multiple inheritance, optional operator overloading, metaclasses, async/await, properties, decorators and hierarchical modules. Multiple inheritance in particular is not something you get for free in JavaScript, and the README shows a side-by-side comparison of Python and JavaScript classes to make the point. Debugging is handled through integrated sourcemaps, so the browser's developer tools can map generated JavaScript back to the Python source.

Installing Transcrypt and compiling a first file

The README's closing line is "Pip-install and go!", and setup.py declares a console script named transcrypt that points at transcrypt.__main__:main. The package name in setup.py is Transcrypt, and the runtime dependency is mypy, which is how the integrated static type checking is delivered.

Install it from PyPI with pip:

bash
pip install Transcrypt

After installation the transcrypt command should be on your PATH. The README does not reproduce a compile invocation, so check the documentation at transcrypt.org for the exact syntax your version expects before running it on a real project.

The README states that static type checking and minification are available "at the tip of a command line switch", but it does not name that switch. The README also states that Transcrypt runs on top of node.js, which matters if you want to exercise the same compiled output outside a browser. The supported platforms listed in the contribution section are Windows and Linux, and with Linux, OSX.

Where Transcrypt is the wrong choice

The clearest limitation is the one the project states itself: no eval and no exec of Python code. If your design needs to run Python supplied at runtime, Transcrypt cannot serve it, and no configuration change will fix that. This is a design goal, not a missing feature.

The second limitation is library coverage. Transcrypt deliberately does not ship most of the Python standard library. The README's stated position is that "better 90% complete, fast, small, and reliable, than 100% complete, slow, bulky and buggy", and it invites contributions of standard libraries with autotests and documentation. Read that as an honest description of scope rather than a roadmap promise.

The third is governance. The README describes Transcrypt as "a dictatorial rather than a democratic project", with final say on what enters the codebase resting with the original author, and it advises opening an issue before a pull request, especially for the core. Core code is defined as everything under ../transcrypt/modules/org/transcrypt plus ../transcrypt/__main__.py. If your team needs to land changes on its own schedule, that structure is a constraint worth weighing before adoption.

Transcrypt compared with Brython

The most common comparison is with Brython, which takes the opposite approach: it runs Python in the browser rather than compiling it ahead of time. The practical difference follows from that. Brython can evaluate Python at runtime, which Transcrypt cannot, and Transcrypt produces a JavaScript artifact that downloads and starts like any other script, which is the property the README emphasizes when it says Transcrypt is "targeted towards building professional, extensive, real world web applications that load and run as fast as their JavaScript counterparts".

If your application is a teaching tool, a notebook-like environment, or anything that accepts Python from the user, the runtime-evaluation model is the one you want. If your application is a product front end where page load time and predictable bundling matter, compile-ahead is the better fit. Neither choice is reversible without rewriting the parts of the application that depend on it, so it is worth deciding early.

Maintenance, releases and licence

The repository is not archived. Its last push was on 2026-06-20, which is also the date of the v3.9.5 release, labelled "3.9.5 Berlin". The previous releases were v3.9.4 on 2025-05-23 and v3.9.3 on 2024-07-28. The gaps between those three releases are roughly a year, so plan upgrades around an annual cadence rather than expecting frequent point releases.

On upgrade cost, setup.py pins the install to mypy, so a Transcrypt upgrade can pull a different mypy alongside it. The README describes a deployment testing process that precedes each release: back-to-back automated tests on Linux and Windows, compilation and manual exercising of the manual tests and the demos, and a documentation build. That is a description of the project's own process, not a guarantee about your application; you still need to recompile and exercise your own code after upgrading.

The licence is Apache 2.0, stated in setup.py as 'Apache 2.0' and in the README as the Apache License, Version 2.0, with the copyright line reading "Copyright 2014 - 2023 Jacques de Hooge, GEATEC engineering". Apache 2.0 is a permissive licence that includes an explicit patent grant, but it also requires that you preserve the licence and notice files when redistributing. This is a description of the licence text, not legal advice; read the LICENSE file in the repository for the terms that apply to you.

Editorial conclusion

Adopt Transcrypt if your front end is large enough that Python's module and class structure is worth a build step, and if you accept that eval, exec and most CPython libraries are absent by design. Do not adopt it if you need to run arbitrary Python strings at runtime, or if you depend on desktop-oriented Python packages rather than JavaScript ones. Verify first that your target browsers and your existing JavaScript dependencies work with the generated output, and check the release notes for the version you install, since the repository's last push was on 2026-06-20.

Frequently asked questions

How can I convert Python code to JavaScript with Transcrypt?

Install the package with pip, then use the transcrypt command that setup.py registers as a console script. Transcrypt uses Python's native parser for 3.9 syntax and emits JavaScript that resembles the source line by line.

How does Transcrypt differ from Brython?

Transcrypt compiles Python to JavaScript ahead of time and states that it has no eval or exec of Python code, while the README describes tools that compile on the fly in the browser as a fundamentally different design goal. The compile-ahead approach is aimed at page loads that match plain JavaScript.

Is Transcrypt the same as git-crypt?

No. Transcrypt here is a Python to JavaScript compiler from TranscryptOrg, installed with pip and licensed under Apache 2.0. It has nothing to do with file encryption tooling.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. TranscryptOrg/Transcrypt on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/transcryptorg-transcrypt.svg)](https://hysenlabs.com/projects/transcryptorg-transcrypt)