Skip to main content

snnlab

A Python library for authoring, simulating and visualising spiking neural networks with conductance-based and current-based dynamics.

uv add snnlab
from snnlab import analysis, lang, sim, viz
  1. snnlab.lang authors and validates deterministic graph bundles.
  2. snnlab.sim executes graphs and supports surrogate-gradient training.
  3. snnlab.viz renders recordings, diagrams, figures and animations.
  4. snnlab.analysis measures population activity, rhythmicity and conductance trajectories from recorded NumPy data.
  5. snnlab.extensions registers versioned Python definitions for custom dynamics, weights, operations, training and encoders.

The graph simulator supports COBA-LIF, current-based LIF and leaky-integrator populations, conductance and exponential-current synapses, recurrent/feedback connections and integer-timestep delays. Registered Python callbacks add custom models without embedding code in bundles; import their registration module before compilation or execution. See examples/current-lif/current_lif.py for a built-in current-based simulation and examples/customisation/customisation.py for an adaptive current neuron and custom weight distribution.

The simulator executes authored graph bundles. Legacy Config/COBANet execution, flag-built networks and config replay have been removed; see the CLI reference for current inputs and controls.

Simulator commands

uv run snnsim --help
uv run python -m snnlab.sim sim --help

Graphviz (dot) is required for diagram exports. FFmpeg is required for video exports. Install these separately through your operating system package manager. Core authoring and simulation do not require either executable.

Development

uv sync --dev
uv run pytest -m "not slow"

For development in Pinglab, use uv add --editable ../snnlab. For reproducible runs, use a Git tag or commit and commit the consumer lockfile.

Documentation

The Fumadocs site lives in docs/, with Installation and Quickstart guides.

cd docs
bun install --frozen-lockfile
bun run dev

Compatibility

Release history is recorded in CHANGELOG.md. The package version is defined in src/snnlab/__init__.py; Hatchling reads it when building.

To prepare a release, update that version and move the Unreleased changelog notes into a dated section matching the new version. Use patch versions for compatible fixes and minor versions for new functionality or breaking changes before 1.0. Changes to public APIs, numerical defaults or persisted formats need explicit changelog notes.

After checks pass, pushing the version change to main triggers the publishing workflow, which publishes to PyPI and creates the matching v<VERSION> Git tag. Publishing requires the repository's pypi environment and a PyPI Trusted Publisher configured for .github/workflows/publish.yml. The workflow can also be run manually to retry a release.

This initial extraction retains the existing bundle schemas, backend target tools/snnsim, component format versions and numerical defaults. Those strings identify persisted scientific contracts; they are not Python import paths. Package version 0.1.0 identifies the combined distribution.

The retained-data regression against historical Pinglab runs remains in Pinglab. The portable tests live here. No scientific runs or generated example bundles are shipped.

MIT licensed.

Metadata

Release files for snnlab 0.5.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 snnlab 0.5.0
File Size Uploaded
snnlab-0.5.0.tar.gz 3.0 MB Details

Built distribution (wheel)

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

Total release size: 3.2 MB

Release files / snnlab-0.5.0.tar.gz

Download URL snnlab-0.5.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b59e0a80b948cb215f8fff72d5ca9121130c59fc81fa3bf3401253d55e857736
BLAKE2b-256 checksum
How to use checksums
416d4fab949720016a49e91783ce90c314358389bd05a88484c37cd7bcf3cc34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Release files / snnlab-0.5.0-py3-none-any.whl

Download URL snnlab-0.5.0-py3-none-any.whl
Size 162.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ff0f6a2955604e9f0e30e4580f27903695763fe65243589fd778ab7073c1144
BLAKE2b-256 checksum
How to use checksums
e05e6725c411e9a94b52333d75233d24224cc1069a2e07fa7744a00c543c2f74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

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