Brian2Wasm
Brian2Wasm is a Brian 2 “device” that compiles Brian models to WebAssembly and JavaScript via the Emscripten tool-chain.
The result is a self-contained web folder (index.html, wasm_module.js, and the .wasm binary) that runs your simulation in any modern browser.
Live examples: https://brian-team.github.io/brian2wasm/
Status – functional, but still under active development.
Installation & Usage (Pixi)
# 1 – install Pixi (https://pixi.sh)
curl -fsSL https://pixi.sh/install.sh | bash
# 2 – set up Brian2Wasm
git clone https://github.com/brian-team/brian2wasm.git
cd brian2wasm
pixi install # creates the full env (Python, emsdk, brian2, …)
pixi run setup # one-time EMSDK activation
pixi shell # enter the environment shell
# 3 – build and run an example
python -m brian2wasm examples/brunel_hakim1999.py
Headless build (no preview server)
python -m brian2wasm --no-server my_model.py
--no-server skips the temporary web-server and only generates the files.
⚠️ Limitations / Warnings
- Do not call
set_device(...)in your script—Brian2Wasm sets the device automatically.- Plotly charts inside the generated HTML load assets from a CDN.
Contributing
Contributions are welcome!
If you encounter a bug or have a feature request, please open an issue first.
Pull requests should target the main branch and follow conventional commit messages.
License
Brian2Wasm is released under the same open-source license as the core Brian 2 simulator (BSD-style).
See the LICENSE file in this repository for full details.
Metadata
Release files for brian2wasm 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| brian2wasm-0.4.3.tar.gz | 29.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| brian2wasm-0.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.8 kB
Release files / brian2wasm-0.4.3.tar.gz
| Download URL | brian2wasm-0.4.3.tar.gz |
|---|---|
| Size | 29.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c111604059ee8afd150be34cbe6c5f2364623f46300364dde1b4ac321bc9de33
|
|
BLAKE2b-256 checksum How to use checksums |
976baf7d9b85726c68fa6130146ff7ef6d2645b4c02fb6dd8ddb9d7f125fd8ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2025.
Transparency logRelease files / brian2wasm-0.4.3-py3-none-any.whl
| Download URL | brian2wasm-0.4.3-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1479a7c8f257cc39b927b7551df00bdf3077394a913c889ecca7fd29ba6c02d8
|
|
BLAKE2b-256 checksum How to use checksums |
0e772443037d51a2d4c86f15280d5c1fa8aa15382b98e72ec127e56166e40dc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2025.
Transparency log