{"id":13446074,"url":"https://github.com/brython-dev/brython","last_synced_at":"2025-05-14T07:08:03.300Z","repository":{"id":20761615,"uuid":"24046239","full_name":"brython-dev/brython","owner":"brython-dev","description":"Brython (Browser Python) is an implementation of Python 3 running in the browser","archived":false,"fork":false,"pushed_at":"2025-05-05T12:10:55.000Z","size":258697,"stargazers_count":6468,"open_issues_count":66,"forks_count":519,"subscribers_count":135,"default_branch":"master","last_synced_at":"2025-05-07T07:00:00.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brython-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-09-15T06:58:21.000Z","updated_at":"2025-05-05T12:10:59.000Z","dependencies_parsed_at":"2024-04-24T07:54:07.021Z","dependency_job_id":"8dbb8b9e-0672-45fa-9831-1204e66acffb","html_url":"https://github.com/brython-dev/brython","commit_stats":{"total_commits":7152,"total_committers":117,"mean_commits":61.12820512820513,"dds":0.6550615212527964,"last_synced_commit":"ea7bdca35ef71e439710ae1397aa63c2920d3506"},"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brython-dev%2Fbrython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brython-dev%2Fbrython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brython-dev%2Fbrython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brython-dev%2Fbrython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brython-dev","download_url":"https://codeload.github.com/brython-dev/brython/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092652,"owners_count":22013290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:00:44.863Z","updated_at":"2025-05-14T07:08:03.263Z","avatar_url":"https://github.com/brython-dev.png","language":"Python","readme":"brython\n=======\n\nBrython (Browser Python) is an implementation of Python 3 running in the\nbrowser, with an interface to the DOM elements and events.\n\nHere is a simple example of an HTML page running Python:\n\n```html\n\u003chtml\u003e\n\n    \u003chead\u003e\n        \u003cscript src=\"/path/to/brython.js\"\u003e\u003c/script\u003e\n    \u003c/head\u003e\n\n    \u003cbody\u003e\n\n        \u003cscript type=\"text/python\"\u003e\n        from browser import bind, document, alert\n\n        @bind(document['mybutton'], 'click')\n        def echo(event):\n            alert(document[\"zone\"].value)\n        \u003c/script\u003e\n\n        \u003cinput id=\"zone\"\u003e\u003cbutton id=\"mybutton\"\u003eclick !\u003c/button\u003e\n\n    \u003c/body\u003e\n\n\u003c/html\u003e\n```\n\nTo use Brython, all there is to do is:\n\n1. Load the script [brython.js](http://brython.info/src/brython.js \"Brython from the site brython.info\").\n2. Write Python code inside tags `\u003cscript type=\"text/python\"\u003e`.\n\n\nMain features\n=============\nBrython supports the syntax of [Python 3](https://www.python.org \"Python Homepage\"),\nand the modules of the CPython distribution written in Python, except for the\nfeatures that are not relevant in the browser context (writing on disk for\ninstance).\n\nSince version 3.8.0, Brython implements the Python version of the same major /\nminor version number.\n\nIt includes libraries to interact with DOM elements and events,\nand with existing Javascript libraries such as jQuery, D3, Highcharts, Raphael etc.\nIt supports the latest specs of HTML5/CSS3, and can use CSS Frameworks like\nBootstrap3, LESS, SASS etc.\n\n\nGetting started\n===============\nZero install !\n--------------\nThe most simple way to get started, without anything to install, is to use the\ndistribution available online through [jsDelivr](https://www.jsdelivr.com/).\nYou can choose the latest stable release :\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/brython@3.13.1/brython.min.js\"\u003e\n\u003c/script\u003e\n```\n\nThe previous code will allow you to use raw python code, but if you import\nmodules from the standard library you have to load a single javascript file\nwith the [available stdlib](https://github.com/brython-dev/brython/tree/master/www/src/Lib):\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/brython@3.13.1/brython_stdlib.js\"\u003e\n\u003c/script\u003e\n```\n\njsDelivr supports version ranges, so if you want the latest of the\n3.13.x versions:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/brython@3.13/brython.min.js\"\u003e\n\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/brython@3.13/brython_stdlib.js\"\u003e\n\u003c/script\u003e\n```\n\nor the latest of the 3.x.y versions:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/brython@3/brython.min.js\"\u003e\n\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/brython@3/brython_stdlib.js\"\u003e\n\u003c/script\u003e\n```\n\nIf you want to use the latest development version, you can load these scripts\ninstead:\n```html\n\u003cscript src=\"https://raw.githack.com/brython-dev/brython/master/www/src/brython.js\"\n        crossorigin=\"anonymous\"\u003e\n\u003c/script\u003e\n\u003cscript src=\"https://raw.githack.com/brython-dev/brython/master/www/src/brython_stdlib.js\"\n        crossorigin=\"anonymous\"\u003e\n\u003c/script\u003e\n```\n\nLocal install\n-------------\nTo install Brython locally, if you have a CPython distribution with `pip` :\n\n```bash\npip install brython\n```\n\nthen create a new directory and run\n\n```bash\nbrython-cli install\n```\n\nor by loading the latest version of the Brython zip file from the\n[releases page](https://github.com/brython-dev/brython/releases).\n\nIn both cases, the distribution includes __brython.js__ (the core Brython engine)\nand __brython_stdlib.js__ (a bundle of all the files in the standard distribution).\n\nIt also includes the page __demo.html__ that shows a few examples of how you\ncan interact with a web page using Python as the scripting language : create\nnew elements, access and modify existing elements, create graphics, animations,\nsend Ajax requests, etc.\n\nTest Brython online\n===================\nIf you want to test Brython online you can visit the following:\n\n- [Editor](http://brython.info/tests/editor.html \"Online Brython Editor\")\n- [Console](http://brython.info/tests/console.html \"Online Brython Console\")\n\n\nGallery of examples\n===================\nThere is a [gallery of examples](http://brython.info/gallery/gallery_en.html \"gallery of examples\")\nwhere you can see simple and advanced examples using vanilla Brython or\ninteracting with Javascript libraries.\n\n\nDocumentation\n=============\nYou can start by reading the official [Brython tutorial](https://brython.info/static_tutorial/en/index.html).\n\nFull documentation is available on the [official site](http://www.brython.info \"Brython Homepage\").\nYou can read the docs in [English](http://brython.info/static_doc/en/intro.html) and\n[French](http://brython.info/static_doc/fr/intro.html).\n\nCurious about [how Brython works](https://github.com/brython-dev/brython/wiki/How%20Brython%20works) ?\n\nA [tutorial](https://github.com/brython-dev/brython/wiki/Writing-an-Android-application)\nexplains how to build Android applications with Brython.\n\nYou can also [Ask Brython Guru](https://gurubase.io/g/brython), it is a Brython-focused AI to answer your questions.\n\nCommunity (questions, feedback, issues, new features, ...)\n==========================================================\nYou can subscribe and post to the\n[mailing list](https://groups.google.com/forum/?fromgroups=#!forum/brython \"Brython Main Mailing List\").\n\nIf you find a bug/issue or do you want to see a new feature in Brython, please,\n[open a new issue](https://github.com/brython-dev/brython/issues \"Brython GitHub Issues\").\n\nIf you want to contribute to Brython, please read the [contributing guide](https://github.com/brython-dev/brython/blob/master/CONTRIBUTING.md).\n\nThank you\n=========\n\n- [BrowserStack](http://www.browserstack.com) for providing an access\nto their online testing environment.\n","funding_links":[],"categories":["Python to JavaScript transpilers","Python","Programming","Uncategorized","others","Libraries","Langages","4. Python Lib","Python Implemented in Other Languages"],"sub_categories":["Active projects","Python  \u003cimg src=\"https://raw.github.com/pcgeek86/awesome-trevor/main/assets/Python.svg?sanitize=true\" height=18\u003e","Uncategorized","Anpylar","Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrython-dev%2Fbrython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrython-dev%2Fbrython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrython-dev%2Fbrython/lists"}