Python library for importing XDF (Extensible Data Format)
Project description
pylsl
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
pylslworking directory, runpip install ..- Note: You can use
pip install -e .to install while keeping the files in-place. This is convenient for developing pylsl.
- Note: You can use
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/pylslpath will only exist after you installpylslin your Python environment. - You may have to create the
libsubfolder. - Use
python -m siteto find the "site-packages" path. - Use
cp -Lon 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,
PYLSL_LIB=/usr/local/lib/liblsl.so python -m pylsl.examples.{name-of-example}, orLD_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
- Manual way:
rm -Rf build dist *.egg-infopython setup.py sdist bdist_wheel- Additional steps on Linux:
auditwheel repair dist/*.whl -w distrm dist/*-linux_x86_64.whl
twine upload dist/*
- For conda
- build liblsl:
conda build ../liblsl/ conda build .
- build liblsl:
Known Issues with Multithreading on Linux
- At least for some versions of pylsl, it has been reported that running on Linux one cannot call
pylslfunctions 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylsl-1.18.1.tar.gz.
File metadata
- Download URL: pylsl-1.18.1.tar.gz
- Upload date:
- Size: 41.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a422d379f22e72ab94c65d815d420c9961dbc80064240062a4cbc72ba885f419
|
|
| MD5 |
11f38a34e5a6b36c9e82f47c77428a1b
|
|
| BLAKE2b-256 |
2be3150c0e54f94c42320046488e0b521fdf5f31c74c1690cb33ad65c2059f2a
|
File details
Details for the file pylsl-1.18.1-py2.py3-none-win_amd64.whl.
File metadata
- Download URL: pylsl-1.18.1-py2.py3-none-win_amd64.whl
- Upload date:
- Size: 306.0 kB
- Tags: Python 2, Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea2418f54a8cd0635960525ff4b8d4d388384dfd95cd82efd056297e46879944
|
|
| MD5 |
7649ebe8ccf463cab98a8b04a64713e6
|
|
| BLAKE2b-256 |
e6d89d3ff8f00b228f3f41fbfaef2ae25dbc8f285d203051cc9d87b6c1365b4c
|
File details
Details for the file pylsl-1.18.1-py2.py3-none-win32.whl.
File metadata
- Download URL: pylsl-1.18.1-py2.py3-none-win32.whl
- Upload date:
- Size: 271.7 kB
- Tags: Python 2, Python 3, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1c3af9d1ec1e9c849316fd6abdad99ec3b33d81de7d7192b5edaa6c408c5819
|
|
| MD5 |
fb9b5b070684ca2469f226f09ad87f40
|
|
| BLAKE2b-256 |
b2a56a534763ec6e4b608e3d8336c876bef3933e85f661c89f5478448210418e
|
File details
Details for the file pylsl-1.18.1-py2.py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: pylsl-1.18.1-py2.py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 982.3 kB
- Tags: Python 2, Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be1363b0470b4763731dbb3973150ae9fd3102666a2df725f866213ce0dd1776
|
|
| MD5 |
73f70a5033f9b804909ddbea71abdbcf
|
|
| BLAKE2b-256 |
3216f83685655ae474e8096271ec90cb71bc7fa27a25d916a25196b8a6658789
|
File details
Details for the file pylsl-1.18.1-py2.py3-none-macosx_11_0_universal2.whl.
File metadata
- Download URL: pylsl-1.18.1-py2.py3-none-macosx_11_0_universal2.whl
- Upload date:
- Size: 663.6 kB
- Tags: Python 2, Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
435346577a8e518450bf9babebcc8bf16973a6855a1fd083f1010dd6647d4e16
|
|
| MD5 |
2182c2c9a55dceb8bb5f2587dc8290c1
|
|
| BLAKE2b-256 |
b5ec4df5b087acc0cb84f0b32804006177e2f96feba539659d0b1bd05f7cd6c2
|
File details
Details for the file pylsl-1.18.1-py2.py3-none-any.whl.
File metadata
- Download URL: pylsl-1.18.1-py2.py3-none-any.whl
- Upload date:
- Size: 42.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a2eafe1b72dacc1d0bcf0f0fa2ba571d3183e55096b2bf37d3412b04cf33dc
|
|
| MD5 |
5e11f77f6e54b923afdeaf57a4518ebf
|
|
| BLAKE2b-256 |
50a36500a0b926ae84208db1d17004cf3903c813ecf0889d16e9446af7279cd2
|