Skip to main content

Python package for importing XDF (Extensible Data Format) files

Project description

Latest PyPI Release Latest Conda Release Python 3.10+ License

PyXDF

PyXDF is a Python importer for XDF files.

Sample usage

The following example loads minimal.xdf (which you can download from here) and prints/plots all markers:

import matplotlib.pyplot as plt
import numpy as np

import pyxdf

data, header = pyxdf.load_xdf("minimal.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()

Note that you need to have matplotlib installed to run this example (which is not a dependency of PyXDF itself).

Command line interface (CLI)

PyXDF has a command line interface (CLI) with the following commands:

  • print_metadata will print basic metadata for each found stream.
    • python -m pyxdf.cli.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.cli.playback_lsl /path/to/my.xdf --loop

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

As soon as a new release is created on GitHub (using a tag labeled e.g. v1.16.3), a PyPI package is automatically 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.17.3.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxdf-1.17.3-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyxdf-1.17.3.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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 pyxdf-1.17.3.tar.gz
Algorithm Hash digest
SHA256 8294353f2989885177277e4a02e260dc9430a60b53b463bad8cdc179fb2c47ce
MD5 e03e581d1e55380c6c51ba4a76be0fb9
BLAKE2b-256 f31e60ad39e13262040b693475619c55efcb8d5e52129f2bb52c911e434da829

See more details on using hashes here.

File details

Details for the file pyxdf-1.17.3-py3-none-any.whl.

File metadata

  • Download URL: pyxdf-1.17.3-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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 pyxdf-1.17.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c7c01d65e5b9144d544f886debc56b46f7807a014192b9f49bcbdb75b3f19a47
MD5 0ebdf45efda310d475fb6d7dd96ec887
BLAKE2b-256 1fb1da571fa66bc52bac76702cdadfd734aad9ac4f7313da1430c3fb5203eb2f

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