[![Latest PyPI Release](https://img.shields.io/pypi/v/pyxdf)](https://pypi.org/project/pyxdf/)
[![Latest Conda Release](https://img.shields.io/conda/vn/conda-forge/pyxdf)](https://anaconda.org/conda-forge/pyxdf)
![Python 3.9+](https://img.shields.io/badge/python-3.9+-green.svg)
![License](https://img.shields.io/github/license/xdf-modules/xdf-python)
pyXDF
=====
pyXDF is a Python importer for [XDF](https://github.com/sccn/xdf) files.
## Sample usage
``` python
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_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.
Raw data
{
"_id": null,
"home_page": "https://github.com/xdf-modules/xdf-Python",
"name": "pyxdf",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "XDF, pyxdf, LSL, Lab Streaming Layer, file format, biosignals, stream",
"author": "Christian Kothe",
"author_email": "christian.kothe@intheon.io",
"download_url": "https://files.pythonhosted.org/packages/19/b8/5fc096f1cbca2cac4dd5c060fa2734d79422844f54012991930a8293149d/pyxdf-1.16.6.tar.gz",
"platform": null,
"description": "[![Latest PyPI Release](https://img.shields.io/pypi/v/pyxdf)](https://pypi.org/project/pyxdf/)\n[![Latest Conda Release](https://img.shields.io/conda/vn/conda-forge/pyxdf)](https://anaconda.org/conda-forge/pyxdf)\n![Python 3.9+](https://img.shields.io/badge/python-3.9+-green.svg)\n![License](https://img.shields.io/github/license/xdf-modules/xdf-python)\n\npyXDF\n=====\n\npyXDF is a Python importer for [XDF](https://github.com/sccn/xdf) files.\n\n## Sample usage\n\n``` python\nimport pyxdf\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndata, header = pyxdf.load_xdf('test.xdf')\n\nfor stream in data:\n y = stream['time_series']\n\n if isinstance(y, list):\n # list of strings, draw one vertical line for each marker\n for timestamp, marker in zip(stream['time_stamps'], y):\n plt.axvline(x=timestamp)\n print(f'Marker \"{marker[0]}\" @ {timestamp:.2f}s')\n elif isinstance(y, np.ndarray):\n # numeric data, draw as lines\n plt.plot(stream['time_stamps'], y)\n else:\n raise RuntimeError('Unknown stream format')\n\nplt.show()\n```\n\n## CLI examples\n\n`pyxdf` has an `examples` module. These can be run from the command line for basic functionality.\n\n* `print_metadata` will enable a DEBUG logger to log read messages, then it will print basic metadata about each found stream.\n * `python -m pyxdf.examples.print_metadata -f=/path/to/my.xdf`\n* `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.\n * `python -m pyxdf.examples.playback_lsl /path/to/my.xdf` \n\n## Installation\n\nThe latest stable version can be installed with `pip install pyxdf`.\n\nFor the latest development version, use `pip install git+https://github.com/xdf-modules/pyxdf.git`.\n\n## For maintainers\n\nA 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.\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Python library for importing XDF (Extensible Data Format)",
"version": "1.16.6",
"project_urls": {
"Homepage": "https://github.com/xdf-modules/xdf-Python"
},
"split_keywords": [
"xdf",
" pyxdf",
" lsl",
" lab streaming layer",
" file format",
" biosignals",
" stream"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e4d4012411cccacd354088a762e75e0e2a75c7473e001e7a672515a3427b7bfe",
"md5": "5a7dba862e22555e064b24aa7915b296",
"sha256": "c9945b8debb1caf63345bbe01795b27b05a03788c266803e85e28d272a1d9d5f"
},
"downloads": -1,
"filename": "pyxdf-1.16.6-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "5a7dba862e22555e064b24aa7915b296",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 18836,
"upload_time": "2024-04-18T07:53:09",
"upload_time_iso_8601": "2024-04-18T07:53:09.526301Z",
"url": "https://files.pythonhosted.org/packages/e4/d4/012411cccacd354088a762e75e0e2a75c7473e001e7a672515a3427b7bfe/pyxdf-1.16.6-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "19b85fc096f1cbca2cac4dd5c060fa2734d79422844f54012991930a8293149d",
"md5": "f78e109eff9c10b7597320f343050642",
"sha256": "7d1aa8b6a07703a3cea0805b45d232e00081dd8678fd0f49e0421bcfc29078e9"
},
"downloads": -1,
"filename": "pyxdf-1.16.6.tar.gz",
"has_sig": false,
"md5_digest": "f78e109eff9c10b7597320f343050642",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 21683,
"upload_time": "2024-04-18T07:53:11",
"upload_time_iso_8601": "2024-04-18T07:53:11.310335Z",
"url": "https://files.pythonhosted.org/packages/19/b8/5fc096f1cbca2cac4dd5c060fa2734d79422844f54012991930a8293149d/pyxdf-1.16.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-18 07:53:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xdf-modules",
"github_project": "xdf-Python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyxdf"
}