Skip to main content

Header image of BrainPy - brain dynamics programming in Python.

Supported Python Version LICENSE Documentation PyPI version Continuous Integration Test Coverage

BrainPy is a flexible, efficient, and extensible framework for computational neuroscience and brain-inspired computation based on the Just-In-Time (JIT) compilation. It provides an integrative ecosystem for brain dynamics programming, including brain dynamics building, simulation, training, analysis, etc.

Installation

BrainPy is based on Python (>=3.11) and can be installed on Linux (Ubuntu 16.04 or later), macOS (10.12 or later), and Windows platforms.

pip install brainpy -U

If you want to use BrainPy with different hardware support, please install the corresponding version of BrainPy:

pip install brainpy[cpu] -U  # install with CPU support only
pip install brainpy[cuda12] -U  # install with CUDA 12.x support
pip install brainpy[cuda13] -U  # install with CUDA 13.x support
pip install brainpy[tpu] -U  # install with TPU support

Install the brainpy with the ecosystem packages:

pip install BrainX -U

Using BrainPy with Binder

We provide a Binder environment for BrainPy. You can use the following button to launch the environment:

Binder

Ecosystem

Citing

If you are using brainpy >= 2.0, please consider citing the corresponding paper:

@article {10.7554/eLife.86365,
    article_type = {journal},
    title = {BrainPy, a flexible, integrative, efficient, and extensible framework for general-purpose brain dynamics programming},
    author = {Wang, Chaoming and Zhang, Tianqiu and Chen, Xiaoyu and He, Sichao and Li, Shangyang and Wu, Si},
    editor = {Stimberg, Marcel},
    volume = 12,
    year = 2023,
    month = {dec},
    pub_date = {2023-12-22},
    pages = {e86365},
    citation = {eLife 2023;12:e86365},
    doi = {10.7554/eLife.86365},
    url = {https://doi.org/10.7554/eLife.86365},
    abstract = {Elucidating the intricate neural mechanisms underlying brain functions requires integrative brain dynamics modeling. To facilitate this process, it is crucial to develop a general-purpose programming framework that allows users to freely define neural models across multiple scales, efficiently simulate, train, and analyze model dynamics, and conveniently incorporate new modeling approaches. In response to this need, we present BrainPy. BrainPy leverages the advanced just-in-time (JIT) compilation capabilities of JAX and XLA to provide a powerful infrastructure tailored for brain dynamics programming. It offers an integrated platform for building, simulating, training, and analyzing brain dynamics models. Models defined in BrainPy can be JIT compiled into binary instructions for various devices, including Central Processing Unit (CPU), Graphics Processing Unit (GPU), and Tensor Processing Unit (TPU), which ensures high running performance comparable to native C or CUDA. Additionally, BrainPy features an extensible architecture that allows for easy expansion of new infrastructure, utilities, and machine-learning approaches. This flexibility enables researchers to incorporate cutting-edge techniques and adapt the framework to their specific needs},
    journal = {eLife},
    issn = {2050-084X},
    publisher = {eLife Sciences Publications, Ltd},
}

If you want to cite brainpy 1.0, please consider using the corresponding paper:

@inproceedings{wang2021just,
    title={A Just-In-Time Compilation Approach for Neural Dynamics Simulation},
    author={Wang, Chaoming and Jiang, Yingqian and Liu, Xinyu and Lin, Xiaohan and Zou, Xiaolong and Ji, Zilong and Wu, Si},
    booktitle={International Conference on Neural Information Processing},
    pages={15--26},
    year={2021},
    organization={Springer}
}

Metadata

Release files for brainpy 2.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brainpy 2.9.0
File Size Uploaded Provenance Actions
brainpy-2.9.0.tar.gz 890.9 kB Without provenance Details for brainpy-2.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brainpy 2.9.0
File Interpreter ABI Platform Actions
brainpy-2.9.0-py3-none-any.whl Python 3 none any Details for brainpy-2.9.0-py3-none-any.whl

Total release size: 2.1 MB

Release files / brainpy-2.9.0.tar.gz

Download URL brainpy-2.9.0.tar.gz
Size 890.9 kB
Tags Source
SHA-256 checksum
How to use checksums
243a7daed94cd602ab5048d0e57939bbeea24473e4e83f9bc4ca956fce4af707
BLAKE2b-256 checksum
How to use checksums
8b8e7948eae2f59e7bd104089402f185ce962a21e1399dd8ac7f27e4c3a8aa3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / brainpy-2.9.0-py3-none-any.whl

Download URL brainpy-2.9.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9af37cc8bee8c5c51a9efc6d98fef5cd17ec78c1240a21d76d9b6124fd1a205b
BLAKE2b-256 checksum
How to use checksums
37f7a4438a01bd080e1dacfa5e5c69e46f023dcb2ed3c1acb5681a1d47f328f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for brainpy 2.9.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.9.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page