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.3b1.tar.gz (45.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.3b1-py2.py3-none-win_amd64.whl (329.3 kB view details)

Uploaded Python 2Python 3Windows x86-64

pylsl-1.18.3b1-py2.py3-none-win32.whl (291.2 kB view details)

Uploaded Python 2Python 3Windows x86

pylsl-1.18.3b1-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.3b1-py2.py3-none-macosx_11_0_universal2.whl (729.0 kB view details)

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

pylsl-1.18.3b1-py2.py3-none-any.whl (43.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pylsl-1.18.3b1.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3b1.tar.gz
Algorithm Hash digest
SHA256 1325bb60a0996c881aba6dc6029556a95e2ebebf55658cf9acc8b5052bb6a53c
MD5 7884dfa62e68bad1252d0dadb93f4e42
BLAKE2b-256 3a86f31d8d3b11a7c8f28fe926259faabf41ef98f47d7e956cd06994dd2a703e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.3b1-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 329.3 kB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3b1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cde9d0fdee1fa2a75a1f7c10eeabd4df55918c2e409b437c48a0eaf0ab507c2e
MD5 75f32440ba300dfd6d021bef210533d3
BLAKE2b-256 73e64057534e3575d32c897d15cc52eb2af9e1a78a7cb138763a59a0fb71ae27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.3b1-py2.py3-none-win32.whl
  • Upload date:
  • Size: 291.2 kB
  • Tags: Python 2, Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3b1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 fb8c303150f4ca5ac4b37d0e643235213f399bd8dea2086d2b4b6f4006d0dc3a
MD5 bc84643b7eda26e382f691d12dbc996e
BLAKE2b-256 f257c9872bbba993e4b2ebd02dac12268ed4ad8834b4531f8327ad9e7b740584

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.3b1-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.23 {"installer":{"name":"uv","version":"0.11.23","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.3b1-py2.py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 d0727044e4c18678562106cf4b576dfb163eeb0454e70214aa960c707b005b1b
MD5 70be938747478e4e703e071726d5adfc
BLAKE2b-256 9f01f757159e8539543734839a1b72e9dbc89e98f951fadae0344b07b55a61a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.3b1-py2.py3-none-macosx_11_0_universal2.whl
  • Upload date:
  • Size: 729.0 kB
  • Tags: Python 2, Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3b1-py2.py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 1909c083de610d6eb1770fe95619dd0fea85248b00a7aaacb65fd35f6dcf59c0
MD5 6164af6a5065b85c1d58dca8ceda8f58
BLAKE2b-256 6b5cd7f0c18b562a53076b9e12a9fe629ce88958939715d07f5027210636d3da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.18.3b1-py2.py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.3b1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 16922d22cad9da0331450b1deb1f7565519405c28aec107c83366e584cd963ba
MD5 5679d4f3299ad3c7c10fe91fa655070a
BLAKE2b-256 f378453ffca765ed72e6576e3f00ce2a3bccc8961ffc5f118f1d31863f75dfc6

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