An implementation of Python 3 that runs directly in web browsers, enabling Python as a client-side scripting language.
Brython is an implementation of Python 3 designed to run directly in web browsers, allowing developers to write client-side scripts in Python instead of JavaScript. It solves the problem of context switching between backend Python and frontend JavaScript by enabling Python to interact with DOM elements, handle events, and integrate with existing JavaScript libraries. This makes web development more accessible to Python developers and simplifies full-stack Python applications.
Python developers who want to use Python for client-side web scripting, educators teaching web development with Python, and teams building full-stack Python applications seeking consistency across frontend and backend.
Developers choose Brython because it allows them to leverage Python's clean syntax and extensive standard library for frontend development, reducing the need to learn JavaScript for basic web interactions. Its seamless integration with JavaScript libraries and zero-install CDN option make it easy to adopt and prototype quickly.
Brython (Browser Python) is an implementation of Python 3 running in the browser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports Python 3 syntax and most standard library modules, allowing Python developers to write client-side code without learning JavaScript, as shown in the example using 'from browser import bind, document, alert'.
Can be loaded via CDN without local installation, enabling quick setup and deployment, demonstrated by the jsDelivr scripts in the README for easy integration.
Interfaces with popular JavaScript libraries like jQuery, D3, and Highcharts, making it feasible to leverage existing web tools directly from Python code.
Includes built-in libraries to manipulate DOM elements and handle events, as illustrated in the simple example with '@bind' decorators for click events.
Running interpreted Python in the browser introduces execution speed penalties compared to native JavaScript, which can impact responsive or compute-intensive applications.
Excludes browser-irrelevant CPython modules (e.g., disk writing), restricting functionality for tasks that rely on full Python capabilities outside the web context.
Loading brython.js and brython_stdlib.js adds significant download size (multiple MBs), potentially slowing initial page loads and affecting user experience on slow networks.