mh_utils.csv_parser

Parser for CSV result files produced by MassHunter Qualitative.

New in version 0.2.0.

ResultParser(raw_results_dir, …)

Given a directory of CSV results exported from MassHunter, parse them to CSV and JSON.

parse_masshunter_csv(csv_file, csv_outfile, …)

Parse CSV results files created by MassHunter.

class ResultParser(raw_results_dir, json_results_dir, csv_results_dir)[source]

Bases: object

Given a directory of CSV results exported from MassHunter, parse them to CSV and JSON.

Parameters
  • raw_results_dir (Union[str, Path, PathLike]) – The directory in which the raw exports from MassHunter are stored.

  • json_results_dir (Union[str, Path, PathLike]) – The directory to store the output json files in.

  • csv_results_dir (Union[str, Path, PathLike]) – The directory to store the output csv files in.

parse_directory_list(directory_list)[source]

Runs parse_for_directory() for each directory in directory_list.

Parameters

directory_list (Iterable[Union[str, Path, PathLike]]) – A list of directories to process.

parse_for_directory(directory)[source]

Convert the “CSV Results.csv” file in the given directory to CSV and JSON.

Parameters

directory (Union[str, Path, PathLike])

parse_masshunter_csv(csv_file, csv_outfile, json_outfile)[source]

Parse CSV results files created by MassHunter.

Parameters