B

Code Transpilers

Brython: Python 3 for Interactive Web Pages

brython.info · checked 8 Oct 2026

Run Python 3 in HTML pages to build interactive web applications.

How it plugs in

—Public API
NoOpen source
YesFree tier

Signal on Code Transpilers6.3#12 of 28

Brython brings Python 3 into web pages for interactive applications. It exposes browser elements through document and window objects, supports events, graphics, animations, Ajax, and asynchronous code, and can work with JavaScript libraries. You can load it from a CDN, install it locally, or deploy its bundled modules to a server. Browser and package limits apply.

Brython home page

Review

In a line

Brython implements Python 3 for interactive web applications written in HTML pages. It is an open-source, free tool.

What it does

Python code can create and change page elements, respond to events, draw graphics, run animations, make Ajax requests, and let users select local files. The browser.html module represents HTML tags as Python classes.

The browser.aio module adds asynchronous programming with async and await. Brython also lets Python code work with JavaScript objects and libraries, while supporting the keywords and functions of the matching Python version within browser and JavaScript limits.

How it connects

Brython works in web pages and supports Android, iOS, self-hosted setups, and modern browsers, including smartphone browsers. It can load from jsDelivr or cdnjs without installation, or be installed with pip or a GitHub release archive.

A CPython package installed with pip can be added through brython-cli add_package when it is compatible. Brython includes part of the CPython standard library, provides CLI and API access, and bundles importable modules in .brython.js files that can be hosted on any server.

Applications can be uploaded as a directory or packaged for distribution through PyPI.

Good fit

Brython suits people who want Python syntax for browser interfaces instead of writing the page logic in JavaScript. It fits interactive pages that need DOM access, browser events, graphics, Ajax, or asynchronous tasks.

It can also suit projects that need to mix Python with JavaScript libraries, provided their Python packages do not depend on C-written files.

Watch for

Browser security rules restrict network calls. Ajax requests can reach the application's own domain and sites that allow cross-origin requests, but packages such as requests and urllib.request cannot make arbitrary requests to every URL.

The browser cannot write files through the documented Python file interface, and reading is limited to files reachable through Ajax. Packages that rely on C extensions, including NumPy, Matplotlib, and Pandas, will not work.

Python support is subject to browser and JavaScript limits. The official pages provide no stated security certification or compliance claim.

Pricing

Brython is free and open source. The supplied plan details include a free plan and no paid price.

Verdict

Choose Brython when your team prefers Python for browser-based interfaces and needs direct access to page elements, browser events, or JavaScript code. Its CDN, local installation, and server deployment options give you several ways to deliver an application.

Look elsewhere if your project depends on C-based Python packages, unrestricted web requests, or ordinary browser file writing. Those constraints are part of the environment, not optional settings.

Our take

Brython is a practical choice for Python developers building interactive pages who can stay within browser rules. It offers several installation paths, browser-oriented modules, asynchronous support, and JavaScript interoperability without a subscription charge. The trade-off is a narrower package and file environment than standard Python: C-extension libraries are excluded, network access is restricted, and browser file handling is limited. Review your dependencies and request patterns before adopting it, especially for data-science work or applications that need broad filesystem access.

  • Free and open source
  • Runs Python 3 in HTML pages
  • DOM, events, graphics, animations, and Ajax support
  • Works with JavaScript objects and libraries
  • Can load from CDNs or install locally
  • C-extension packages such as NumPy, Matplotlib, and Pandas do not work
  • Browser rules restrict requests to some URLs
  • Browser file writing is unavailable
  • File reading is limited to Ajax-reachable files
  • Python behavior is subject to browser and JavaScript limits
  • Pick it ifPython-based interactive web pages; Projects needing DOM and JavaScript access; Browser apps that avoid C-extension packages
  • Skip it ifYou need NumPy, Matplotlib, Pandas, or other C-based Python packages; Your app needs unrestricted network requests or browser file writing; You require broad filesystem access in the browser

Pricing

Brython is free and open source. A free plan is included, with no paid price in the supplied details.

Questions

Is Brython free?

Yes. Brython is free and open source, and the supplied plan details include a free plan.

Where can Brython run?

It runs in web pages and supports Android, iOS, self-hosted setups, and modern browsers, including smartphone browsers.

How do I install Brython?

Load it from jsDelivr or cdnjs without installation, or install it locally with pip or a GitHub release archive.

Can Brython use Python packages?

It includes part of the CPython standard library and can add compatible pip packages. Packages containing C-written files are excluded.

Can Brython make web requests?

Browser rules limit requests. Ajax can reach the app's own domain and sites allowing cross-origin requests, but requests and urllib.request cannot call every URL.

Can Brython read and write local files?

Writing is not possible through the documented Python file interface. Reading is limited to files reachable through Ajax requests.

Does Brython support JavaScript?

Yes. Python code can use JavaScript objects and libraries, and browser modules expose page elements through document and window.