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.2.tar.gz (42.8 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.2-py2.py3-none-win_amd64.whl (307.5 kB view details)

Uploaded Python 2Python 3Windows x86-64

pylsl-1.18.2-py2.py3-none-win32.whl (272.6 kB view details)

Uploaded Python 2Python 3Windows x86

pylsl-1.18.2-py2.py3-none-manylinux_2_35_x86_64.whl (1.0 MB view details)

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

pylsl-1.18.2-py2.py3-none-macosx_11_0_universal2.whl (662.4 kB view details)

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

pylsl-1.18.2-py2.py3-none-any.whl (42.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pylsl-1.18.2.tar.gz.

File metadata

  • Download URL: pylsl-1.18.2.tar.gz
  • Upload date:
  • Size: 42.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2.tar.gz
Algorithm Hash digest
SHA256 e0f591bc9722d976c3cd3721c958ef3d9fc2b2bbe32e9218609a6f6070349a88
MD5 34c380c557706365add1db4e20e81dc4
BLAKE2b-256 a922f7f331841138351653388797c8b786f7d50dbfb96ab7d5c3faf8b79ea1b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.2-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 307.5 kB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3ea2693417c7d79766cebf967250fde78aa1a3ad2b198e40246d36f549dbfde1
MD5 42dccd00af945fe3c656ec00b69dfe5f
BLAKE2b-256 8aa88ccb88b3cd65140e57966472038baa0cebb56bde5e86ad51852faed99cad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.2-py2.py3-none-win32.whl
  • Upload date:
  • Size: 272.6 kB
  • Tags: Python 2, Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 2f9f50aa16510600066e43628a1b66ac6b6a32b321de3000824f9c60e26cfbfa
MD5 14394e395d6eb097aeb6290db819a2f2
BLAKE2b-256 2cb1e599a7327376e29847dd00b33f127b9238e76d9aedd27eae6eb9ff77a190

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.2-py2.py3-none-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2-py2.py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f0331fed141cf19be65017e6529edff79b8505b4781e9e1838c95de5d072ade4
MD5 eb481f21e58caf289b4dd5d3aac8914b
BLAKE2b-256 6408c2ae65d3fe8d1cfaa4be05617a6f6af71342ba0dc1750363b929098065b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.2-py2.py3-none-macosx_11_0_universal2.whl
  • Upload date:
  • Size: 662.4 kB
  • Tags: Python 2, Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2-py2.py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 dd459aaa36af808cca4e4046ae926b42886fdd9672b219bfd4dd154010ca1c8b
MD5 ce57ab13fa75f1bd1c0b3a3bbf6f0322
BLAKE2b-256 6e7f9f19c023dfb770ffe23031e05251e64fcf3f3bfc4f51d16d352b8e58f5ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 42.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0758d45b13aa97beb806884ec607648fe6568505b04c3ce152bfea214a4f06c2
MD5 6f4ff79028b013d0be8f48a44128e883
BLAKE2b-256 79274daf3a230344ce9bd25b9a68cd674819deaaedb994a141d61a2d17ca6823

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