Brython
brython.info
- Free plan
- Web
- iPhone and iPad
- Android
- Self-hosted
What Brython is
Brython implements Python 3 for interactive web applications inside HTML pages. Python code can access browser pages through the DOM using document and window objects, while browser.html exposes HTML4, HTML5, and some HTML5.1 tags as Python classes. Examples cover page changes, events, graphics, animations, Ajax requests, and local file selection. The browser.aio module supports asynchronous programming with async and await, and JavaScript objects and libraries can be used from Python. Brython can load from jsDelivr or cdnjs without installation, or be installed with pip or a GitHub release archive. Compatible packages can be added with brython-cli add_package, and .brython.js bundles can be hosted on any server. Browser restrictions limit requests and file access. Python packages relying on C extensions, including NumPy, Matplotlib, and Pandas, are not supported.
Who it suits
It suits developers who want Python syntax for browser applications and DOM work across modern browsers, including smartphones. It is less suitable for packages dependent on C extensions or unrestricted file and network access.
Good to know, and what to watch
- Uses Python for interactive web pages
- Provides direct DOM access
- Supports async and await
- Can load without installation
- Works across modern browsers
- Cannot write files through documented interface
- Network requests face browser restrictions
- C-extension packages are unsupported
The verdict
Brython brings Python-style development to client-side HTML applications with DOM, event, graphics, and asynchronous capabilities. Browser security and package constraints remain important when planning networking, file handling, or data-science dependencies.
What the maker publishes
- Async programming
- The Brython-specific browser.aio module supports asynchronous programming with async and await. source
- Async programming
- The CPython asyncio module is not usable in Brython; the documentation provides the Brython-specific browser.aio module instead. source
- Browser features
- Its examples cover creating and modifying page elements, events, graphics, animations, Ajax requests, and local file selection. source
- Browser file limits
- The browser environment prevents file writing, and file reading is limited to files accessible through Ajax requests. source
- Browser support
- The FAQ says Brython supports all modern browsers, including browsers on smartphones. source
- Deployment
- A Brython application can be deployed by uploading its directory to a server or packaged for distribution through PyPI. source
- Distribution
- Brython packages bundle importable modules in .brython.js files that can be hosted on any server. source
- DOM interface
- Brython provides browser-facing modules for working with the DOM, including document and window. source
- DOM support
- Brython provides access to browser pages through the DOM using the browser module's document and window objects. source
- File access limits
- Browser file access is constrained: writing is impossible through the documented Python file interface, and reading is limited to files reachable by Ajax requests. source
- HTML elements
- The browser.html module exposes HTML4, HTML5, and some HTML5.1 tags as Python classes. source
- Installation
- Brython can be used from jsDelivr or cdnjs without installation, or installed locally with pip or a GitHub release archive. source
- Install options
- Brython can be loaded from jsDelivr or cdnjs without installation, or installed locally with pip or a downloadable release. source
- Integrations
- A CPython package installed with pip can be added to a Brython application with brython-cli add_package. source
- JavaScript interoperability
- Brython provides ways for Python code to use JavaScript objects and libraries. source
- Network limitations
- Browser code can make Ajax requests to its own domain and to sites that support cross-origin requests; the FAQ gives requests as an incompatible example. source
- Package limitations
- The FAQ says Brython cannot use CPython packages that rely on C extensions, naming NumPy, Matplotlib, and Pandas as examples. source
- Package limits
- Brython runs Python programs, not programs written in C, so numpy and data science packages that rely on it will not work. source
- Purpose
- Brython implements Python 3 for programming interactive web applications in HTML pages. source
- Purpose
- Brython implements Python 3 in the browser and lets developers run Python code in HTML pages. source
- Python syntax
- Brython supports the keywords and functions of the corresponding Python version, subject to browser and JavaScript limitations. source
- Security and compliance
- The official pages reviewed provide no stated security certification or compliance claim. source
- Security constraints
- Browser restrictions limit HTTP requests; packages such as requests and urllib.request cannot send arbitrary requests to any URL. source
- Supported library
- Brython includes part of the CPython standard library and can install compatible Python packages, but packages containing C-written files are excluded. source
Checked against the maker's pages on 8 Oct 2026.