swamp.parsers.parser module

class Parser(fname=None, stdout=None, logger=None)[source]

Bases: abc.ABC

Parser abstract class

This class contains general methods and data structures to extract information from the output created by the classes at :py:obj`~swamp.wrappers`

Parameters:
  • fname (str) – name of the file to be parsed (default None)
  • stdout (str) – the stdout to be parsed (default None)
  • logger (SwampLogger) – logging interface for the parser (default None)
Variables:
  • error (bool) – True if an error has occurred while parsing the file or the stdout
  • inputfile_contents (str) – contains the full contents of the input file if any is given
check_input()[source]

Check if fname exists

parse()[source]

Abstract method to run the parser

summary

Abstract property to store a summary of the parsed figures of merit