A WebAssembly backend for the Brian 2 simulator
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brian2wasm-0.4.3.tar.gz.
File metadata
- Download URL: brian2wasm-0.4.3.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c111604059ee8afd150be34cbe6c5f2364623f46300364dde1b4ac321bc9de33
|
|
| MD5 |
77fb93799234baf09cbb0ce419fdb70e
|
|
| BLAKE2b-256 |
976baf7d9b85726c68fa6130146ff7ef6d2645b4c02fb6dd8ddb9d7f125fd8ef
|
Provenance
The following attestation bundles were made for brian2wasm-0.4.3.tar.gz:
Publisher:
publish.yml on brian-team/brian2wasm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brian2wasm-0.4.3.tar.gz -
Subject digest:
c111604059ee8afd150be34cbe6c5f2364623f46300364dde1b4ac321bc9de33 - Sigstore transparency entry: 429855009
- Sigstore integration time:
-
Permalink:
brian-team/brian2wasm@4c18d134c8f371d418c12cf1dcb9783d8696b43c -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/brian-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c18d134c8f371d418c12cf1dcb9783d8696b43c -
Trigger Event:
push
-
Statement type:
File details
Details for the file brian2wasm-0.4.3-py3-none-any.whl.
File metadata
- Download URL: brian2wasm-0.4.3-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1479a7c8f257cc39b927b7551df00bdf3077394a913c889ecca7fd29ba6c02d8
|
|
| MD5 |
c62c3dc2b9355237a4113429e1723095
|
|
| BLAKE2b-256 |
0e772443037d51a2d4c86f15280d5c1fa8aa15382b98e72ec127e56166e40dc7
|
Provenance
The following attestation bundles were made for brian2wasm-0.4.3-py3-none-any.whl:
Publisher:
publish.yml on brian-team/brian2wasm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brian2wasm-0.4.3-py3-none-any.whl -
Subject digest:
1479a7c8f257cc39b927b7551df00bdf3077394a913c889ecca7fd29ba6c02d8 - Sigstore transparency entry: 429855023
- Sigstore integration time:
-
Permalink:
brian-team/brian2wasm@4c18d134c8f371d418c12cf1dcb9783d8696b43c -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/brian-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c18d134c8f371d418c12cf1dcb9783d8696b43c -
Trigger Event:
push
-
Statement type: