Skip to main content

Python interface to the Lab Streaming Layer

Project description

pylsl

Build status 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:

  • On many platforms it can be installed with conda install -c conda-forge liblsl
  • Additionally, on Mac it can be installed with brew install labstreaminglayer/tap/lsl
  • You might be able to find the appropriate liblsl shared object (*.so on Linux, *.dylib on MacOS, or *.dll on Windows) from the liblsl release page.
  • Otherwise you might try to clone liblsl and use its standalone_compilation_linux.sh script (works on raspberry pi).

Prepared distributions

Install from pypi using pip: pip install pylsl

For several distributions, the pip distribution ships with lsl.dll. For every other case, liblsl must be installed somewhere on the PATH (see Prerequisites above) or downloaded and copied somewhere on the search path. We recommend you copy it to the pylsl installed module path's lib subfolder. i.e. {path/to/env/}site-packages/pylsl/lib. Use python -m site to find the "site-packages" path. (use cp -L on platforms that use symlinks)

Self-built

  • Download the pylsl source: git clone https://github.com/labstreaminglayer/liblsl-Python.git && cd liblsl-Python
  • Copy the shared object (see Prerequisites above) into liblsl-Python/pylsl/lib.
  • From the liblsl-Python 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 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)"

For maintainers

Continuous Integration

pylsl uses continuous integration and distribution.

Whenever a new commit is pushed, AppVeyor prepares several files. First it prepares the source wheels -- this is useful on any platform & Python version that does not have a specific binary distribution. Then it prepares the binary wheels; it downloads liblsl from its releases page, copies it to the package, then builds wheels for distribution. This process is repeated for several variants of Windows and Mac.

In addition, whenever a new git tag is used on a commit that is pushed to the master branch, the CI systems will deploy the wheels to pypi.

Linux Binaries Deprecated

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

When we did make manylinux distributions, these relied on special liblsl builds that are not automatically pushed to the liblsl releases page. Special pipelines needed to be run manually on Azure, then the artifacts uploaded to the release page. The Azure pipelines config remains in the liblsl repo in case it is needed again (unlikely).

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 , is 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 mulithreading (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/liblsl-Python/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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pylsl-1.16.0-py2.py3-none-win_amd64.whl (352.1 kB view details)

Uploaded Python 2 Python 3 Windows x86-64

pylsl-1.16.0-py2.py3-none-win32.whl (282.1 kB view details)

Uploaded Python 2 Python 3 Windows x86

pylsl-1.16.0-py2.py3-none-macosx_12_0_arm64.whl (948.3 kB view details)

Uploaded Python 2 Python 3 macOS 12.0+ ARM64

pylsl-1.16.0-py2.py3-none-macosx_10_13_x86_64.whl (1.0 MB view details)

Uploaded Python 2 Python 3 macOS 10.13+ x86-64

pylsl-1.16.0-py2.py3-none-any.whl (36.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pylsl-1.16.0-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 352.1 kB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/2.7.17

File hashes

Hashes for pylsl-1.16.0-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a1e29e48c3cf49503f4a6247c1cc67cb6f76388fdcd37754813a156352ecd3e1
MD5 e3d0ecd3534d2f02a46dae53c1c4d265
BLAKE2b-256 203dffa1bf3afb5b6095b76c631558cdcf839a1f5ae069f1f14db2b859a5225e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.16.0-py2.py3-none-win32.whl
  • Upload date:
  • Size: 282.1 kB
  • Tags: Python 2, Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/2.7.17

File hashes

Hashes for pylsl-1.16.0-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 d15a76d92cf6c230fca1a430001cd07c34dea42950ca10a455d885345861714e
MD5 d3c0d4f73d1dbb8d3a3bf614d399177a
BLAKE2b-256 f34e05ab10eed12030cdacb528c6cb310f7f93e3155a2f1cd011e50332ba5bfd

See more details on using hashes here.

File details

Details for the file pylsl-1.16.0-py2.py3-none-macosx_12_0_arm64.whl.

File metadata

  • Download URL: pylsl-1.16.0-py2.py3-none-macosx_12_0_arm64.whl
  • Upload date:
  • Size: 948.3 kB
  • Tags: Python 2, Python 3, macOS 12.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/2.7.17

File hashes

Hashes for pylsl-1.16.0-py2.py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 9c579888721006c55b49fcb93fb67dc1d19b427b23461070c54bb048ab093ae0
MD5 592765cbc41a331f0523e21f4bb9a510
BLAKE2b-256 878ceb5a2327d7f123f6cd5ab026e64aec2adac321d8003999713bc12818831c

See more details on using hashes here.

File details

Details for the file pylsl-1.16.0-py2.py3-none-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: pylsl-1.16.0-py2.py3-none-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 2, Python 3, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/2.7.17

File hashes

Hashes for pylsl-1.16.0-py2.py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 673a280416dd58ee70cc41d1a82809100515c060c8b40f542dc5f9e68ca653a1
MD5 cb9a4c97d52d882079fe0af21bec5811
BLAKE2b-256 4d44b9a93ce76f1a36ac1a1537a42ffa6a5fb5c755e8974da70a394e7002d94c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylsl-1.16.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/2.7.17

File hashes

Hashes for pylsl-1.16.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e9f655aaeff3e5b3542b0958812949b0601c8ca1382b04edf13673b56b1331a0
MD5 1a0ff4a4ea44350e4beb66aae3d5d915
BLAKE2b-256 5098ceac2ffb2ed26ae5153ffe45457865cdc54bdbb67995efcc0f9ec83c405c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page