Skip to content

Neures-1158/labchart_txt_parser

LabChart Parser

CI License: MIT Python 3.10+

Parses ADInstruments LabChart .txt exports into a pandas DataFrame with blocks, continuous time, and comments.

Export from LabChart

LabChart export dialog

Set time display to "Start from Block" before exporting, and make sure "Block header" is ticked.

Install

pip install git+https://github.com/Neures-1158/labchart_txt_parser.git

For development: pip install -e ".[dev]" (adds pytest, ruff, black, isort).

Quick start

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.

Tests

pytest

Maintainer

Maintained under NEURES. Lead: Damien Bachasson, PhD (GitHub · ORCID · Lab). Issues and PRs welcome.

MIT licensed — see LICENSE.

About

Python package for parsing .txt exported labchart files

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages