Skip to main content

Python API for the PulsePal open-source pulse train generator

Project description

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

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

pypulsepal-0.4.4.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

pypulsepal-0.4.4-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file pypulsepal-0.4.4.tar.gz.

File metadata

  • Download URL: pypulsepal-0.4.4.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}

File hashes

Hashes for pypulsepal-0.4.4.tar.gz
Algorithm Hash digest
SHA256 16b2eab69c05b26118c1abfb254ec98ef5eeafe731c85ebad4608ee87d9fd6a5
MD5 6376e7deebabb1315ca69b4ff17274c0
BLAKE2b-256 d129356cd3ce92f34cb7142ecd64a16e878949fdf954aea98e47985b1c572b0c

See more details on using hashes here.

File details

Details for the file pypulsepal-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: pypulsepal-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}

File hashes

Hashes for pypulsepal-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0ddc1396b00da6a96eeaabaf024936f362870fa39e9615e155a84dea7ed8c670
MD5 26ed78e391decf63a6950616a48e545e
BLAKE2b-256 1f5203eedb837daee7318ffc9ee295c13ad56960178f3c1003063e5088e45459

See more details on using hashes here.

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