[![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 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.
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/fe/4a/b9cf5def63e63ed2faa08533ff8c5e38443ddc101b82ddfce584b1d071e5/pyxdf-1.16.8.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 matplotlib.pyplot as plt\nimport numpy as np\n\nimport pyxdf\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, which 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.8",
"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": "c3224aa399b40a10a77e2594b8bf3063443a92b25d4c8bcc00303a49405c3188",
"md5": "6f8f5d06b08f60cf9f3df65dd5ef1629",
"sha256": "8745e4b41aae974d7327cd35ebeeed84cc010991200078ef3dead20e1e79bf2d"
},
"downloads": -1,
"filename": "pyxdf-1.16.8-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f8f5d06b08f60cf9f3df65dd5ef1629",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 17108,
"upload_time": "2024-07-18T07:19:18",
"upload_time_iso_8601": "2024-07-18T07:19:18.703990Z",
"url": "https://files.pythonhosted.org/packages/c3/22/4aa399b40a10a77e2594b8bf3063443a92b25d4c8bcc00303a49405c3188/pyxdf-1.16.8-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fe4ab9cf5def63e63ed2faa08533ff8c5e38443ddc101b82ddfce584b1d071e5",
"md5": "689aa3439f2fb0e66eac89aed17f20b9",
"sha256": "9c75db4e42b46bd8dbd69ff7ab190d7a461f55e28e2ff8279d5136d57f7849f6"
},
"downloads": -1,
"filename": "pyxdf-1.16.8.tar.gz",
"has_sig": false,
"md5_digest": "689aa3439f2fb0e66eac89aed17f20b9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 21714,
"upload_time": "2024-07-18T07:19:19",
"upload_time_iso_8601": "2024-07-18T07:19:19.974167Z",
"url": "https://files.pythonhosted.org/packages/fe/4a/b9cf5def63e63ed2faa08533ff8c5e38443ddc101b82ddfce584b1d071e5/pyxdf-1.16.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-18 07:19:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xdf-modules",
"github_project": "xdf-Python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyxdf"
}