Skip to main content

Python library for importing XDF (Extensible Data Format)

Project description

Latest PyPI Release Latest Conda Release Python 3.9+ License

pyXDF

pyXDF is a Python importer for XDF files.

Sample usage

import matplotlib.pyplot as plt
import numpy as np

import pyxdf

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, which can be run from the command line for basic functionality.

  • print_metadata will 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_lsl will 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.

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

pyxdf-1.16.8.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

pyxdf-1.16.8-py2.py3-none-any.whl (17.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyxdf-1.16.8.tar.gz.

File metadata

  • Download URL: pyxdf-1.16.8.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pyxdf-1.16.8.tar.gz
Algorithm Hash digest
SHA256 9c75db4e42b46bd8dbd69ff7ab190d7a461f55e28e2ff8279d5136d57f7849f6
MD5 689aa3439f2fb0e66eac89aed17f20b9
BLAKE2b-256 fe4ab9cf5def63e63ed2faa08533ff8c5e38443ddc101b82ddfce584b1d071e5

See more details on using hashes here.

File details

Details for the file pyxdf-1.16.8-py2.py3-none-any.whl.

File metadata

  • Download URL: pyxdf-1.16.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pyxdf-1.16.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8745e4b41aae974d7327cd35ebeeed84cc010991200078ef3dead20e1e79bf2d
MD5 6f8f5d06b08f60cf9f3df65dd5ef1629
BLAKE2b-256 c3224aa399b40a10a77e2594b8bf3063443a92b25d4c8bcc00303a49405c3188

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