Parses ADInstruments LabChart .txt exports into a pandas DataFrame with
blocks, continuous time, and comments.
Set time display to "Start from Block" before exporting, and make sure "Block header" is ticked.
pip install git+https://github.com/Neures-1158/labchart_txt_parser.gitFor development: pip install -e ".[dev]" (adds pytest, ruff, black, isort).
from labchart_parser import LabChartFile
lc = LabChartFile.from_file("data/recording.txt")
lc.metadata # dict; per-block metadata under lc.metadata["blocks"]
lc.channels # ['Flow', 'Pressure', 'Volume', ...]
lc.blocks # [1, 2, 3, ...]
lc.get_block_df(1) # one block as a DataFrame
lc.get_channel(1, "Pressure")
lc.slice_time_abs(10.0, 20.0)
lc.plot_channel("Flow", block=1)A walkthrough notebook lives at examples/labchart_parser_walkthrough.ipynb. For breath-by-breath analysis on top of this parser, see resp_metrics.
pytestMaintained under NEURES. Lead: Damien Bachasson, PhD (GitHub · ORCID · Lab). Issues and PRs welcome.
MIT licensed — see LICENSE.
