Skip to main content

PyPulsePal

PyPI

Python API for the PulsePal open-source pulse train generator.

→ Full documentation

Example usage

Load and apply a saved config file:

from pypulsepal import PulsePal
from pypulsepal.config_io import load_config

cfg = load_config("my_params.json")   # or .yaml
with PulsePal.from_config(cfg, serial_port="/dev/ttyACM0") as pp:
    pp.trigger_selected_channels(channel_1=True)

Standard instantiation:

import time
from pypulsepal import PulsePal

pp = PulsePal(serial_port="/dev/ttyACM0")
pp.channel_configs[0].phase1Voltage = 5.0
pp.channel_configs[0].pulseTrainDuration = 1.0
pp.sync_all_params()
pp.trigger_selected_channels(channel_1=True)
time.sleep(1)
pp.stop_all_outputs()
pp.close()

As a context manager (saves settings and closes on exit automatically):

import time
from pypulsepal import PulsePal

with PulsePal(serial_port="/dev/ttyACM0") as pp:
    pp.channel_configs[0].phase1Voltage = 5.0
    pp.channel_configs[0].pulseTrainDuration = 1.0
    pp.sync_all_params()
    pp.trigger_selected_channels(channel_1=True)
    time.sleep(1)
    pp.stop_all_outputs()

Installation

pip install pypulsepal

With YAML config file support:

pip install "pypulsepal[yaml]"

From source:

git clone https://github.com/murineshiftwork/pypulsepal.git
cd pypulsepal
pip install -e ".[yaml]"

Citation

To cite PyPulsePal, reference the GitHub repository:

Rollik, Lars B. PyPulsePal: Python API for the PulsePal open-source pulse train generator. https://github.com/murineshiftwork/pypulsepal

Please also cite the original PulsePal hardware and PyBpod publications that this package builds on.

License & sources

This software is released under the GNU GPL v3.0.

This work is derived from the Sanworks PulsePal Python API (commit: 5bb189f).

src/pypulsepal/_arcom.py is vendored from pybpod-api 1.8.2 (MIT, Copyright © 2016 Champalimaud Foundation) with minor adaptations.

Useful references

Metadata

Release files for pypulsepal 0.4.6

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

Source distribution (sdist)

Source distribution for pypulsepal 0.4.6
File Size Uploaded
pypulsepal-0.4.6.tar.gz 20.5 kB Details

Built distribution (wheel)

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

Total release size: 36.3 kB

Release files / pypulsepal-0.4.6.tar.gz

Download URL pypulsepal-0.4.6.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5c153383fcf42ff1ac8feb5965bf63b30f958e5b6ec6d6c86aa07f62d80dcef0
BLAKE2b-256 checksum
How to use checksums
3caf34b004cbbf553b788a76f117b25df78f2e846d6383eca842cab7d85d6610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pypulsepal-0.4.6-py3-none-any.whl

Download URL pypulsepal-0.4.6-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c57b09ae57f1c3dec537ea3e0d5f2a78001fb8b7df5c2d0d27df228743bca12f
BLAKE2b-256 checksum
How to use checksums
f30b624ec7e9c65fed59c6c98de37dbed266653e14711d64c92347c7a3b83fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.4.6 This release

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.0.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