pyXDF
pyXDF is a Python importer for XDF files.
Sample usage
import pyxdf
import matplotlib.pyplot as plt
import numpy as np
data, header = pyxdf.load_xdf('test.xdf')
for stream in data:
y = stream['time_series']
if isinstance(y, list):
# list of strings, draw one vertical line for each marker
for timestamp, marker in zip(stream['time_stamps'], y):
plt.axvline(x=timestamp)
print(f'Marker "{marker[0]}" @ {timestamp:.2f}s')
elif isinstance(y, np.ndarray):
# numeric data, draw as lines
plt.plot(stream['time_stamps'], y)
else:
raise RuntimeError('Unknown stream format')
plt.show()
CLI examples
pyxdf has an examples module. These can be run from the command line for basic functionality.
print_metadatawill enable a DEBUG logger to log read messages, then it will print basic metadata about each found stream.python -m pyxdf.examples.print_metadata -f=/path/to/my.xdf
playback_lslwill open an XDF file then replay its data in an infinite loop, but using current timestamps. This is useful for prototyping online processing.python -m pyxdf.examples.playback_lsl /path/to/my.xdf
Installation
The latest stable version can be installed with pip install pyxdf.
For the latest development version, use pip install git+https://github.com/xdf-modules/pyxdf.git.
For maintainers
A new release is automatically uploaded to PyPI. Therefore, as soon as a new release is created on GitHub (using a tag labeled e.g. v1.16.3), a PyPI package is created with the version number matching the release tag.
Metadata
Release files for pyxdf 1.16.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyxdf-1.16.6.tar.gz | 21.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyxdf-1.16.6-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 40.5 kB
Release files / pyxdf-1.16.6.tar.gz
| Download URL | pyxdf-1.16.6.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d1aa8b6a07703a3cea0805b45d232e00081dd8678fd0f49e0421bcfc29078e9
|
|
BLAKE2b-256 checksum How to use checksums |
19b85fc096f1cbca2cac4dd5c060fa2734d79422844f54012991930a8293149d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / pyxdf-1.16.6-py2.py3-none-any.whl
| Download URL | pyxdf-1.16.6-py2.py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c9945b8debb1caf63345bbe01795b27b05a03788c266803e85e28d272a1d9d5f
|
|
BLAKE2b-256 checksum How to use checksums |
e4d4012411cccacd354088a762e75e0e2a75c7473e001e7a672515a3427b7bfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|