Neun Python Bindings
Python bindings for the Neun neural simulation library. High-performance computational neuroscience with an intuitive Python interface.
Features
- Multiple neuron models - Hodgkin-Huxley, Hindmarsh-Rose, and more
- High performance - C++ speed with Python convenience
- Synaptic coupling - Electrical and diffusion synapses
- Type safe - Strongly typed bindings prevent errors
- Extensible - Add custom models through JSON configuration
- NumPy integration - Seamless array operations
Quick start
Installation
Download the wheel matching your Python version and platform from the GitHub releases page, then install it:
python -m pip install /path/to/neun_py-<version>-<python>-<abi>-<platform>.whl
Release wheels are built for CPython 3.9-3.13 on x86-64 Linux (manylinux 2.28),
Windows, and macOS. A matching wheel contains the compiled extension and needs
neither a compiler nor a separate Neun installation. On other platforms, the
release source archive can be installed with python -m pip install /path/to/neun_py-<version>.tar.gz; this builds the extension and requires a
C++20 compiler and Python development headers, but not a separate Neun install.
From source
git clone https://github.com/GNB-UAM/neun_py.git
cd neun_py
make
The source tree bundles the header-only Neun library under include/neun;
the build generates the bindings from models.json and compiles them using
those headers. The examples extra installs plotting dependencies:
python -m pip install -e '.[examples]'
First simulation
import neun_py
import matplotlib.pyplot as plt
# Create Hodgkin-Huxley neuron
args = neun_py.HHDoubleConstructorArgs()
neuron = neun_py.HHDoubleRK4(args)
# Set parameters
neuron.set_param(neun_py.HHDoubleParameter.gna, 120 * 7.854e-3)
neuron.set_param(neun_py.HHDoubleParameter.gk, 36 * 7.854e-3)
# Initialize
neuron.set(neun_py.HHDoubleVariable.v, -65)
# Simulate
times, voltages = [], []
for i in range(100000):
neuron.add_synaptic_input(0.1)
neuron.step(0.001)
if i % 100 == 0:
times.append(i * 0.001)
voltages.append(neuron.get(neun_py.HHDoubleVariable.v))
plt.plot(times, voltages)
plt.xlabel('Time (ms)')
plt.ylabel('Voltage (mV)')
plt.savefig('spike.pdf')
Documentation
Full Documentation - Complete guides and API reference
Quick Links:
Examples
See the examples/ directory:
basic.py- Single neuron simulationsynapsis.py- Coupled neurons with electrical synapse
Run with:
python examples/basic.py --plot output.pdf
python examples/synapsis.py --plot coupled.pdf
Available models
| Model | Short Name | Description |
|---|---|---|
| Hodgkin-Huxley | HH |
Classic conductance-based model |
| Hindmarsh-Rose | HR |
Simplified bursting model |
| Izhikevich | Iz |
simplified model of neuronal activity |
Each model supports:
- Precisions:
Float,Double - Integrators:
RK4(4th order),RK6(6th order)
Example class names: HHDoubleRK4, HRFloatRK6
Development
Creating a release
After pushing the workflow to GitHub, use Actions > Release > Run workflow to test its source and wheel builds without creating a release. The manual run does not check the tag or publish artifacts to a GitHub release.
- Update
VERSIONinsetup.py, commit the change, and push it to GitHub. - Tag that commit with the same version and push the tag:
git tag v0.4.0
git push origin v0.4.0
Replace 0.4.0 with the new version; tags must match v plus VERSION.
3. The Release workflow builds an sdist and platform wheels, tests the wheels,
and creates a GitHub release with those files and generated notes. Check the
Actions run and the release page before sharing it. This does not publish to
PyPI.
Build system
make # Build and install in development mode
make clean # Remove build artifacts
make test # Run tests
make dist # Build distributions
Adding models
- Create C++ header in
include/neun/models/ - Add entry to
models.json - Rebuild with
make clean && make
See Adding Models Guide for details.
Contributing
Contributions welcome! See Contributing Guide.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
- ✅ Free to use and modify
- ✅ Open source required for derivatives
- ✅ Network use requires source availability
See LICENSE for full text.
Citation
If you use this software in your research, please cite:
@software{lareo2025neun,
title = {Neun},
author = {Angel Lareo},
year = {2025},
url = {https://github.com/GNB-UAM/Neun}
}
Links
- Documentation: https://gnb-uam.github.io/neun_py/
- Neun library: https://github.com/GNB-UAM/neun
- Source code: https://github.com/GNB-UAM/neun_py
- Issue tracker: https://github.com/GNB-UAM/neun_py/issues
Made with ❤️ by Angel Lareo
Metadata
Release files for neun-py 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neun_py-0.4.1.tar.gz | 52.9 kB | Without provenance | Details for neun_py-0.4.1.tar.gz |
Built distributions (wheels)
Total release size: 130.0 MB
Release files / neun_py-0.4.1.tar.gz
| Download URL | neun_py-0.4.1.tar.gz |
|---|---|
| Size | 52.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c68786c051de92d04bd92d704a27cb6e757166226e7cd7ffba5123cc7d62caa2
|
|
BLAKE2b-256 checksum How to use checksums |
606c9a913296773ee56cfc41f94c01c15efb46194639c3dccf566bf3207207ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp313-cp313-win_amd64.whl
| Download URL | neun_py-0.4.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 276.8 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2beefbca6c8bd5fb9d06e2f640940bd8a4f54882c73ccfea540dbfcd776392ec
|
|
BLAKE2b-256 checksum How to use checksums |
d324ba48ee1292b0f981a317b4223c5dddc1021c5691bd4357a6d8bf335edb11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | neun_py-0.4.1-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.9 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
1cae7c6a82cff0dd704f829cb6319ca4e3bb9b0a6685341642207b50e1607b62
|
|
BLAKE2b-256 checksum How to use checksums |
785693e3a34e5d876389445d593417883bc52acc0b1241ea179f87307999a47a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neun_py-0.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1b004859d60489698575e61733b2c87f677348ef316ef30cd940d8ff4c7e4617
|
|
BLAKE2b-256 checksum How to use checksums |
b3ecc3e35162cb56679e639a6f4c699330bd86e697e65b17979da7f7e3331465
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | neun_py-0.4.1-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 579.3 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
34f664e3f6384c9a621f26769afc96f3ffcd0541bf76a122e92cffcee6d7b67e
|
|
BLAKE2b-256 checksum How to use checksums |
ca7b797b9e47b2c67d73179999e877f7e6bedfd29b500a1acee61ebf8b15b7ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp312-cp312-win_amd64.whl
| Download URL | neun_py-0.4.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 276.8 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0292a7808c5c8192d3eea0dab2d3e7c9da9ac7c013327663acb4715c88d8a11d
|
|
BLAKE2b-256 checksum How to use checksums |
903852738c341fcab8b2444563c74747b6d25b31f7ad9b5e1815f7e192b406a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | neun_py-0.4.1-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.9 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
84a09e0a8f63f1832ca1209ff6d9fb0a985d1851b35745bbea8b6bc193a02189
|
|
BLAKE2b-256 checksum How to use checksums |
14435df6b7a468b462a017cd3a5738ccd770b9f122c5b51c1b7fa9f8b5cf2522
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neun_py-0.4.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
db0026ae134c54d25b70d94bf1a011915a4f02d9ce87d1ddefc3138da3d92b7a
|
|
BLAKE2b-256 checksum How to use checksums |
ac3985e75bf9ff8982b673482102f6a1e7fafeeef72dda06ab5324aa35cbb6be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | neun_py-0.4.1-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 579.2 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
d8dff6b5765296e59e31fed420a1c3481b487031f47b1dc6943e52d99e5fd4aa
|
|
BLAKE2b-256 checksum How to use checksums |
8009f07220cbefa8d4c2d80b0dc2ab1f2b5db377d4328fbff2f6a073708d05c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp311-cp311-win_amd64.whl
| Download URL | neun_py-0.4.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 275.4 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
136d26916270ff90473433eddf4142e78dae86c0ca4a9eb39b10a9a6d3a2245e
|
|
BLAKE2b-256 checksum How to use checksums |
f6537fa18c826b11bc867c834bd87db3f4b9b87c930aa99909ba8878ac70e5cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | neun_py-0.4.1-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.6 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
3bb49078a46b48827d35835a014e0202baefdfd23d16c65c6cd120739b6b75c8
|
|
BLAKE2b-256 checksum How to use checksums |
b7eb07b1bcee4f779a57823f59984ab08e2439fa9f0f7fafccdeee2aecbadc02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neun_py-0.4.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.4 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
cd35496cc59ee683832fb04e78251986314d82bbaafdfa248abcba235897a217
|
|
BLAKE2b-256 checksum How to use checksums |
20f7fdddd86af590e548bb06380b223349a7a6a8e5b0c545b231f93d6b36ae69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | neun_py-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 566.5 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
13beae1b4a605f558a6cae2334a99662b267351bc4cdd5407158774633c45718
|
|
BLAKE2b-256 checksum How to use checksums |
574364c5b3a217f8e4ad325278d4f881954da68b69a41a7cbdcd0178c76c9b31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp310-cp310-win_amd64.whl
| Download URL | neun_py-0.4.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 273.5 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e6283447f806f7c2ea06448f9eb4539e3030c1ff8385e66a3cc65ef176e5153b
|
|
BLAKE2b-256 checksum How to use checksums |
c87622c40151695ef72838a2072b11dc4985d827f4de6618dcb551d591acc73f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | neun_py-0.4.1-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
1b32f24650c5f8ef1bb029f7cdb3e711d41acc267915da6afded4909500a8168
|
|
BLAKE2b-256 checksum How to use checksums |
03ff081d08146edaf3bcd0786161692036b197661804b9b7c1a2ef86c83b6e16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neun_py-0.4.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.3 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9d49834620f197cdd4ab705c4be8768ec5fe8ac0e2ae4f7c265ef9af9890b87a
|
|
BLAKE2b-256 checksum How to use checksums |
290b37df94de4a36f3eb6e4057e5d02b265a3b7023c09ab31858829cf4935f5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | neun_py-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 565.2 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
001d976f6a7f6218788357a55d12e29295a1a8acb9c4c67038795863b5b5172c
|
|
BLAKE2b-256 checksum How to use checksums |
bcd233cd35440ea0bb6eb62f23564d0efda37074a6403774c3f241eb19821601
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp39-cp39-win_amd64.whl
| Download URL | neun_py-0.4.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 316.7 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3b9a2ffc8aa1dae10e9f1f0602ec235900df5fcdd08bc27d98aa67e65aa92ff7
|
|
BLAKE2b-256 checksum How to use checksums |
66ba41bae1bb93463e3570a7cdc8c32cadd2e1cadac2c5a17a97b4af0683d2de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp39-cp39-musllinux_1_2_x86_64.whl
| Download URL | neun_py-0.4.1-cp39-cp39-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
55ee6e7801894e242bd1f74ffacbe2c046c6ac2d029d19c6cec64d8161df2cbe
|
|
BLAKE2b-256 checksum How to use checksums |
9c6bea19676a815c5eb657393c6011de87d04d4f90a01d4cd380dcbb81aa8a59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neun_py-0.4.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.3 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
3a8b5864134809f44359c570e5da49083f3deca0b1bfd2c3989b68a5fd8e981f
|
|
BLAKE2b-256 checksum How to use checksums |
2fcc9a15275c96e41c14adf6c3ef9a1e99730f80fa14b90e431270038b81e046
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / neun_py-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | neun_py-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 565.3 kB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
08a5277b7b5f00bb0a9225561690645c65d3b5e498e48a9a46cf93935dd738a8
|
|
BLAKE2b-256 checksum How to use checksums |
4971443bcd7876ce17dac5cb69c468e251cef738eca34e1bdabf1d80903bb7a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for neun-py 0.4.1
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.