Skip to main content

Python library for LSL (lab streaming layer)

Project description

pylsl

publish workflow PyPI version

This is the Python interface to the Lab Streaming Layer (LSL). LSL is an overlay network for real-time exchange of time series between applications, most often used in research environments. LSL has clients for many other languages and platforms that are compatible with each other.

Let us know if you encounter any bugs (ideally using the issue tracker on the GitHub project).

Installation

Prerequisites

On all non-Windows platforms and for some Windows-Python combinations, you must first obtain a liblsl shared library. See the liblsl repo documentation for further details.

Get pylsl from PyPI

  • pip install pylsl

Get pylsl from source

This should only be necessary if you need to modify or debug pylsl.

  • Download the pylsl source: git clone https://github.com/labstreaminglayer/pylsl.git && cd pylsl
  • From the pylsl working directory, run pip install ..
    • Note: You can use pip install -e . to install while keeping the files in-place. This is convenient for developing pylsl.

Usage

See the examples in src/pylsl/examples. Note that these can be run directly from the commandline with (e.g.) python -m pylsl.examples.{name-of-example}.

You can get a list of the examples with python -c "import pylsl.examples; help(pylsl.examples)"

liblsl loading

pylsl will search for liblsl first at the filepath specified by an environment variable named PYLSL_LIB, then in the package directory (default location for Windows), then finally in normal system library folders.

If the shared object is not installed onto a standard search path (or it is but can't be found for some other bug), then we recommend that you copy it to the pylsl installed module path's lib subfolder. i.e. {path/to/env/}site-packages/pylsl/lib.

  • The site-packages/pylsl path will only exist after you install pylsl in your Python environment.
  • You may have to create the lib subfolder.
  • Use python -m site to find the "site-packages" path.
  • Use cp -L on platforms that use symlinks.

Alternatively, you can use an environment variable. Set the PYLSL_LIB environment variable to the location of the library or set LD_LIBRARY_PATH to the folder containing the library. For example,

  1. PYLSL_LIB=/usr/local/lib/liblsl.so python -m pylsl.examples.{name-of-example}, or
  2. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib python -m pylsl.examples.{name-of-example}

For maintainers

Continuous Integration

pylsl uses continuous integration and distribution. GitHub Actions will upload a new release to pypi whenever a Release is created in GitHub. Before creating the GitHub release, be sure to bump the version number in pylsl/version.py and consider updating the liblsl dependency in .github/workflows/publish-to-pypi.yml.

Linux Binaries Deprecated

We recently stopped building binary wheels for Linux. In practice, the manylinux dependencies were often incompatible with real systems.

Manual Distribution

  1. Manual way:
    1. rm -Rf build dist *.egg-info
    2. python setup.py sdist bdist_wheel
    3. Additional steps on Linux:
      • auditwheel repair dist/*.whl -w dist
      • rm dist/*-linux_x86_64.whl
    4. twine upload dist/*
  2. For conda
    1. build liblsl: conda build ../liblsl/
    2. conda build .

Known Issues with Multithreading on Linux

  • At least for some versions of pylsl, it has been reported that running on Linux one cannot call pylsl functions from a thread that is not the main thread. This has been reported to cause access violations, and can occur during pulling from an inlet, and also from accessing an inlets info structure in a thread.
  • Recent tests with multithreading (especially when safeguarding library calls with locks) using Python 3.7.6. with pylsl 1.14 on Linux Mint 20 suggest that this issue is solved, or at least depends on your machine. See https://github.com/labstreaminglayer/pylsl/issues/29

Acknowledgments

Pylsl was primarily written by Christian Kothe while at Swartz Center for Computational Neuroscience, UCSD. The LSL project was funded by the Army Research Laboratory under Cooperative Agreement Number W911NF-10-2-0022 as well as through NINDS grant 3R01NS047293-06S1. pylsl is maintained primarily by Chadwick Boulay. Thanks for contributions, bug reports, and suggestions go to Bastian Venthur, David Medine, Clemens Brunner, and Matthew Grivich.

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

pylsl-1.18.4b1.tar.gz (47.0 kB view details)

Uploaded Source

Built Distributions

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

pylsl-1.18.4b1-py2.py3-none-win_amd64.whl (330.0 kB view details)

Uploaded Python 2Python 3Windows x86-64

pylsl-1.18.4b1-py2.py3-none-win32.whl (291.9 kB view details)

Uploaded Python 2Python 3Windows x86

pylsl-1.18.4b1-py2.py3-none-manylinux_2_35_x86_64.whl (1.3 MB view details)

Uploaded Python 2Python 3manylinux: glibc 2.35+ x86-64

pylsl-1.18.4b1-py2.py3-none-macosx_11_0_universal2.whl (729.6 kB view details)

Uploaded Python 2Python 3macOS 11.0+ universal2 (ARM64, x86-64)

pylsl-1.18.4b1-py2.py3-none-any.whl (44.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pylsl-1.18.4b1.tar.gz.

File metadata

  • Download URL: pylsl-1.18.4b1.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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 pylsl-1.18.4b1.tar.gz
Algorithm Hash digest
SHA256 a8512af335fccb747d52660872c909038249b185c5639b36ab1f9ff8cc83da8b
MD5 cb1904d6c8c91a5d09bcb171cdf9d1a4
BLAKE2b-256 6c9c8010d9e14f3ee7de0d4a9f315b5c21524a1a402b67071fd2c70ca9c586fb

See more details on using hashes here.

File details

Details for the file pylsl-1.18.4b1-py2.py3-none-win_amd64.whl.

File metadata

  • Download URL: pylsl-1.18.4b1-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 330.0 kB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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 pylsl-1.18.4b1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f971b60fdc5a12808433f6b6e3b92e2f2243e782345603c690b25bdb4a23da31
MD5 11fb9339124bc8847925fff8f794dbce
BLAKE2b-256 d4e44f2157ca4f98440b309670deba7a87451fee61ebafdb50db2cfe9cf9bcb0

See more details on using hashes here.

File details

Details for the file pylsl-1.18.4b1-py2.py3-none-win32.whl.

File metadata

  • Download URL: pylsl-1.18.4b1-py2.py3-none-win32.whl
  • Upload date:
  • Size: 291.9 kB
  • Tags: Python 2, Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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 pylsl-1.18.4b1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 53214f7e0508766eeb56b443554118bd1ac1fe308e876281b64cda90140e8eff
MD5 a6b5f2fcaa2801c570b53d37c93a5fe3
BLAKE2b-256 495ec2e7f20e04464a0a2f75e0638fc4ae12ef135dc6dd80f11b14cc0c320e64

See more details on using hashes here.

File details

Details for the file pylsl-1.18.4b1-py2.py3-none-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: pylsl-1.18.4b1-py2.py3-none-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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 pylsl-1.18.4b1-py2.py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0528143f34f41c975c273ea4eb469eb9e954292adf5f8cf8697a08b0505fa00c
MD5 1d8a592cc8052636baa56e18f94c2c7d
BLAKE2b-256 29e6953b69ec350b9f36d28af75d6a0e6c261ad6ec911d29901deea4c71e3679

See more details on using hashes here.

File details

Details for the file pylsl-1.18.4b1-py2.py3-none-macosx_11_0_universal2.whl.

File metadata

  • Download URL: pylsl-1.18.4b1-py2.py3-none-macosx_11_0_universal2.whl
  • Upload date:
  • Size: 729.6 kB
  • Tags: Python 2, Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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 pylsl-1.18.4b1-py2.py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 108097b43bb5ca3de291eefa5d2ffdab9cf13b883ec8af4370dbd27146e2b4ad
MD5 4d3c94ea899aec871e044f176c03ada6
BLAKE2b-256 eccbb124f202bcea2b347eee22cdd4052468dff60f3520d1b7f1df92ba54de84

See more details on using hashes here.

File details

Details for the file pylsl-1.18.4b1-py2.py3-none-any.whl.

File metadata

  • Download URL: pylsl-1.18.4b1-py2.py3-none-any.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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 pylsl-1.18.4b1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 96821c876e1471d940e6d8dada24a7b54fd4a56cc505609942561fad68d05af3
MD5 63b88593e04ecd95ce0f3e2f0e7d9f29
BLAKE2b-256 aaef2f354e299dd704743a8b146fe7cce018c99417d35d28e316c2a23d187b2d

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