Skip to main content

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.

PyPI

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brian2wasm-0.4.3.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brian2wasm-0.4.3-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

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

Hashes for brian2wasm-0.4.3.tar.gz
Algorithm Hash digest
SHA256 c111604059ee8afd150be34cbe6c5f2364623f46300364dde1b4ac321bc9de33
MD5 77fb93799234baf09cbb0ce419fdb70e
BLAKE2b-256 976baf7d9b85726c68fa6130146ff7ef6d2645b4c02fb6dd8ddb9d7f125fd8ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for brian2wasm-0.4.3.tar.gz:

Publisher: publish.yml on brian-team/brian2wasm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for brian2wasm-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1479a7c8f257cc39b927b7551df00bdf3077394a913c889ecca7fd29ba6c02d8
MD5 c62c3dc2b9355237a4113429e1723095
BLAKE2b-256 0e772443037d51a2d4c86f15280d5c1fa8aa15382b98e72ec127e56166e40dc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for brian2wasm-0.4.3-py3-none-any.whl:

Publisher: publish.yml on brian-team/brian2wasm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page