Parser — pyrotoolbox documentation

# Parser

some text here

This module contains parser to load data from different logfile formats.

The “parse” function is able to detect all possible input formats.

The return is for all functions a dataframe containing the data and a dictionary containing the parsed metadata. Independent of the input format the columns and metadata-names should be identical. Other functions in this module expect these naming conventions.

pyrotoolbox.parsers.parse(fname: str) → tuple[DataFrame, dict]

  Reads any pyroscience textfile. Not .pyr files! Returns a dataframe and a dict with metadata.

  Parameters:

    fname – path to the textfile

pyrotoolbox.parsers.read_workbench(fname: str) -> (<class 'pandas.core.frame.DataFrame'>, <class 'dict'>)

  Loads and parses a Workbench file and returns a pandas DataFrame and a dictionary with metadata

  Parameters:

    fname – file name of the logfile

  Returns:

    (DataFrame, metadata-dict)

pyrotoolbox.parsers.read_fireplate_workbench(fname: str) -> (<class 'pandas.core.frame.DataFrame'>, <class 'dict'>)

  Loads and parses a Workbench file of a fireplate and returns a pandas DataFrame and a dictionary with metadata

  Parameters:

    fname – path to the lofile

  Returns:

    DataFrame, metadata-dict

pyrotoolbox.parsers.read_developertool(fname: str) -> (<class 'pandas.core.frame.DataFrame'>, <class 'dict'>)

  Loads and parses a logfile from the PyroDeveloperTool

  Parameters:

    fname – path to the logfile

  Returns:

    (DataFrame, metadata-dict)

pyrotoolbox.parsers.read_developertool_directory(pattern: str = '*.txt')

  parses all files matching the pattern (default *.txt) and returns 3 dictionaries

  > first dictionary is UID/Name-ChX -> List of Dataframes

  > second dictionary is UID/Name-ChX -> List of metadata-dicts

  > third dictionary is UID/Name-ChX -> List of filenames

  Parameters:

    pattern – files to load. Default: *.txt

pyrotoolbox.parsers.read_aquaphoxlogger(fname: str) -> (<class 'pandas.core.frame.DataFrame'>, <class 'dict'>)

  Loads and parses a logfile from an AquapHOx-Logger

  Parameters:

    fname – path to the logfile

  Returns:

    (DataFrame, metadata-dict)

pyrotoolbox.parsers.read_fsgo2(fname: str) -> (<class 'pandas.core.frame.DataFrame'>, <class 'dict'>)

  Loads and parses a logfile from a FSGO2

  Parameters:

    fname – path to the logfile

  Returns:

    (DataFrame, metadata-dict)

## Examples

- Workbench
- FirePlate